diff --git a/novel-common/src/main/java/com/java2nb/novel/common/bean/ResultBean.java b/novel-common/src/main/java/com/java2nb/novel/common/bean/ResultBean.java index e546ad8..976aa79 100644 --- a/novel-common/src/main/java/com/java2nb/novel/common/bean/ResultBean.java +++ b/novel-common/src/main/java/com/java2nb/novel/common/bean/ResultBean.java @@ -7,25 +7,26 @@ import lombok.Data; /** * 自定义Api响应结构 + * + * @param 响应数据类型 * @author xiongxiaoyang * @version 1.0 * @since 2020/5/23 - * @param 响应数据类型 */ @Data -public class ResultBean{ +public class ResultBean { @ApiModelProperty(value = "响应状态码,200表示成功") private int code = ResponseStatus.OK.getCode(); /** * 响应消息 - * */ + */ @ApiModelProperty(value = "响应状态信息") private String msg = ResponseStatus.OK.getMsg(); /** * 响应中的数据 - * */ + */ @ApiModelProperty(value = "响应数据") private T data; @@ -34,7 +35,7 @@ public class ResultBean{ } private ResultBean(ResponseStatus responseStatus) { - this.code = responseStatus.getCode();; + this.code = responseStatus.getCode(); this.msg = responseStatus.getMsg(); } @@ -43,24 +44,23 @@ public class ResultBean{ } - /** * 业务处理成功,无数据返回 - * */ + */ public static ResultBean ok() { return new ResultBean<>(); } /** * 业务处理成功,有数据返回 - * */ + */ public static ResultBean ok(T data) { return new ResultBean<>(data); } /** * 业务处理失败 - * */ + */ public static ResultBean fail(ResponseStatus responseStatus) { return new ResultBean<>(responseStatus); } @@ -68,7 +68,7 @@ public class ResultBean{ /** * 系统错误 - * */ + */ public static ResultBean error() { return new ResultBean<>(ResponseStatus.ERROR); }