package cn.reghao.devops.web.mgr.builds.model.vo;

import cn.reghao.devops.web.mgr.build.tool.repo.ChangedFile;
import cn.reghao.devops.web.mgr.build.tool.repo.CommitInfo;
import cn.reghao.jutil.jdk.converter.DateTimeConverter;
import lombok.Data;

import java.util.List;

/**
 * @author reghao
 * @date 2021-10-20 20:40:37
 */
@Data
public class CommitInfoVO {
    private String commitAuthor;
    private String commitMsg;
    private String commitTime;
    private List<ChangedFile> changedFiles;

    public CommitInfoVO(CommitInfo commitInfo) {
        this.commitAuthor = commitInfo.getCommitAuthor();
        this.commitMsg = commitInfo.getCommitMsg();
        this.commitTime = DateTimeConverter.format(commitInfo.getMsCommitTime());
        this.changedFiles = commitInfo.getChangedFiles();
    }
}
