邮件-腾讯云-黑名单提示

This commit is contained in:
khalil
2025-07-09 17:37:59 +08:00
parent 101677fc51
commit 02bc8c1311
2 changed files with 7 additions and 1 deletions

View File

@@ -931,7 +931,8 @@ public enum BusiStatus {
PIC_UPLOAD_REVIEW_EXCEPTION(500, "PIC UPLOAD REVIEW EXCEPTION!"),
EMAIL_CODE_SEND_SUCCESS(200, "邮件验证码發送成功"),
EMAIL_CODE_SEND_FAILURE(200, "邮件验证码發送失败"),
EMAIL_CODE_SEND_FAILURE(3009, "邮件验证码發送失败"),
EMAIL_ADDRESS_IN_BLACK_LIST(3008, "操作失败,你的邮箱地址已经被封禁!"),
EMAIL_FORMAT_ERROR(3011, "邮箱格式错误"),
ACCOUNT_NOT_BIND_EMAIL(3012, "帐号未绑定邮箱"),
ACCOUNT_BIND_EMAIL_DIFF(3013, "提交的邮箱不是当前帐号已绑定的邮箱"),

View File

@@ -13,6 +13,7 @@ import com.accompany.email.enums.SesTypeEnum;
import com.accompany.email.strategy.EmailContext;
import com.accompany.email.strategy.EmailFactory;
import com.accompany.email.strategy.EmailResponse;
import com.tencentcloudapi.ses.v20201002.SesErrorCode;
import lombok.extern.slf4j.Slf4j;
import org.redisson.api.*;
import org.springframework.beans.factory.annotation.Autowired;
@@ -82,6 +83,10 @@ public class EmailService extends BaseService {
emailRecordService.saveRecord(emailAddress, deviceInfo, ip, code, type, response.getCode(), response.getMessage());
if (!response.isSuccess()){
if (SesErrorCode.FAILEDOPERATION_EMAILADDRINBLACKLIST.getValue().equals(response.getCode())){
throw new ServiceException(BusiStatus.EMAIL_ADDRESS_IN_BLACK_LIST);
}
throw new ServiceException(BusiStatus.EMAIL_CODE_SEND_FAILURE);
}