package com.xkrs.common.encapsulation;

/**
 * 提示信息枚举
 * @author tajochen
 */
public enum PromptMessageEnum{

    // 执行成功
    SUCCESS(0, "sys.message.success"),

    // 用户权限错误或非法操作：  1001-1999
    USER_NOT_LOGGED(1001, "sys.message.user.not_logged_in"),
    USER_LOGIN_ERROR(1002, "sys.message.user.login_error"),
    USER_ACCOUNT_FORBIDDEN(1003, "sys.message.user.account_forbidden"),
    USER_ACCOUNT_NOT_ACTIVATED(1004, "sys.message.user.account_not_activated"),
    USER_HAS_OVERTIME(1005, "sys.message.user.overtime"),
    USER_NO_PERMISSION(1006,"sys.message.user.no_permission"),
    USER_ALREADY_LOGGED(1007, "sys.message.user.already_logged"),

    // 请求参数错误或非法：2001-2999
    PARAM_NULL(2001, "sys.message.param.null"),
    PARAM_ILLEGAL(2002, "sys.message.param.illegal"),

    // 数据返回错误：3001-3999
    DATA_NONE(3001, "sys.message.data.none"),
    DATA_WRONG(3002, "sys.message.data.wrong"),

    // 操作失败：4001-4999
    PROCESS_FAIL(4001,"sys.message.process.fail"),
    PROCESS_OVERTIME(4002,"sys.message.process.overtime"),
    FILE_EXISTS(4003,"sys.message.file.exists"),
    FILE_WRITE_ERROR(4004,"sys.message.file.write.error"),
    FILE_READ_ERROR(4005,"sys.message.file.read.error"),

    // 系统内部错误或异常：5001-5999
    SYSTEM_INNER_ERROR(5001,"sys.message.system.inner_error"),
    SYSTEM_ABNORMAL(5002,"sys.message.system.abnormal"),
    SYSTEM_BUSY(5003,"sys.message.system.busy"),
    SYSTEM_MAINTAIN(5004,"sys.message.system.maintain"),

    // 数据库错误：6001-6999
    DATABASE_ERROR(6001,"sys.message.database.error");

    private int code;

    private String text;

    private PromptMessageEnum(int code,String text) {
        this.code = code;
        this.text = text;
    }

    public String getText() {
        return this.text;
    }

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

}
