diff --git a/waynboot-admin-api/src/main/java/com/wayn/admin/api/controller/message/EmailController.java b/waynboot-admin-api/src/main/java/com/wayn/admin/api/controller/message/EmailController.java index f9a4efd..0705a03 100644 --- a/waynboot-admin-api/src/main/java/com/wayn/admin/api/controller/message/EmailController.java +++ b/waynboot-admin-api/src/main/java/com/wayn/admin/api/controller/message/EmailController.java @@ -40,7 +40,7 @@ public class EmailController { sendMailVO.setSubject(subject); sendMailVO.setContent(content); sendMailVO.setTos(Collections.singletonList(tos)); - MailUtil.sendMail(emailConfig, sendMailVO, false, false); + MailUtil.sendMail(emailConfig, sendMailVO, false, true); return R.success(); } } diff --git a/waynboot-admin-api/src/main/java/com/wayn/admin/api/controller/tool/EmailConfigController.java b/waynboot-admin-api/src/main/java/com/wayn/admin/api/controller/tool/EmailConfigController.java index 233ed0b..3e5be0a 100644 --- a/waynboot-admin-api/src/main/java/com/wayn/admin/api/controller/tool/EmailConfigController.java +++ b/waynboot-admin-api/src/main/java/com/wayn/admin/api/controller/tool/EmailConfigController.java @@ -46,7 +46,7 @@ public class EmailConfigController { if (!mailConfigService.checkMailConfig(emailConfig)) { return R.error(ReturnCodeEnum.TOOL_EMAIL_ERROR); } - MailUtil.sendMail(emailConfig, mailVO, false, false); + MailUtil.sendMail(emailConfig, mailVO, false, true); return R.success(); } } diff --git a/waynboot-common/src/main/resources/application-dev.yml b/waynboot-common/src/main/resources/application-dev.yml index 4a4d8b6..db0ab77 100644 --- a/waynboot-common/src/main/resources/application-dev.yml +++ b/waynboot-common/src/main/resources/application-dev.yml @@ -53,8 +53,8 @@ es: config: host: 127.0.0.1 port: 9200 - username: - password: + username: elastic + password: 123456 scheme: http shards: 3 replicas: 2 diff --git a/waynboot-data/waynboot-data-redis/src/main/java/com/wayn/data/redis/config/CacheConfig.java b/waynboot-data/waynboot-data-redis/src/main/java/com/wayn/data/redis/config/CacheConfig.java index 8a8b9d4..d32359b 100644 --- a/waynboot-data/waynboot-data-redis/src/main/java/com/wayn/data/redis/config/CacheConfig.java +++ b/waynboot-data/waynboot-data-redis/src/main/java/com/wayn/data/redis/config/CacheConfig.java @@ -78,6 +78,15 @@ public class CacheConfig implements CachingConfigurer { return new MyRedisCacheManager(RedisCacheWriter.nonLockingRedisCacheWriter(redisConnectionFactory), defaultCacheConfig()); } + // @Bean + // public CacheManager cacheManager(RedisConnectionFactory redisConnectionFactory) { + // return RedisCacheManager.builder(redisConnectionFactory) + // .cacheDefaults(defaultCacheConfig()) + // .transactionAware() + // .build(); + // } + + private RedisCacheConfiguration defaultCacheConfig() { return RedisCacheConfiguration.defaultCacheConfig() .serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(keySerializer())) diff --git a/waynboot-data/waynboot-data-redis/src/main/java/com/wayn/data/redis/constant/RedisKeyEnum.java b/waynboot-data/waynboot-data-redis/src/main/java/com/wayn/data/redis/constant/RedisKeyEnum.java index 7f94aaf..773dd61 100644 --- a/waynboot-data/waynboot-data-redis/src/main/java/com/wayn/data/redis/constant/RedisKeyEnum.java +++ b/waynboot-data/waynboot-data-redis/src/main/java/com/wayn/data/redis/constant/RedisKeyEnum.java @@ -14,8 +14,8 @@ public enum RedisKeyEnum { ES_SYNC_CACHE(CacheConstants.CACHE_PREFIX + "es_sync_cache", 3600), CART_LOCK(CacheConstants.CACHE_PREFIX + "cart_lock:", 3600), EMAIL_CONSUMER_MAP(CacheConstants.CACHE_PREFIX + "email_consumer_map", 60), - ORDER_CONSUMER_MAP(CacheConstants.CACHE_PREFIX + "order_consumer_map", 60), - UNPAID_ORDER_CONSUMER_MAP(CacheConstants.CACHE_PREFIX + "unpaid_order_consumer_map", 60), + ORDER_CONSUMER_MAP(CacheConstants.CACHE_PREFIX + "order_consumer_key", 60), + UNPAID_ORDER_CONSUMER_MAP(CacheConstants.CACHE_PREFIX + "unpaid_order_consumer_key", 60), ORDER_RESULT_KEY(CacheConstants.CACHE_PREFIX + "order_result_key:", 60), ; diff --git a/waynboot-message-consumer/src/main/java/com/wayn/message/api/impl/MobileApiImpl.java b/waynboot-message-consumer/src/main/java/com/wayn/message/api/impl/MobileApiImpl.java index f570589..4af494a 100644 --- a/waynboot-message-consumer/src/main/java/com/wayn/message/api/impl/MobileApiImpl.java +++ b/waynboot-message-consumer/src/main/java/com/wayn/message/api/impl/MobileApiImpl.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject; import com.wayn.message.api.MobileApi; import com.wayn.message.core.constant.MQConstants; import jakarta.annotation.Resource; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.http.*; import org.springframework.retry.annotation.Backoff; @@ -17,6 +18,7 @@ import org.springframework.web.client.RestTemplate; * @author: waynaqua * @date: 2023/8/20 18:30 */ +@Slf4j @Service public class MobileApiImpl implements MobileApi { @Resource @@ -36,6 +38,7 @@ public class MobileApiImpl implements MobileApi { multiValueMap.add("order", msgObject.get("order")); HttpEntity> request = new HttpEntity<>(multiValueMap, headers); ResponseEntity response = restTemplate.postForEntity(notifyUrl, request, String.class); + log.info("submitOrder response:{}", response.getBody()); if (response.getStatusCode().value() != HttpStatus.OK.value()) { throw new Exception("调用mobile下单api失败, body:" + body); } @@ -60,6 +63,7 @@ public class MobileApiImpl implements MobileApi { multiValueMap.add("orderSn", orderSn); HttpEntity> request = new HttpEntity<>(multiValueMap, headers); ResponseEntity response = restTemplate.postForEntity(notifyUrl, request, String.class); + log.info("unpaidOrder response:{}", response.getBody()); if (response.getStatusCode().value() != HttpStatus.OK.value()) { throw new Exception("调用mobile未支付订单超时取消api失败, body:" + body); } @@ -85,6 +89,7 @@ public class MobileApiImpl implements MobileApi { multiValueMap.add("tos", msgObject.get("tos")); HttpEntity> request = new HttpEntity<>(multiValueMap, headers); ResponseEntity response = restTemplate.postForEntity(notifyUrl, request, String.class); + log.info("sendEmail response:{}", response.getBody()); if (response.getStatusCode().value() != HttpStatus.OK.value()) { throw new Exception("调用mobile发送邮件api失败, body:" + body); } diff --git a/waynboot-mobile-api/src/main/java/com/wayn/mobile/api/controller/LoginController.java b/waynboot-mobile-api/src/main/java/com/wayn/mobile/api/controller/LoginController.java index 125df14..f4dd5ce 100644 --- a/waynboot-mobile-api/src/main/java/com/wayn/mobile/api/controller/LoginController.java +++ b/waynboot-mobile-api/src/main/java/com/wayn/mobile/api/controller/LoginController.java @@ -147,7 +147,7 @@ public class LoginController { sendMailVO.setSubject("mall商城注册通知"); sendMailVO.setContent("邮箱验证码:" + verCode); sendMailVO.setTos(Collections.singletonList(registryObj.getEmail())); - MailUtil.sendMail(emailConfig, sendMailVO, false, false); + MailUtil.sendMail(emailConfig, sendMailVO, false, true); }); return R.success().add("emailKey", key); } diff --git a/waynboot-mobile-api/src/main/java/com/wayn/mobile/api/controller/UserController.java b/waynboot-mobile-api/src/main/java/com/wayn/mobile/api/controller/UserController.java index 37d4e5c..7264df2 100644 --- a/waynboot-mobile-api/src/main/java/com/wayn/mobile/api/controller/UserController.java +++ b/waynboot-mobile-api/src/main/java/com/wayn/mobile/api/controller/UserController.java @@ -88,7 +88,7 @@ public class UserController { sendMailVO.setSubject("mall商城重置密码通知"); sendMailVO.setContent("邮箱验证码:" + verCode); sendMailVO.setTos(Collections.singletonList(registryObj.getEmail())); - MailUtil.sendMail(emailConfig, sendMailVO, false, false); + MailUtil.sendMail(emailConfig, sendMailVO, false, true); return R.success().add("key", key); } diff --git a/waynboot-mobile-api/src/main/java/com/wayn/mobile/api/controller/callback/EmailController.java b/waynboot-mobile-api/src/main/java/com/wayn/mobile/api/controller/callback/EmailController.java index f9bd10a..f108d4f 100644 --- a/waynboot-mobile-api/src/main/java/com/wayn/mobile/api/controller/callback/EmailController.java +++ b/waynboot-mobile-api/src/main/java/com/wayn/mobile/api/controller/callback/EmailController.java @@ -26,7 +26,7 @@ public class EmailController { sendMailVO.setSubject(subject); sendMailVO.setContent(content); sendMailVO.setTos(List.of(tos)); - MailUtil.sendMail(emailConfig, sendMailVO, false, false); + MailUtil.sendMail(emailConfig, sendMailVO, false, true); return R.success(); } } diff --git a/waynboot-mobile-api/src/main/java/com/wayn/mobile/api/service/impl/IHomeServiceImpl.java b/waynboot-mobile-api/src/main/java/com/wayn/mobile/api/service/impl/IHomeServiceImpl.java index b42c1bd..3423301 100644 --- a/waynboot-mobile-api/src/main/java/com/wayn/mobile/api/service/impl/IHomeServiceImpl.java +++ b/waynboot-mobile-api/src/main/java/com/wayn/mobile/api/service/impl/IHomeServiceImpl.java @@ -37,7 +37,7 @@ public class IHomeServiceImpl implements IHomeService { private ThreadPoolTaskExecutor commonThreadPoolTaskExecutor; - @Cacheable(value = "home_index_cache#600", unless = "#result == null") + @Cacheable(value = "home_index_cache#300", unless = "#result == null") @Override public HomeIndexResponseVO index() { HomeIndexResponseVO responseVO = new HomeIndexResponseVO();