fix: 改为静态方法, isError和isSuccess方法会被json序列化

isError和isSuccess会被json序列化
`{"error":false,"success":true}`

Signed-off-by: runphp <runphp@qq.com>
product
runphp 2022-09-29 10:16:11 +00:00 committed by Gitee
parent 0e4a1c872c
commit a057b7a4b9
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 4 additions and 4 deletions

View File

@ -103,13 +103,13 @@ public class R<T> implements Serializable
this.data = data; this.data = data;
} }
public Boolean isError() public static <T> Boolean isError(R<T> ret)
{ {
return !isSuccess(); return !isSuccess(ret);
} }
public Boolean isSuccess() public static <T> Boolean isSuccess(R<T> ret)
{ {
return R.SUCCESS == getCode(); return R.SUCCESS == ret.getCode();
} }
} }