package net.northking.cctp.testbug.constants;

import net.northking.cctp.common.exception.PlatformError;

public enum  TestBugError implements PlatformError {

    BUG_ID_NOT_NULL("缺陷id不能为空"),
    UPDATE_BUG_INFO_NOT_NULL("修改的缺陷信息不能为空"),
    UPDATE_BUG_INFO_FAILED("修改缺陷信息失败"),
    UPDATE_BUG_SEARCH_FAILED("修改缺陷搜索器信息失败"),
    ADD_BUG_RECORD_FAILED("添加缺陷变更信息失败"),
    ADD_BUG_INFO_FAILED("添加缺陷信息失败"),
    ADD_BUG_SEARCH_FAILED("添加缺陷搜索器信息失败"),
    QUERY_BUG_INFO_FAILED("缺陷信息查询失败"),
    QUERY_BUG_CREATED_BY_FAILED("查询缺陷创建人失败"),
    QUERY_BUG_RECEIVER_FAILED("查询缺陷分配人失败"),
    QUERY_BUG_MODULE_FAILED("查询缺陷模块名失败"),
    QUERY_BUG_TITLE_AND_ORDER_FAILED("查询缺陷标题/缺陷编号失败"),
    QUERY_BUG_SEARCH_FAILED("查询缺陷搜索器信息失败"),
    QUERY_BUG_STATUS_FAILED("查询缺陷状态数失败"),
    QUERY_BUG_LINK_INFO_FAILED("查询缺陷关联信息失败"),
    GET_BUG_ORDER_FAILED("获取缺陷编号失败"),
    GET_BUG_END_STATUS_FAILED("获取缺陷终态失败"),
    GET_BUG_RULE_FAILED("获取缺陷规则失败"),
    DELETE_BUG_SEARCH_FAILED("删除缺陷搜索器信息失败"),
    NOTICE_BUG_GRADE_FAILED("缺陷严重程度数据消息发送失败"),
    EXPORT_BUG_INFO_FAILED("缺陷信息导出失败"),
    SCHEDULED_BUG_VALID_REPAIR_RATIO_FAILED("定时任务统计缺陷有效率和修复率数据失败"),
    SCHEDULED_USER_BUG_GRADE_FAILED("定时任务统计用户缺陷等级数量失败"),
    SCHEDULED_BUG_LEGACY_GRADE_END_STATUS("定时任务统计缺陷遗留严重等级非终态数据失败");

    private String msg;
    private Integer code;

    private static final int START_CODE = 220000;

    TestBugError(){

    }

    TestBugError(String msg){
        this.code = ordinal() + START_CODE;
        this.msg = msg;
    }

    TestBugError(Integer code,String msg){
        this.msg = msg;
        this.code = code;
    }
    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getMsg() {
        return this.msg;
    }
}