Newer
Older
huludao / src / main / java / com / newfiber / common / constant / ResultCode.java
package com.newfiber.common.constant;

/**
 * 返回状态码枚举
 * @Author:zzh
 * @CreateDate:2020/11/4 10:51
 * @Description:
 */

public enum ResultCode {

    /**
     *
     */
    PARAM_NULL(701,"传入的参数为null"),
    ARITHMETIC_EXC(702,"算数异常"),
    DIVIDER_EXC(703,"除数为0"),
    OK(200,"操作成功"),
    SAVE(201,"新增成功"),
    UPDATE(202,"修改成功"),
    DELETE(203,"删除成功"),
    ERROR(500,"服务器发生错误"),
    SAVE_ERROR(577,"新增数据出现错误"),
    UPDATE_ERROR(578,"修改数据出现错误"),
    DELETE_ERROR(579,"删除数据出现错误"),
    THRED_SLEEP(999,"扣减物资的线程休眠出现问题!请调试!"),
    UN_AUTHORIZED(401, "操作权限不足");

    private Integer code;

    private String message;

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

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}