Merge branch 'dev' into 2.0.x

# Conflicts:
#	README.md
This commit is contained in:
2023-04-03 21:37:38 +08:00
22 changed files with 88 additions and 62 deletions

View File

@@ -25,6 +25,8 @@ import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import top.charles7c.cnadmin.common.constant.StringConsts;
/**
* 异常工具类
*
@@ -98,7 +100,7 @@ public class ExceptionUtils {
* @return /
*/
public static String exToBlank(ExSupplier<String> exSupplier) {
return exToDefault(exSupplier, "");
return exToDefault(exSupplier, StringConsts.EMPTY);
}
/**

View File

@@ -24,6 +24,7 @@ import lombok.extern.slf4j.Slf4j;
import cn.hutool.core.util.StrUtil;
import top.charles7c.cnadmin.common.constant.StringConsts;
import top.charles7c.cnadmin.common.exception.ServiceException;
/**
@@ -52,8 +53,8 @@ public class CheckUtils extends Validator {
* 字段值
*/
public static void throwIfNotExists(Object obj, String entityName, String fieldName, Object fieldValue) {
String message =
String.format("%s 为 [%s] 的 %s 记录已不存在", fieldName, fieldValue, StrUtil.replace(entityName, "DO", ""));
String message = String.format("%s 为 [%s] 的 %s 记录已不存在", fieldName, fieldValue,
StrUtil.replace(entityName, "DO", StringConsts.EMPTY));
throwIfNull(obj, message, EXCEPTION_TYPE);
}