You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.3 KiB
57 lines
1.3 KiB
4 years ago
|
package com.bupt.note.ResponseData;
|
||
|
|
||
|
public enum ResultEnums {
|
||
|
|
||
|
// add some err code for different error
|
||
|
|
||
|
SUCCESS("200", "success"),
|
||
|
ERROR("500", "server error"),
|
||
|
|
||
|
// global
|
||
|
ErrUnauthorized("1001", "unauthorized"),
|
||
|
|
||
|
// users
|
||
|
ErrUserNameConflict("1101", "user name conflict"),
|
||
|
ErrUserIdNotExist("1102", "user id not exist"),
|
||
|
ErrLoginFailed("1103", "wrong password"),
|
||
|
|
||
|
// notes
|
||
|
ErrNoteSaveFailed("1201", "note save failed"),
|
||
|
ErrNoteIdNotExist("1202", "note id not exist"),
|
||
|
ErrDocIdNotExist("1203", "doc id not exist"),
|
||
|
ErrNoteDeleteFailed("1204", "note delete failed"),
|
||
|
|
||
|
// files
|
||
|
ErrFileUploadFailed("1301", "file upload failed"),
|
||
|
ErrFileIdNotExist("1302", "file id not exist"),
|
||
|
ErrFileOwnerIdNotMatchCurrUser("1303", "file owner is not current user"),
|
||
|
|
||
|
SYSTEM_ERROR("1000", "系统异常"),
|
||
|
BUSINESS_ERROR("2001", "业务逻辑错误"),
|
||
|
PARAM_ERROR("2002", "业务参数错误");
|
||
|
|
||
|
private String code;
|
||
|
private String msg;
|
||
|
|
||
|
ResultEnums(String code, String msg) {
|
||
|
this.code = code;
|
||
|
this.msg = msg;
|
||
|
}
|
||
|
|
||
|
public String getCode() {
|
||
|
return this.code;
|
||
|
}
|
||
|
|
||
|
public void setCode(String code) {
|
||
|
this.code = code;
|
||
|
}
|
||
|
|
||
|
public String getMsg() {
|
||
|
return this.msg;
|
||
|
}
|
||
|
|
||
|
public void setMsg(String msg) {
|
||
|
this.msg = msg;
|
||
|
}
|
||
|
}
|