修复:不再查询父 ID 为 0 的记录的父名称

This commit is contained in:
2023-03-05 13:10:28 +08:00
parent 926aa06bb5
commit 95784e5c7d
3 changed files with 14 additions and 1 deletions

View File

@@ -38,6 +38,11 @@ public class SysConsts {
*/
public static final String ALL_PERMISSION = "*";
/**
* 顶级父 ID
*/
public static final Long SUPER_PARENT_ID = 0L;
/**
* 默认密码
*/

View File

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