This commit is contained in:
yexuejc 2018-06-19 22:17:01 +08:00
parent 25a534d307
commit ee012fe845
3 changed files with 36 additions and 1 deletions

View File

@ -1,6 +1,13 @@
yexuejc-base 更新记录
------------------
#### version 1.1.5
**time2018-6-19 22:16:34** <br/>
**branch** master <br/>
**update** <br/>
>1.优化ApiVO
#
#### version 1.1.4
**time2018-6-14 22:27:59** <br/>
**branch** master <br/>

View File

@ -6,7 +6,7 @@
<groupId>com.yexuejc.base</groupId>
<artifactId>yexuejc-base</artifactId>
<version>1.1.4</version>
<version>1.1.5</version>
<name>${project.artifactId}</name>

View File

@ -21,12 +21,40 @@ public class ApiVO implements Serializable {
public ApiVO(STATUS status) {
this.status = status;
}
/**
* 使用默认返回code
*
* @param status
* @param msg
*/
public ApiVO(STATUS status, String msg) {
this.status = status;
this.msgs = StrUtil.isNotEmpty(msg) ? new String[]{msg} : null;
}
/**
* 使用默认返回code
* @param status
* @param msg
*/
public ApiVO(STATUS status, String[] msg) {
this.status = status;
this.msgs = msg;
}
public ApiVO(STATUS status, String code, String msg) {
this.status = status;
this.code = code;
this.msgs = StrUtil.isNotEmpty(msg) ? new String[]{msg} : null;
}
public ApiVO(STATUS status, String code, String[] msg) {
this.status = status;
this.code = code;
this.msgs = msg;
}
public enum STATUS {
/**
* 成功