From e8f51e442939b626713b8f209e95f2a74b94cf85 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 6 Aug 2020 09:12:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=A2=E6=88=B7app?= =?UTF-8?q?=E5=AD=98=E5=85=A5redis=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/redis/CustomerAppWxServiceUtil.java | 8 +++++++- epmet-auth/src/main/resources/bootstrap.yml | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/epmet-auth/src/main/java/com/epmet/redis/CustomerAppWxServiceUtil.java b/epmet-auth/src/main/java/com/epmet/redis/CustomerAppWxServiceUtil.java index e641d17ed6..ddd5d69769 100644 --- a/epmet-auth/src/main/java/com/epmet/redis/CustomerAppWxServiceUtil.java +++ b/epmet-auth/src/main/java/com/epmet/redis/CustomerAppWxServiceUtil.java @@ -13,6 +13,7 @@ import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl; import cn.binarywang.wx.miniapp.config.impl.WxMaDefaultConfigImpl; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerAppDTO; import com.epmet.dto.CustomerAppRedisDTO; @@ -115,7 +116,12 @@ public class CustomerAppWxServiceUtil implements ApplicationRunner { maServices = maServicesNew; if (appSet != null && result != null) { for (CustomerAppDTO app : result) { - appSet.add(appKey, app); + CustomerAppRedisDTO appRedis = ConvertUtils.sourceToTarget(app, CustomerAppRedisDTO.class); + if(appRedis == null){ + logger.warn("init CustomerAppRedis fail,convert return null,appDB:{}",JSON.toJSONString(app)); + continue; + } + appSet.add(appKey, appRedis); } } } diff --git a/epmet-auth/src/main/resources/bootstrap.yml b/epmet-auth/src/main/resources/bootstrap.yml index f3c4a05e89..2306d2da5b 100644 --- a/epmet-auth/src/main/resources/bootstrap.yml +++ b/epmet-auth/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: allow-bean-definition-overriding: true #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages_common