Showing
2 changed files
with
5 additions
and
9 deletions
| ... | @@ -83,9 +83,7 @@ public interface ConfigConstants { | ... | @@ -83,9 +83,7 @@ public interface ConfigConstants { |
| 83 | String MINI_PROGRAM_APP_SECRET = "${miniprogram.appSecret}"; | 83 | String MINI_PROGRAM_APP_SECRET = "${miniprogram.appSecret}"; |
| 84 | String MINI_PROGRAM_ORDER_REMINDER_TEMPLATE_ID = "${miniprogram.orderReminderTemplateId}"; | 84 | String MINI_PROGRAM_ORDER_REMINDER_TEMPLATE_ID = "${miniprogram.orderReminderTemplateId}"; |
| 85 | 85 | ||
| 86 | - // 公众号配置(用于订阅消息推送) | 86 | + // 公众号模板 ID(可选);appId/appSecret 见 WxOfficialAccountHttpClient 字段上的 @Value 默认值 |
| 87 | - String OFFICIAL_ACCOUNT_APP_ID = "${officialAccount.appId}"; | 87 | + String OFFICIAL_ACCOUNT_ORDER_REMINDER_TEMPLATE_ID = "${officialAccount.orderReminderTemplateId:}"; |
| 88 | - String OFFICIAL_ACCOUNT_APP_SECRET = "${officialAccount.appSecret}"; | ||
| 89 | - String OFFICIAL_ACCOUNT_ORDER_REMINDER_TEMPLATE_ID = "${officialAccount.orderReminderTemplateId}"; | ||
| 90 | 88 | ||
| 91 | } | 89 | } | ... | ... |
| ... | @@ -21,9 +21,6 @@ import java.util.HashMap; | ... | @@ -21,9 +21,6 @@ import java.util.HashMap; |
| 21 | import java.util.Map; | 21 | import java.util.Map; |
| 22 | import java.util.concurrent.TimeUnit; | 22 | import java.util.concurrent.TimeUnit; |
| 23 | 23 | ||
| 24 | -import static com.infoloop.tianting.constant.ConfigConstants.OFFICIAL_ACCOUNT_APP_ID; | ||
| 25 | -import static com.infoloop.tianting.constant.ConfigConstants.OFFICIAL_ACCOUNT_APP_SECRET; | ||
| 26 | - | ||
| 27 | /** | 24 | /** |
| 28 | * 微信公众号 HTTP 客户端 | 25 | * 微信公众号 HTTP 客户端 |
| 29 | * 用于发送公众号一次性订阅消息 | 26 | * 用于发送公众号一次性订阅消息 |
| ... | @@ -44,10 +41,11 @@ public class WxOfficialAccountHttpClient { | ... | @@ -44,10 +41,11 @@ public class WxOfficialAccountHttpClient { |
| 44 | private final RestTemplate restTemplate; | 41 | private final RestTemplate restTemplate; |
| 45 | private final StringRedisTemplate stringRedisTemplate; | 42 | private final StringRedisTemplate stringRedisTemplate; |
| 46 | 43 | ||
| 47 | - @Value(OFFICIAL_ACCOUNT_APP_ID) | 44 | + /** 未配置时为空,不阻塞启动(勿改为无默认值的 ${officialAccount.appId}) */ |
| 45 | + @Value("${officialAccount.appId:}") | ||
| 48 | private String appId; | 46 | private String appId; |
| 49 | 47 | ||
| 50 | - @Value(OFFICIAL_ACCOUNT_APP_SECRET) | 48 | + @Value("${officialAccount.appSecret:}") |
| 51 | private String appSecret; | 49 | private String appSecret; |
| 52 | 50 | ||
| 53 | private final Object lock = new Object(); | 51 | private final Object lock = new Object(); | ... | ... |
-
Please register or login to post a comment