package com.friday.tooldriver.constants.infodator;

public enum InfodatorApiErrorCode {
    // 登录相关
    LOGIN_KEY_ERROR("INFODATOR_LOGIN_001", "INFODATOR认证接口获取加密秘钥失败"),
    CREATE_TOKEN_ERROR("INFODATOR_LOGIN_002", "INFODATOR登录接口创建token失败"),
    // 组相关
    GROUP_ADD_ERROR("INFODATOR_GROUP_001", "INFODATOR创建组失败"),
    GROUP_INFO_ERROR("INFODATOR_GROUP_002", "INFODATOR获取一个组的信息失败"),
    GROUP_GET_ALL_NAME_ERROR("INFODATOR_GROUP_003", "INFODATOR获取所有组的名称失败"),
    GROUP_DELETE_ERROR("INFODATOR_GROUP_004", "INFODATOR删除组失败"),
    GROUP_DELETE_REMOVE_ERROR("INFODATOR_GROUP_005", "INFODATOR转移组失败"),
    GROUP_UPDATE_ERROR("INFODATOR_GROUP_006", "INFODATOR更新组的属性失败"),
    // 用户相关
    USER_ADD_ERROR("INFODATOR_USER_001", "INFODATOR创建用户失败"),
    USER_PASSWORD_CHANGE_ERROR("INFODATOR_USER_002", "INFODATOR修改用户密码失败"),
    USER_PASSWORD_CHANGE_ADMIN_ERROR("INFODATOR_USER_003", "INFODATOR管理员修改用户密码失败"),
    USER_CHANGE_ERROR("INFODATOR_USER_004", "INFODATOR修改用户失败"),
    USER_CONFORM_PROTOCOL_ERROR("INFODATOR_USER_005", "INFODATOR确认用户协议失败"),
    USER_DELETE_ERROR("INFODATOR_USER_006", "INFODATOR删除用户失败"),
    USER_FIND_INFO_BY_TOKEN_ERROR("INFODATOR_USER_007", "INFODATOR根据Token获取用户信息失败"),
    USER_INFO_ERROR("INFODATOR_USER_008", "INFODATOR获取一个用户信息失败"),
    USER_LIST_ERROR("INFODATOR_USER_009", "INFODATOR获取用户列表失败"),
    USER_RESET_SECRET_ERROR("INFODATOR_USER_010", "INFODATOR重置秘钥信息"),
    // 任务相关
    TASK_ADD_ERROR("INFODATOR_TASK_001", "INFODATOR添加任务失败"),
    TASK_ADD_EASY_ERROR("INFODATOR_TASK_002", "INFODATOR通过简单参数添加任务失败"),
    TASK_START_ERROR("INFODATOR_TASK_003", "INFODATOR启动任务失败"),
    TASK_COLLECT_ERROR("INFODATOR_TASK_004", "INFODATOR收藏任务失败"),
    TASK_COLLECT_CANCEL_ERROR("INFODATOR_TASK_005", "INFODATOR取消收藏任务失败"),
    TASK_DELETE_ERROR("INFODATOR_TASK_006", "INFODATOR删除任务失败"),
    TASK_UPDATE_ERROR("INFODATOR_TASK_007", "INFODATOR更新任务失败"),
    TASK_DETAIL_ERROR("INFODATOR_TASK_008", "INFODATOR获取任务详情失败"),
    TASK_DOWNLOAD_ERROR("INFODATOR_TASK_009", "INFODATOR下载任务失败"),
    TASK_UPLOAD_ERROR("INFODATOR_TASK_010", "INFODATOR上传任务失败"),
    TASK_INFO_ERROR("INFODATOR_TASK_012", "INFODATOR获取一个任务信息失败"),
    TASK_LIST_ERROR("INFODATOR_TASK_013", "INFODATOR获取任务列表失败"),
    TASK_HISTORY_LIST_ERROR("INFODATOR_TASK_014", "INFODATOR获取历史任务列表失败"),
    // 任务对列相关
    TASK_QUEUE_ADD_RECORD_ERROR("INFODATOR_QUEUE_001", "INFODATOR添加执行中任务记录失败"),
    TASK_QUEUE_CANCEL_ERROR("INFODATOR_QUEUE_002", "INFODATOR取消执行中任务失败"),
    TASK_QUEUE_DELETE_FROM_QUEUE_ERROR("INFODATOR_QUEUE_003", "INFODATOR删除执行中任务失败"),
    TASK_QUEUE_MOVE_FROM_QUEUE_ERROR("INFODATOR_QUEUE_004", "INFODATOR移动执行中任务顺序失败"),
    TASK_QUEUE_BATCH_DELETE_FROM_QUEUE_ERROR("INFODATOR_QUEUE_005", "INFODATOR批量删除执行中任务失败"),
    TASK_QUEUE_GET_TASK_ERROR_INFO_ERROR("INFODATOR_QUEUE_006", "INFODATOR获取执行中任务的错误信息失败"),
    TASK_QUEUE_INFO_ERROR("INFODATOR_QUEUE_007", "INFODATOR获取一个执行中的任务信息失败"),
    TASK_QUEUE_LIST_ERROR("INFODATOR_QUEUE_008", "INFODATOR获取执行中的任务列表失败"),
    TASK_QUEUE_QUEUE_LIST_ERROR("INFODATOR_QUEUE_009", "INFODATOR获取执行中任务列表失败"),
    TASK_PAUSE_ERROR("INFODATOR_QUEUE_010", "INFODATOR暂停任务失败"),
    TASK_RESUME_ERROR("INFODATOR_QUEUE_011", "INFODATOR暂停任务失败"),
    // 流程相关
    PROCESS_UPLOAD_ERROR("INFODATOR_PROCESS_001", "INFODATOR上传流程文件失败"),
    PROCESS_ADD_ERROR("INFODATOR_PROCESS_002", "INFODATOR创建流程失败"),
    PROCESS_ADD_VERSION_ERROR("INFODATOR_PROCESS_003", "INFODATOR创建新流程版本失败"),
    PROCESS_DELETE_ERROR("INFODATOR_PROCESS_004", "INFODATOR删除流程失败"),
    PROCESS_UPDATE_ERROR("INFODATOR_PROCESS_005", "INFODATOR更新流程属性失败"),
    PROCESS_UPDATE_VERSION_ERROR("INFODATOR_PROCESS_006", "INFODATOR更新流程版本失败"),
    PROCESS_CHANGE_DEFAULT_ERROR("INFODATOR_PROCESS_007", "INFODATOR修改流程默认版本失败"),
    PROCESS_HISTORY_VERSION_ERROR("INFODATOR_PROCESS_008", "INFODATOR获取流程历史列表失败"),
    PROCESS_INFO_ERROR("INFODATOR_PROCESS_009", "INFODATOR获取一个流程的信息失败"),
    PROCESS_LIST_ERROR("INFODATOR_PROCESS_010", "INFODATOR获取流程列表失败"),
    PACKAGE_DELETE_ERROR("INFODATOR_PROCESS_011", "INFODATOR暂不支持删除流程发布包"),
    // 机器相关
    ROBOT_ADD_ERROR("INFODATOR_ROBOT_001", "INFODATOR添加robot失败"),
    ROBOT_DELETE_ERROR("INFODATOR_ROBOT_002", "INFODATOR删除robot失败"),
    ROBOT_UPDATE_ERROR("INFODATOR_ROBOT_003", "INFODATOR更新robot失败"),
    ROBOT_LIST_ERROR("INFODATOR_ROBOT_004", "INFODATOR获取robot列表失败"),
    ROBOT_LIVE_INFO_ERROR("INFODATOR_ROBOT_005", "INFODATOR获取一个活动中的robot信息失败"),
    ROBOT_INFO_ERROR("INFODATOR_ROBOT_006", "INFODATOR获取一个robot信息失败"),
    ROBOT_CHANGE_STATUS_ERROR("INFODATOR_ROBOT_007", "INFODATOR更新机器人的审批状态失败"),
    ;

    private String code;
    private String message;

    InfodatorApiErrorCode(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String 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);
    }
}
