From 5167a6b54f93ccc46af40c6f96b28699cc047c39 Mon Sep 17 00:00:00 2001 From: zlt Date: Mon, 3 Feb 2020 17:31:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/central/common/service/impl/SuperServiceImpl.java | 2 +- .../src/main/java/com/central/log/monitor/PointUtil.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) 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 a29a229..0eab2a5 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 c846df5..804a10c 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); } } -- GitLab