|
@@ -62,11 +62,16 @@ public class ContactUsServiceImpl extends ServiceImpl<IContactUsMapper, ContactU
|
|
|
|| StringUtils.isBlank(contactUs.getEmail()) || StringUtils.isBlank(contactUs.getCompany())){
|
|
|| StringUtils.isBlank(contactUs.getEmail()) || StringUtils.isBlank(contactUs.getCompany())){
|
|
|
throw new BusinessException(ResultCode.PARAM_MISS);
|
|
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 uuid = UUID.randomUUID().toString().replace("-", "");
|
|
|
String redisKey2 = String.format(RedisKeyUtil.CONTACT_US_KEY,uuid);
|
|
String redisKey2 = String.format(RedisKeyUtil.CONTACT_US_KEY,uuid);
|
|
|
|
|
|
|
|
User user = userService.getByUserName(contactUs.getEmail());
|
|
User user = userService.getByUserName(contactUs.getEmail());
|
|
|
contactUs.setCountry(IPUtils.getCountry(contactUs.getIpAddress()));
|
|
contactUs.setCountry(IPUtils.getCountry(contactUs.getIpAddress()));
|
|
|
|
|
+ redisUtil.set(redisKey,"1",60 *5);
|
|
|
if(user !=null){
|
|
if(user !=null){
|
|
|
mailTemplateService.sendContactUs2(contactUs.getEmail(),13);
|
|
mailTemplateService.sendContactUs2(contactUs.getEmail(),13);
|
|
|
this.save(contactUs);
|
|
this.save(contactUs);
|