【依赖】mybatis-plus from 3.5.5 to 3.5.7

【代码优化】全局:复用 MyBatis Plus 数据权限插件,简化项目的数据权限实现
This commit is contained in:
YunaiV
2024-07-14 00:01:39 +08:00
parent 670a2bfad0
commit 76e4586e20
24 changed files with 137 additions and 994 deletions

View File

@@ -17,6 +17,8 @@ import com.baomidou.mybatisplus.extension.handlers.AbstractJsonTypeHandler;
import com.fasterxml.jackson.core.type.TypeReference;
import lombok.*;
import java.lang.reflect.Field;
/**
* 文件配置表
*
@@ -65,8 +67,16 @@ public class FileConfigDO extends BaseDO {
public static class FileClientConfigTypeHandler extends AbstractJsonTypeHandler<Object> {
public FileClientConfigTypeHandler(Class<?> type) {
super(type);
}
public FileClientConfigTypeHandler(Class<?> type, Field field) {
super(type, field);
}
@Override
protected Object parse(String json) {
public Object parse(String json) {
FileClientConfig config = JsonUtils.parseObjectQuietly(json, new TypeReference<>() {});
if (config != null) {
return config;
@@ -92,7 +102,7 @@ public class FileConfigDO extends BaseDO {
}
@Override
protected String toJson(Object obj) {
public String toJson(Object obj) {
return JsonUtils.toJsonString(obj);
}