package cn.reghao.bnt.web.devops.app.model.vo;

import cn.reghao.bnt.web.devops.app.model.po.log.BuildLog;
import cn.reghao.jutil.jdk.converter.DateTimeConverter;
import lombok.Data;

/**
 * @author reghao
 * @date 2021-10-20 21:26:02
 */
@Data
public class BuildLogVO {
    private String buildLogId;
    private String appId;
    private String appType;
    private String env;
    private String branch;
    private String commitId;
    private String buildTime;
    private String packagePath;
    private String buildBy;

    public BuildLogVO(BuildLog buildLog) {
        this.buildLogId = buildLog.getBuildLogId();
        this.appId = buildLog.getAppConfig().getAppId();
        this.appType = buildLog.getAppConfig().getAppType();
        this.env = buildLog.getAppConfig().getEnv();
        this.branch = buildLog.getAppConfig().getRepoBranch();
        this.commitId = buildLog.getCommitId();
        this.buildTime = DateTimeConverter.format(buildLog.getBuildTime());
        this.packagePath = buildLog.getPackagePath();
        this.buildBy = buildLog.getBuildBy();
    }
}
