package com.liang.common.enums;

import lombok.AllArgsConstructor;

/**
 * 响应码枚举，参考HTTP状态码的语义
 * @author
 */
@AllArgsConstructor
public enum ResultCode {

    SUCCESS(0,"操作成功"),//成功
    FAIL(-1,"操作失败"),//失败
    ILLEGALARGUMENT(104,"参数异常");//失败

    private int code;

    private String msg;

    ResultCode(int code) {
        this.code = code;
    }

    ResultCode(String msg) {
        this.msg = msg;
    }

    public int code() {
        return code;
    }

    public String msg() {
        return msg;
    }
}
