update 新增支持占位符格式的 ServiceException 构造方法

- 新增 ServiceException(String message, Object... args) 构造器,内部使用 Hutool StrFormatter.format 格式化消息
- 解决日志打印和异常抛出信息格式不统一的问题,统一使用 {} 占位符
- 优化异常消息书写,简化拼接,提升代码可读性和维护性
This commit is contained in:
AprilWind
2025-08-06 11:03:01 +08:00
parent e015970f79
commit 543be7a809
9 changed files with 15 additions and 16 deletions

View File

@@ -119,7 +119,7 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService {
*/
private void validEntityBeforeSave(SysOssConfig entity) {
if (StringUtils.isNotEmpty(entity.getConfigKey()) && !checkConfigKeyUnique(entity)) {
throw new ServiceException("操作配置'" + entity.getConfigKey() + "'失败, 配置key已存在!");
throw new ServiceException("操作配置'{}'失败, 配置key已存在!", entity.getConfigKey());
}
}