init: ASW-37 初始化 device-api

This commit is contained in:
shizhendong
2024-08-22 09:22:52 +08:00
parent 94a42089e7
commit 3e306e1a8c
21 changed files with 2220 additions and 93 deletions

View File

@@ -0,0 +1,42 @@
package net.geedge.common;
import java.text.MessageFormat;
public enum RCode {
BAD_REQUEST(400, "Bad Request "),
NOT_EXISTS(404, "No such file or directory"),
NOT_PERMISSION(401 , "Permission denied"),
ERROR(999, "error"), // 通用错误/未知错误
SUCCESS(200, "success"); // 成功
RCode(Integer code, String msg) {
this.code = code;
this.msg = msg;
}
private Integer code;
private String msg;
private Object[] param;
public RCode setParam(Object... param) {
this.param = param;
return this;
}
public Object[] getParam() {
return param;
}
public Integer getCode() {
return code;
}
public String getMsg() {
return MessageFormat.format(msg, param);
}
}