MessageMethodEnum.java 710 Bytes
package cn.com.glsx.auditstatistics.enums;


import cn.com.glsx.auditstatistics.exception.BusinessException;

/**
 * <p>Description:
 * <p>Project: open-platform-admin
 *
 * @author wbh
 * @date 2020-12-16
 */
public enum MessageMethodEnum {
    ADD(1, "增加"),
    UPDATE(2, "修改"),
    DELETE(3, "删除");

    private final Integer code;
    private final String msg;

    MessageMethodEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public BusinessException exception() {
        return new BusinessException(this.code, this.msg);
    }
}