mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-18 21:15:06 +08:00
解决各种 json 库的兼容性问题
This commit is contained in:
@ -5,6 +5,7 @@ import cn.iocoder.dashboard.common.exception.GlobalException;
|
||||
import cn.iocoder.dashboard.common.exception.ServiceException;
|
||||
import cn.iocoder.dashboard.common.exception.enums.GlobalErrorCodeConstants;
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.Data;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
@ -68,12 +69,14 @@ public final class CommonResult<T> implements Serializable {
|
||||
return result;
|
||||
}
|
||||
|
||||
@JSONField(serialize = false) // 避免序列化
|
||||
@JSONField(serialize = false) // 避免 fastjson 序列化
|
||||
@JsonIgnore // 避免 jackson 序列化
|
||||
public boolean isSuccess() {
|
||||
return GlobalErrorCodeConstants.SUCCESS.getCode().equals(code);
|
||||
}
|
||||
|
||||
@JSONField(serialize = false) // 避免序列化
|
||||
@JSONField(serialize = false) // 避免 fastjson 序列化
|
||||
@JsonIgnore // 避免 jackson 序列化
|
||||
public boolean isError() {
|
||||
return !isSuccess();
|
||||
}
|
||||
|
Reference in New Issue
Block a user