diff --git a/zlt-commons/zlt-common-core/src/main/java/com/central/common/service/impl/SuperServiceImpl.java b/zlt-commons/zlt-common-core/src/main/java/com/central/common/service/impl/SuperServiceImpl.java index a29a2292..0eab2a52 100644 --- a/zlt-commons/zlt-common-core/src/main/java/com/central/common/service/impl/SuperServiceImpl.java +++ b/zlt-commons/zlt-common-core/src/main/java/com/central/common/service/impl/SuperServiceImpl.java @@ -103,7 +103,7 @@ public class SuperServiceImpl, T> extends ServiceImpl cls = entity.getClass(); TableInfo tableInfo = TableInfoHelper.getTableInfo(cls); - if (null != tableInfo && StringUtils.isNotEmpty(tableInfo.getKeyProperty())) { + if (null != tableInfo && StrUtil.isNotEmpty(tableInfo.getKeyProperty())) { Object idVal = ReflectionKit.getMethodValue(cls, entity, tableInfo.getKeyProperty()); if (StringUtils.checkValNull(idVal) || Objects.isNull(getById((Serializable) idVal))) { if (StrUtil.isEmpty(msg)) { diff --git a/zlt-commons/zlt-log-spring-boot-starter/src/main/java/com/central/log/monitor/PointUtil.java b/zlt-commons/zlt-log-spring-boot-starter/src/main/java/com/central/log/monitor/PointUtil.java index c846df53..804a10c1 100644 --- a/zlt-commons/zlt-log-spring-boot-starter/src/main/java/com/central/log/monitor/PointUtil.java +++ b/zlt-commons/zlt-log-spring-boot-starter/src/main/java/com/central/log/monitor/PointUtil.java @@ -9,12 +9,12 @@ import lombok.extern.slf4j.Slf4j; */ @Slf4j public class PointUtil { + private static final String MSG_PATTERN = "{}|{}|{}"; + private PointUtil() { throw new IllegalStateException("Utility class"); } - public static final String SPLIT = "|"; - /** * 格式为:{时间}|{来源}|{对象id}|{类型}|{对象属性(以&分割)} * 例子1:2016-07-27 23:37:23|business-center|1|user-login|ip=xxx.xxx.xx&userName=张三&userType=后台管理员 @@ -25,10 +25,10 @@ public class PointUtil { * @param message 对象属性 */ public static void info(String id, String type, String message) { - log.info(id + SPLIT + type + SPLIT + message); + log.info(MSG_PATTERN, id, type, message); } public static void debug(String id, String type, String message) { - log.debug(id + SPLIT + type + SPLIT + message); + log.debug(MSG_PATTERN, id, type, message); } }