上级目录:​​电商平台设计​

/**
* 返回状态码
*/
public enum ResponseCode {
//返回成功
SUCCESS(0,"SUCCESS"),
//返回失败
ERROR(1,"ERROR"),
//需要登录错误
NEED_LOGIN(10, "NEED_LOGIN"),
//参数不合法,一般是参数不全错误
ILLEGAL_ARGUMENT(2, "ILLEGAL_ARGUMENT");


private final int code;
private final String desc;
//必须加上构造器
ResponseCode(int code, String desc) {
this.code = code;
this.desc = desc;
}

public int getCode() {
return code;
}

public String getDesc() {
return desc;
}
}