mirror of
https://gitee.com/jzsw-it/yexuejc-base.git
synced 2025-06-07 22:34:04 +08:00
1.2.1更新resps
This commit is contained in:
parent
e00164f85b
commit
286c65b868
@ -1,6 +1,12 @@
|
||||
yexuejc-base 更新记录
|
||||
------------------
|
||||
|
||||
#### version :1.2.1
|
||||
**time:2018-11-9 15:05:06** <br/>
|
||||
**branch:** master <br/>
|
||||
**update:** <br/>
|
||||
>1. 优化resps
|
||||
#
|
||||
#### version :1.2.0
|
||||
**time:2018-10-19 11:38:20** <br/>
|
||||
**branch:** master <br/>
|
||||
|
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>com.yexuejc.base</groupId>
|
||||
<artifactId>yexuejc-base</artifactId>
|
||||
<version>1.2.0</version>
|
||||
<version>1.2.1</version>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user