package cn.reghao.autodop.dmaster.app.model.po.config.build;

import cn.reghao.autodop.dmaster.app.model.constant.build.CompileType;
import cn.reghao.autodop.dmaster.util.validator.ValidEnum;
import cn.reghao.autodop.dmaster.util.db.BaseEntity;
import lombok.*;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.validation.constraints.NotBlank;

/**
 * 编译方式配置
 *
 * @author reghao
 * @date 2021-02-05 17:37:28
 */
@NoArgsConstructor
@Getter
@Setter
@Entity
public class CompilerConfig extends BaseEntity<Integer> {
    @NotBlank(message = "机器 ID 不能为空白字符串")
    private String machineId;
    private String machineIpv4;
    @Column(nullable = false)
    @ValidEnum(value = CompileType.class, message = "请选择正确的编译类型")
    private String type;
    @Column(nullable = false, unique = true)
    @NotBlank(message = "编译器名字不能为空白字符串")
    private String name;
    // TODO 使用 shell 脚本替代 shell 命令
    private String compileCmd;
    private String homePath;
}
