package cn.reghao.bnt.web.devops.builder.chain.impl;

import cn.reghao.bnt.web.devops.builder.chain.HandlerResult;
import cn.reghao.bnt.web.devops.builder.model.AppDto;
import cn.reghao.bnt.web.devops.builder.model.BuildConfigDto;
import cn.reghao.bnt.web.devops.builder.model.BuildConsumedDto;
import cn.reghao.bnt.web.devops.builder.tool.repo.CommitInfo;
import cn.reghao.jutil.jdk.web.result.Result;
import lombok.Getter;
import lombok.Setter;

/**
 * @author reghao
 * @date 2022-05-07 15:05:21
 */
@Setter
@Getter
public class BuildChainResult extends HandlerResult {
    private String buildLogId;
    private AppDto appDto;
    @Deprecated
    private BuildConfigDto buildConfigDto;
    private String dockerfile;
    private CommitInfo commitInfo;
    private String packagePath;
    private BuildConsumedDto buildConsumedDto;
    private Result result;
    private String buildBy;

    public BuildChainResult(String buildLogId, AppDto appDto, String buildBy) {
        this.buildLogId = buildLogId;
        this.appDto = appDto;
        this.buildConfigDto = appDto.getBuildConfigDto();
        this.dockerfile = appDto.getDockerfile();
        this.buildConsumedDto = new BuildConsumedDto();
        this.buildBy = buildBy;
    }
}
