mirror of
https://gitee.com/jzsw-it/yexuejc-base.git
synced 2025-09-28 16:33:21 +08:00
1.2.1更新resps
This commit is contained in:
@@ -59,18 +59,18 @@ public class Resps<T> implements Serializable {
|
||||
}
|
||||
|
||||
public Resps<T> setSucc(T t) {
|
||||
setSucc(t, RespsConsts.MSG_SUCCESS_OPERATE);
|
||||
this.data = t;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Resps<T> setSucc(T t, String msg) {
|
||||
setSucc(t, new String[]{msg});
|
||||
this.setMsg(new String[]{msg});
|
||||
this.setData(t);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Resps<T> setSucc(T t, String[] msg) {
|
||||
this.setData(t);
|
||||
this.setCode(RespsConsts.CODE_SUCCESS);
|
||||
this.setMsg(msg);
|
||||
return this;
|
||||
}
|
||||
@@ -81,6 +81,14 @@ public class Resps<T> implements Serializable {
|
||||
return this;
|
||||
}
|
||||
|
||||
public static Resps success(String code, String msg) {
|
||||
return new Resps(code, msg);
|
||||
}
|
||||
|
||||
public static Resps success(String code, String[] msg) {
|
||||
return new Resps(code, msg);
|
||||
}
|
||||
|
||||
public static Resps success(String[] msg) {
|
||||
return new Resps(RespsConsts.CODE_SUCCESS, msg);
|
||||
}
|
||||
@@ -93,6 +101,10 @@ public class Resps<T> implements Serializable {
|
||||
return new Resps(RespsConsts.CODE_SUCCESS, RespsConsts.MSG_SUCCESS_OPERATE);
|
||||
}
|
||||
|
||||
public static Resps error() {
|
||||
return new Resps(RespsConsts.CODE_ERROR, RespsConsts.MSG_ERROT_OPERATE);
|
||||
}
|
||||
|
||||
public static Resps error(String msg) {
|
||||
return new Resps(RespsConsts.CODE_ERROR, msg);
|
||||
}
|
||||
@@ -109,6 +121,10 @@ public class Resps<T> implements Serializable {
|
||||
return new Resps(code, msg);
|
||||
}
|
||||
|
||||
public static Resps fail() {
|
||||
return new Resps(RespsConsts.CODE_FAIL, RespsConsts.MSG_FAIL_OPERATE);
|
||||
}
|
||||
|
||||
public static Resps fail(String msg) {
|
||||
return new Resps(RespsConsts.CODE_FAIL, msg);
|
||||
}
|
||||
|
Reference in New Issue
Block a user