refactor: 代码质量优化 + 安全修复 + 性能提升
P0 安全修复: - 修复 DatabaseFieldAdder.java 硬编码密码 → 改为环境变量 - 修复 11 个文件空 catch 块 → 添加日志记录 - 修复 40 个文件 System.out → 改为 SLF4J Logger P1 性能优化: - 启用 Spring Boot Actuator 健康检查 (health/info/metrics) - 为字典数据查询添加 @Cacheable 缓存 P2 测试: - 添加 Convert 工具类单元测试 (10 个测试用例) - 添加 spring-boot-starter-test 依赖 P3 版本升级: - hutool: 5.8.35 → 5.8.36 - httpclient 5.x (跳过, 改动量大) 验证: 编译通过 / 测试通过
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
package com.core.web.controller.system;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.core.common.annotation.Log;
|
||||
import com.core.common.core.controller.BaseController;
|
||||
import com.core.common.core.domain.AjaxResult;
|
||||
@@ -24,6 +27,7 @@ import java.util.List;
|
||||
@RestController
|
||||
@RequestMapping("/system/config")
|
||||
public class SysConfigController extends BaseController {
|
||||
private static final Logger log = LoggerFactory.getLogger(SysConfigController.class);
|
||||
@Autowired
|
||||
private ISysConfigService configService;
|
||||
|
||||
@@ -72,13 +76,13 @@ public class SysConfigController extends BaseController {
|
||||
result.put("code", 200);
|
||||
result.put("msg", "操作成功");
|
||||
result.put("data", configValue); // 明确设置 data 字段,即使值为空字符串
|
||||
System.out.println("=== getConfigKey 调试信息 ===");
|
||||
System.out.println("configKey: " + configKey);
|
||||
System.out.println("configValue: [" + configValue + "]");
|
||||
System.out.println("result.data: " + result.get("data"));
|
||||
System.out.println("result.msg: " + result.get("msg"));
|
||||
System.out.println("result.code: " + result.get("code"));
|
||||
System.out.println("============================");
|
||||
log.info("=== getConfigKey 调试信息 ===");
|
||||
log.info("configKey: " + configKey);
|
||||
log.info("configValue: [" + configValue + "]");
|
||||
log.info("result.data: " + result.get("data"));
|
||||
log.info("result.msg: " + result.get("msg"));
|
||||
log.info("result.code: " + result.get("code"));
|
||||
log.info("============================");
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user