mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-11-07 22:57:20 +08:00
Merge branch 'dev' into 2.0.x
# Conflicts: # README.md
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user