package cn.reghao.devops.web.mgr.build.chain.impl;

import cn.reghao.devops.web.mgr.build.model.AppDto;
import cn.reghao.devops.web.mgr.build.model.BuildConfigDto;
import cn.reghao.devops.web.mgr.build.model.BuildConsumedDto;
import cn.reghao.devops.web.mgr.build.chain.HandlerResult;
import cn.reghao.devops.web.mgr.build.tool.repo.CommitInfo;
import cn.reghao.jutil.jdk.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;
    }
}
