Update ServerResponse.java

cyj
pbvfus8to 8 months ago
parent d677da6a1a
commit 86f9b70d3b

@ -16,21 +16,42 @@ import java.io.Serializable;
import java.util.Objects; import java.util.Objects;
/** /**
* `ServerResponse`使
* `lombok``@Data`访`getter``setter``toString``hashCode``equals`便使
* `Serializable`便使
*
* @author lanhai * @author lanhai
*/ */
@Data @Data
public class ServerResponse<T> implements Serializable { public class ServerResponse<T> implements Serializable {
/**
* `200` `404` `500`
* 便
*/
private int code; private int code;
/**
*
* 使
*
*/
private String msg; private String msg;
/**
* `<T>`
*
*/
private T obj; private T obj;
public boolean isSuccess(){ /**
* `ResponseCode.SUCCESS` `ResponseCode`
* `true` `false`
*
*
* @return `true` `false`
*/
public boolean isSuccess() {
return Objects.equals(ResponseCode.SUCCESS, this.code); return Objects.equals(ResponseCode.SUCCESS, this.code);
} }
}
}
Loading…
Cancel
Save