|
|
@@ -62,12 +62,12 @@ public class ContactUsServiceImpl extends ServiceImpl<IContactUsMapper, ContactU
|
|
|
|| StringUtils.isBlank(contactUs.getEmail()) || StringUtils.isBlank(contactUs.getCompany())){
|
|
|
throw new BusinessException(ResultCode.PARAM_MISS);
|
|
|
}
|
|
|
-// String redisKey = String.format(RedisKeyUtil.CONTACT_US_KEY,contactUs.getEmail());
|
|
|
-// if(redisUtil.hasKey(redisKey)){
|
|
|
-// throw new BusinessException(ResultCode.email_submit);
|
|
|
-// }
|
|
|
-// String uuid = UUID.randomUUID().toString().replace("-", "");
|
|
|
-// String redisKey2 = String.format(RedisKeyUtil.CONTACT_US_KEY,uuid);
|
|
|
+ String redisKey = String.format(RedisKeyUtil.CONTACT_US_KEY,contactUs.getEmail());
|
|
|
+ if(redisUtil.hasKey(redisKey)){
|
|
|
+ throw new BusinessException(ResultCode.email_submit);
|
|
|
+ }
|
|
|
+ String uuid = UUID.randomUUID().toString().replace("-", "");
|
|
|
+ String redisKey2 = String.format(RedisKeyUtil.CONTACT_US_KEY,uuid);
|
|
|
|
|
|
User user = userService.getByUserName(contactUs.getEmail());
|
|
|
contactUs.setCountry(IPUtils.getCountry(contactUs.getIpAddress()));
|
|
|
@@ -76,14 +76,13 @@ public class ContactUsServiceImpl extends ServiceImpl<IContactUsMapper, ContactU
|
|
|
this.save(contactUs);
|
|
|
return;
|
|
|
}
|
|
|
- mailTemplateService.sendContactUs2(contactUs.getEmail(),12);
|
|
|
|
|
|
-// String callBackUrl = ucenterConfig.getContactUsCallBackUrl() + uuid;
|
|
|
-// Boolean b = mailTemplateService.sendContactUs(contactUs.getEmail(),callBackUrl);
|
|
|
-// if(b){
|
|
|
-// redisUtil.set(redisKey, uuid,ucenterConfig.getEmailExTime());
|
|
|
-// redisUtil.set(redisKey2, JSONObject.toJSONString(contactUs),ucenterConfig.getEmailExTime());
|
|
|
-// }
|
|
|
+ String callBackUrl = ucenterConfig.getContactUsCallBackUrl() + uuid;
|
|
|
+ Boolean b = mailTemplateService.sendContactUs(contactUs.getEmail(),callBackUrl);
|
|
|
+ if(b){
|
|
|
+ redisUtil.set(redisKey, uuid,ucenterConfig.getEmailExTime());
|
|
|
+ redisUtil.set(redisKey2, JSONObject.toJSONString(contactUs),ucenterConfig.getEmailExTime());
|
|
|
+ }
|
|
|
this.save(contactUs);
|
|
|
}
|
|
|
|