package com.friday.tooldriver.constants;

public class TaieOcManageCode {
    public static final TaieOcManageCode SUCCESS = valueOf(0,"成功");
    public static final TaieOcManageCode FAIL = valueOf(1000,"失败");
    public static final TaieOcManageCode INTERNAL_ERROR = valueOf(500,"系统内部错误");

    public static final TaieOcManageCode ACTIVITY_STATE_ERROR = valueOf(1001,"该代码包处于活动状态，不可删除");

    public static final TaieOcManageCode PACKAGE_NOT_EXIST = valueOf(1002,"代码包不存在，无法发布版本");

    public static final TaieOcManageCode PROCESS_ALREADY_RELEASE = valueOf(1003,"该版本已发布，无需重复发布");

    public static final TaieOcManageCode LICENSE_AQUIRE = valueOf(1004, "获取license信息失败");

    public static final TaieOcManageCode TENANT_NOT_EXIST = valueOf(1005,"中控租户信息不存在");

    public static final TaieOcManageCode OC_NOT_EXIST = valueOf(1006, "中控信息不存在");

    public static final TaieOcManageCode ROBOT_NOT_EXIST = valueOf(1007, "robot信息不存在");

    public static final TaieOcManageCode PARAM_VERIFY_ERROR = valueOf(1008,"参数校验失败，必传参数为空");

    public static final TaieOcManageCode LICENSE_NOT_EXIST = valueOf(1009, "license许可信息不存在");

    public static final TaieOcManageCode GROUP_NOT_EXIST = valueOf(1010, "中控组信息不存在，请先创建组");

    public static final TaieOcManageCode DRIVER_GROUP_EMPTY = valueOf(1011, "必传参数中控组信息为空");

    public static final TaieOcManageCode DRIVER_GROUP_ALREADY_EXIST = valueOf(1011, "中控组信息已存在");

    public static final TaieOcManageCode OC_TENANT_INFO_UPDATE_ERROR = valueOf(1012, "中控租户信息更新失败");

    protected static TaieOcManageCode valueOf(int code, String message) {
        return new TaieOcManageCode(code, message);
    }

    private int code;
    private String message;

    public TaieOcManageCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return this.code;
    }

    public String getMessage() {
        return this.message;
    }

    @Override
    public String toString() {
        return "system code: " + this.code + ", " + this.message;
    }

    public String toString(String ... str){
        return "system code: " + this.code + ", " + this.message + ": " + String.join(", ", str);
    }
}
