!246 feat: add isError and isSuccess method

Merge pull request !246 from runphp/N/A
product
若依 2022-09-09 02:10:24 +00:00 committed by Gitee
commit 11d8274462
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 8 additions and 0 deletions

View File

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