update
This commit is contained in:
parent
4157da1e2b
commit
a2073eb2c7
7
.vscode/settings.json
vendored
7
.vscode/settings.json
vendored
@ -1,3 +1,8 @@
|
||||
{
|
||||
"java.configuration.updateBuildConfiguration": "interactive"
|
||||
"java.configuration.updateBuildConfiguration": "interactive",
|
||||
"files.associations": {
|
||||
"*.yml": "yaml"
|
||||
},
|
||||
"java.compile.nullAnalysis.mode": "disabled",
|
||||
// "java.compile.nullAnalysis.mode": "automatic"
|
||||
}
|
4
pom.xml
4
pom.xml
@ -30,7 +30,7 @@
|
||||
<velocity.version>2.3</velocity.version>
|
||||
<jwt.version>0.9.1</jwt.version>
|
||||
<knife4j.version>4.3.0</knife4j.version>
|
||||
<mybatis-spring-boot.version>3.0.2</mybatis-spring-boot.version>
|
||||
<mybatis-spring-boot.version>3.0.3</mybatis-spring-boot.version>
|
||||
</properties>
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-dependencies</artifactId>
|
||||
<version>3.1.5</version>
|
||||
<version>3.2.0</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
@ -6,6 +6,7 @@ import org.springframework.data.redis.serializer.SerializationException;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONReader;
|
||||
import com.alibaba.fastjson2.JSONWriter;
|
||||
// import com.alibaba.fastjson2.filter.Filter;
|
||||
|
||||
/**
|
||||
* Redis使用FastJson序列化
|
||||
@ -16,6 +17,11 @@ public class FastJson2JsonRedisSerializer<T> implements RedisSerializer<T>
|
||||
{
|
||||
public static final Charset DEFAULT_CHARSET = Charset.forName("UTF-8");
|
||||
|
||||
// static final Filter autoTypeFilter = JSONReader.autoTypeFilter(
|
||||
// 按需加上需要支持自动类型的类名前缀,范围越小越安全
|
||||
// "org.springframework.security.core.authority.SimpleGrantedAuthority"
|
||||
// );
|
||||
|
||||
private Class<T> clazz;
|
||||
|
||||
public FastJson2JsonRedisSerializer(Class<T> clazz)
|
||||
@ -44,5 +50,6 @@ public class FastJson2JsonRedisSerializer<T> implements RedisSerializer<T>
|
||||
String str = new String(bytes, DEFAULT_CHARSET);
|
||||
|
||||
return JSON.parseObject(str, clazz, JSONReader.Feature.SupportAutoType);
|
||||
// return JSON.parseObject(str, clazz, autoTypeFilter);
|
||||
}
|
||||
}
|
||||
|
@ -161,7 +161,7 @@ public class SysConfigServiceImpl implements ISysConfigService
|
||||
SysConfig config = selectConfigById(configId);
|
||||
if (StringUtils.equals(UserConstants.YES, config.getConfigType()))
|
||||
{
|
||||
throw new ServiceException(String.format("内置参数【%1$s】不能删除 ", config.getConfigKey()));
|
||||
throw new ServiceException("内置参数【%1$s】不能删除 ".formatted(config.getConfigKey()));
|
||||
}
|
||||
configMapper.deleteConfigById(configId);
|
||||
redisCache.deleteObject(getCacheKey(config.getConfigKey()));
|
||||
|
@ -124,7 +124,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
||||
SysDictType dictType = selectDictTypeById(dictId);
|
||||
if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0)
|
||||
{
|
||||
throw new ServiceException(String.format("%1$s已分配,不能删除", dictType.getDictName()));
|
||||
throw new ServiceException("%1$s已分配,不能删除".formatted(dictType.getDictName()));
|
||||
}
|
||||
dictTypeMapper.deleteDictTypeById(dictId);
|
||||
DictUtils.removeDictCache(dictType.getDictType());
|
||||
|
@ -146,7 +146,7 @@ public class SysPostServiceImpl implements ISysPostService
|
||||
SysPost post = selectPostById(postId);
|
||||
if (countUserPostById(postId) > 0)
|
||||
{
|
||||
throw new ServiceException(String.format("%1$s已分配,不能删除", post.getPostName()));
|
||||
throw new ServiceException("%1$s已分配,不能删除".formatted(post.getPostName()));
|
||||
}
|
||||
}
|
||||
return postMapper.deletePostByIds(postIds);
|
||||
|
@ -365,7 +365,7 @@ public class SysRoleServiceImpl implements ISysRoleService
|
||||
SysRole role = selectRoleById(roleId);
|
||||
if (countUserRoleByRoleId(roleId) > 0)
|
||||
{
|
||||
throw new ServiceException(String.format("%1$s已分配,不能删除", role.getRoleName()));
|
||||
throw new ServiceException("%1$s已分配,不能删除".formatted(role.getRoleName()));
|
||||
}
|
||||
}
|
||||
// 删除角色与菜单关联
|
||||
|
Loading…
Reference in New Issue
Block a user