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

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

Signed-off-by: runphp <runphp@qq.com>
pull/258/head
runphp 2 years ago committed by Gitee
parent 0e4a1c872c
commit a057b7a4b9
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

@ -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();
} }
} }

Loading…
Cancel
Save