mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 15:55:18 +08:00
完善返回值
This commit is contained in:
@@ -29,6 +29,11 @@ public class RResponseBodyAdvice implements ResponseBodyAdvice<Object> {
|
||||
if (!selectedContentType.includes(MediaType.APPLICATION_JSON)) {
|
||||
return body;
|
||||
}
|
||||
|
||||
if (body == null) {
|
||||
return R.success();
|
||||
}
|
||||
|
||||
if (body instanceof byte[]) {
|
||||
return body;
|
||||
}
|
||||
|
||||
@@ -33,6 +33,10 @@ public class R<T> {
|
||||
}
|
||||
|
||||
|
||||
public static <T> R<T> success() {
|
||||
return success(null);
|
||||
}
|
||||
|
||||
public static <T> R<T> success(T data) {
|
||||
return create(data, "ok", "");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user