mirror of
https://github.com/201206030/novel-plus.git
synced 2025-04-27 01:30:51 +00:00
style(novel-common/bean): ResultBean更新
代码格式化,去除多余分号
This commit is contained in:
parent
4540c3781e
commit
689efc0807
@ -8,8 +8,9 @@ import java.io.Serializable;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 自定义响应结构
|
* 自定义响应结构
|
||||||
* @author 11797
|
*
|
||||||
* @param <T>
|
* @param <T>
|
||||||
|
* @author 11797
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class ResultBean<T> implements Serializable {
|
public class ResultBean<T> implements Serializable {
|
||||||
@ -19,11 +20,11 @@ public class ResultBean<T> implements Serializable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 响应消息
|
* 响应消息
|
||||||
* */
|
*/
|
||||||
private String msg = ResponseStatus.OK.getMsg();
|
private String msg = ResponseStatus.OK.getMsg();
|
||||||
/**
|
/**
|
||||||
* 响应中的数据
|
* 响应中的数据
|
||||||
* */
|
*/
|
||||||
private T data;
|
private T data;
|
||||||
|
|
||||||
private ResultBean() {
|
private ResultBean() {
|
||||||
@ -31,7 +32,7 @@ public class ResultBean<T> implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private ResultBean(ResponseStatus responseStatus) {
|
private ResultBean(ResponseStatus responseStatus) {
|
||||||
this.code = responseStatus.getCode();;
|
this.code = responseStatus.getCode();
|
||||||
this.msg = responseStatus.getMsg();
|
this.msg = responseStatus.getMsg();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -40,24 +41,23 @@ public class ResultBean<T> implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务处理成功,无数据返回
|
* 业务处理成功,无数据返回
|
||||||
* */
|
*/
|
||||||
public static ResultBean<Void> ok() {
|
public static ResultBean<Void> ok() {
|
||||||
return new ResultBean<>();
|
return new ResultBean<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务处理成功,有数据返回
|
* 业务处理成功,有数据返回
|
||||||
* */
|
*/
|
||||||
public static <T> ResultBean<T> ok(T data) {
|
public static <T> ResultBean<T> ok(T data) {
|
||||||
return new ResultBean<>(data);
|
return new ResultBean<>(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务处理失败
|
* 业务处理失败
|
||||||
* */
|
*/
|
||||||
public static ResultBean<Void> fail(ResponseStatus responseStatus) {
|
public static ResultBean<Void> fail(ResponseStatus responseStatus) {
|
||||||
return new ResultBean<>(responseStatus);
|
return new ResultBean<>(responseStatus);
|
||||||
}
|
}
|
||||||
@ -65,7 +65,7 @@ public class ResultBean<T> implements Serializable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统错误
|
* 系统错误
|
||||||
* */
|
*/
|
||||||
public static ResultBean<Void> error() {
|
public static ResultBean<Void> error() {
|
||||||
return new ResultBean<>(ResponseStatus.ERROR);
|
return new ResultBean<>(ResponseStatus.ERROR);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user