Package cloud.opencode.base.basecode
Class CodeResult<T>
java.lang.Object
cloud.opencode.base.basecode.CodeResult<T>
- All Implemented Interfaces:
Serializable
- Author:
- Jon url: Jon's blog url: OpenCode.cloud
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCodeResult(org.springframework.http.HttpStatus status) CodeResult(org.springframework.http.HttpStatus status, T body) CodeResult(org.springframework.http.HttpStatus status, T body, Long total, Long page, Long pageSize, String message, Integer code, org.springframework.http.MediaType type, org.springframework.util.MultiValueMap<String, String> headers) CodeResult(org.springframework.http.HttpStatus status, T body, String message, Integer code) CodeResult(org.springframework.http.HttpStatus status, T body, org.springframework.http.MediaType type, org.springframework.util.MultiValueMap<String, String> headers) -
Method Summary
Modifier and TypeMethodDescriptionstatic CodeResultERROR()ERRORstatic CodeResultERRORstatic CodeResultERRORstatic CodeResultERRORstatic CodeResultERROR(org.springframework.http.HttpStatus status, org.springframework.http.MediaType type, org.springframework.util.MultiValueMap<String, String> headers) ERRORstatic CodeResultOK()OKstatic <T> CodeResultOK(T data) OKstatic <T> CodeResultOKstatic <T> CodeResultOKstatic <T> CodeResultOK(T data, Long total, Long page, Long pageSize, String message, Integer code, org.springframework.http.MediaType type, org.springframework.util.MultiValueMap<String, String> headers) OKstatic <T> CodeResultOKstatic <T> CodeResultOKstatic <T> CodeResultOKstatic <T> CodeResultOKstatic <T> CodeResultOK(T data, org.springframework.http.HttpStatus status) OKstatic <T> CodeResultOK(T data, org.springframework.http.MediaType type) OKstatic <T> CodeResultOK(T data, org.springframework.http.MediaType type, org.springframework.http.HttpStatus status) OKstatic <T> CodeResultOK(T data, org.springframework.http.MediaType type, org.springframework.util.MultiValueMap<String, String> headers) OKstatic <T> CodeResultOK(T data, org.springframework.http.MediaType type, org.springframework.util.MultiValueMap<String, String> headers, org.springframework.http.HttpStatus status) OKstatic <T> CodeResultOKOnlyStatus(org.springframework.http.HttpStatus status) OKstatic <T> CodeResultOKWithMediaTypeAndHeaders(T data, org.springframework.http.MediaType type, org.springframework.util.MultiValueMap<String, String> headers) OKWithMediaTypeAndHeadersstatic <T> CodeResultOKWithMediaTypeAndHeaders(T data, org.springframework.http.MediaType type, org.springframework.util.MultiValueMap<String, String> headers, org.springframework.http.HttpStatus status) OKWithMediaTypeAndHeadersstatic <T> CodeResultOKWithoutStatus(T data) OK
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
data
-
code
-
message
-
status
private org.springframework.http.HttpStatus status -
total
-
page
-
pageSize
-
headers
@Nullable private org.springframework.http.HttpHeaders headers -
timestamp
private long timestamp -
mediaType
@Nullable private org.springframework.http.MediaType mediaType
-
-
Constructor Details
-
CodeResult
public CodeResult(@Nullable org.springframework.http.HttpStatus status) -
CodeResult
-
CodeResult
-
CodeResult
-
CodeResult
public CodeResult(@Nullable org.springframework.http.HttpStatus status, @Nullable T body, @Nullable Long total, @Nullable Long page, @Nullable Long pageSize, @Nullable String message, @Nullable Integer code, @Nullable org.springframework.http.MediaType type, @Nullable org.springframework.util.MultiValueMap<String, String> headers)
-
-
Method Details
-
OK
OK- Returns:
-
OK
OK- Type Parameters:
T-- Parameters:
data-- Returns:
-
OK
OK- Type Parameters:
T-- Parameters:
data- datastatus- HttpStatus- Returns:
-
OK
OK- Type Parameters:
T-- Parameters:
data- datamessage- message- Returns:
-
OK
OK- Type Parameters:
T-- Parameters:
data- datamessage- messagestatus- HttpStatus- Returns:
-
OK
OK- Type Parameters:
T-- Parameters:
data- datamessage- messagecode- code- Returns:
-
OK
public static <T> CodeResult OK(T data, String message, Integer code, org.springframework.http.HttpStatus status) OK- Type Parameters:
T-- Parameters:
data- datamessage- messagecode- codestatus- HttpStatus- Returns:
-
OK
OK- Type Parameters:
T-- Parameters:
data- datatype- MediaType- Returns:
-
OK
public static <T> CodeResult OK(T data, org.springframework.http.MediaType type, org.springframework.http.HttpStatus status) OK- Type Parameters:
T-- Parameters:
data- datatype- MediaTypestatus- HttpStatus- Returns:
-
OK
public static <T> CodeResult OK(T data, @Nullable org.springframework.http.MediaType type, @Nullable org.springframework.util.MultiValueMap<String, String> headers) OK- Type Parameters:
T-- Parameters:
data- datatype- typeheaders- HttpHeaders- Returns:
-
OK
public static <T> CodeResult OK(T data, @Nullable org.springframework.http.MediaType type, @Nullable org.springframework.util.MultiValueMap<String, String> headers, org.springframework.http.HttpStatus status) OK- Type Parameters:
T-- Parameters:
data- datatype- typeheaders- HttpHeadersstatus- HttpStatus- Returns:
-
OK
OK- Type Parameters:
T-- Parameters:
data- datatotal- totalpage- pagepageSize- pageSize- Returns:
-
OK
public static <T> CodeResult OK(T data, Long total, Long page, Long pageSize, String message, Integer code) OK- Type Parameters:
T-- Parameters:
data- datatotal- totalpage- pagepageSize- pageSizemessage- messagecode- code- Returns:
-
OK
public static <T> CodeResult OK(T data, Long total, Long page, Long pageSize, String message, Integer code, @Nullable org.springframework.http.MediaType type, @Nullable org.springframework.util.MultiValueMap<String, String> headers) OK- Type Parameters:
T-- Parameters:
data- DATAtotal- totalpage- pagepageSize- pageSizemessage- messagecode- codetype- MediaTypeheaders- HttpHeaders- Returns:
-
OKWithMediaTypeAndHeaders
public static <T> CodeResult OKWithMediaTypeAndHeaders(T data, @Nullable org.springframework.http.MediaType type, @Nullable org.springframework.util.MultiValueMap<String, String> headers, org.springframework.http.HttpStatus status) OKWithMediaTypeAndHeaders- Type Parameters:
T-- Parameters:
data- datatype- MediaTypeheaders- HttpHeadersstatus- HttpStatus- Returns:
-
OKWithMediaTypeAndHeaders
public static <T> CodeResult OKWithMediaTypeAndHeaders(T data, @Nullable org.springframework.http.MediaType type, @Nullable org.springframework.util.MultiValueMap<String, String> headers) OKWithMediaTypeAndHeaders- Type Parameters:
T-- Parameters:
data- datatype- MediaTypeheaders- HttpHeaders- Returns:
-
OKOnlyStatus
OK- Type Parameters:
T-- Parameters:
status- HttpStatus- Returns:
-
OKWithoutStatus
OK- Type Parameters:
T-- Parameters:
data-- Returns:
-
ERROR
ERROR- Returns:
-
ERROR
ERROR- Parameters:
message- message- Returns:
-
ERROR
ERROR- Parameters:
status- HttpStatusmessage- message- Returns:
-
ERROR
public static CodeResult ERROR(org.springframework.http.HttpStatus status, String message, Integer code) ERROR- Parameters:
status- HttpStatusmessage- messagecode- code- Returns:
-
ERROR
public static CodeResult ERROR(org.springframework.http.HttpStatus status, @Nullable org.springframework.http.MediaType type, @Nullable org.springframework.util.MultiValueMap<String, String> headers) ERROR- Parameters:
status- HttpStatustype- MediaTypeheaders- HttpHeaders- Returns:
-