|
|
@@ -62,26 +62,28 @@ 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()));
|
|
|
if(user !=null){
|
|
|
- mailTemplateService.sendContactUs2(contactUs.getEmail());
|
|
|
+ mailTemplateService.sendContactUs2(contactUs.getEmail(),13);
|
|
|
this.save(contactUs);
|
|
|
return;
|
|
|
}
|
|
|
- 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());
|
|
|
- }
|
|
|
+ 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());
|
|
|
+// }
|
|
|
this.save(contactUs);
|
|
|
}
|
|
|
|