publish 2.0.18
All checks were successful
/ local-deploy (push) Successful in 19s

This commit is contained in:
曾文豪
2024-12-13 20:20:29 +08:00
parent 2cf88cefa7
commit f8d7e49290
11 changed files with 28 additions and 27 deletions

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>2.0.17</version>
<version>2.0.18</version>
</parent>
<artifactId>springboot-web</artifactId>

View File

@@ -68,19 +68,20 @@ public class CoreConfigService extends TsServiceBase<CoreConfigSystemMapper, Cor
* @param dto
*/
public void updateConfigSystem(ConfigSystemDTO dto) {
CoreConfigSystem configKey = getOneByColumn("config_key", dto.getConfigKey());
if (configKey == null) {
CoreConfigSystem coreConfigSystem = getOneByColumn("config_key", dto.getConfigKey());
if (coreConfigSystem == null) {
throw new ApiException("该配置不存在,请检查");
}
if (configKey.getReadOnly() == 1) {
if (coreConfigSystem.getReadOnly() == 1) {
throw new ApiException("该配置只读,不可修改");
}
configKey.setConfigVal(dto.getConfigVal());
configKey.setRemark(dto.getRemark());
configKey.setExtra(dto.getExtra());
updateById(configKey);
coreConfigSystem.setConfigVal(dto.getConfigVal());
coreConfigSystem.setRemark(dto.getRemark());
coreConfigSystem.setExtra(dto.getExtra());
updateById(coreConfigSystem);
tsCacheService.putObj(CONFIG_SYSTEM_PREFIX + configKey, configKey, 10 * 60);
tsCacheService.putObj(CONFIG_SYSTEM_PREFIX + coreConfigSystem.getConfigKey(),
coreConfigSystem, 10 * 60);
}