1. 新增 api 绑定客户凭证进行权限校验
2. 去除 api 定义的缓存策略 3. 新增短信渠道 4. 新增用户信息模糊查询 5. 修复全局的单元测试
This commit is contained in:
@@ -2,12 +2,15 @@ package com.zt.plat.module.system.api.sms;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.module.system.api.sms.dto.send.SmsSendSingleToUserReqDTO;
|
||||
import com.zt.plat.module.system.api.sms.dto.log.SmsLogRespDTO;
|
||||
import com.zt.plat.module.system.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
@@ -25,4 +28,8 @@ public interface SmsSendApi {
|
||||
@Operation(summary = "发送单条短信给 Member 用户", description = "在 mobile 为空时,使用 userId 加载对应 Member 的手机号")
|
||||
CommonResult<Long> sendSingleSmsToMember(@Valid @RequestBody SmsSendSingleToUserReqDTO reqDTO);
|
||||
|
||||
@GetMapping(PREFIX + "/log/get")
|
||||
@Operation(summary = "根据日志编号查询短信状态")
|
||||
CommonResult<SmsLogRespDTO> getSmsLog(@RequestParam("id") Long id);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.zt.plat.module.system.api.sms.dto.log;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
@Schema(description = "RPC 服务 - 短信日志返回 DTO")
|
||||
public class SmsLogRespDTO {
|
||||
|
||||
@Schema(description = "日志编号", example = "123")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "短信渠道编码", example = "HL95")
|
||||
private String channelCode;
|
||||
|
||||
@Schema(description = "模板编码", example = "HL95_TEST")
|
||||
private String templateCode;
|
||||
|
||||
@Schema(description = "短信类型")
|
||||
private Integer templateType;
|
||||
|
||||
@Schema(description = "模板内容")
|
||||
private String templateContent;
|
||||
|
||||
@Schema(description = "模板参数")
|
||||
private Map<String, Object> templateParams;
|
||||
|
||||
@Schema(description = "短信 API 模板编号")
|
||||
private String apiTemplateId;
|
||||
|
||||
@Schema(description = "手机号", example = "13800138000")
|
||||
private String mobile;
|
||||
|
||||
@Schema(description = "用户编号", example = "1024")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "用户类型")
|
||||
private Integer userType;
|
||||
|
||||
@Schema(description = "发送状态")
|
||||
private Integer sendStatus;
|
||||
|
||||
@Schema(description = "发送时间")
|
||||
private LocalDateTime sendTime;
|
||||
|
||||
@Schema(description = "发送结果编码")
|
||||
private String apiSendCode;
|
||||
|
||||
@Schema(description = "发送结果信息")
|
||||
private String apiSendMsg;
|
||||
|
||||
@Schema(description = "发送请求ID")
|
||||
private String apiRequestId;
|
||||
|
||||
@Schema(description = "发送序列号")
|
||||
private String apiSerialNo;
|
||||
|
||||
@Schema(description = "接收状态")
|
||||
private Integer receiveStatus;
|
||||
|
||||
@Schema(description = "接收时间")
|
||||
private LocalDateTime receiveTime;
|
||||
|
||||
@Schema(description = "接收结果编码")
|
||||
private String apiReceiveCode;
|
||||
|
||||
@Schema(description = "接收结果信息")
|
||||
private String apiReceiveMsg;
|
||||
|
||||
}
|
||||
@@ -107,6 +107,7 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode SMS_CHANNEL_NOT_EXISTS = new ErrorCode(1_002_011_000, "短信渠道不存在");
|
||||
ErrorCode SMS_CHANNEL_DISABLE = new ErrorCode(1_002_011_001, "短信渠道不处于开启状态,不允许选择");
|
||||
ErrorCode SMS_CHANNEL_HAS_CHILDREN = new ErrorCode(1_002_011_002, "无法删除,该短信渠道还有短信模板");
|
||||
ErrorCode SMS_CHANNEL_BALANCE_UNSUPPORTED = new ErrorCode(1_002_011_003, "该短信渠道不支持余额查询");
|
||||
|
||||
// ========== 短信模板 1-002-012-000 ==========
|
||||
ErrorCode SMS_TEMPLATE_NOT_EXISTS = new ErrorCode(1_002_012_000, "短信模板不存在");
|
||||
@@ -120,6 +121,7 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode SMS_SEND_MOBILE_NOT_EXISTS = new ErrorCode(1_002_013_000, "手机号不存在");
|
||||
ErrorCode SMS_SEND_MOBILE_TEMPLATE_PARAM_MISS = new ErrorCode(1_002_013_001, "模板参数({})缺失");
|
||||
ErrorCode SMS_SEND_TEMPLATE_NOT_EXISTS = new ErrorCode(1_002_013_002, "短信模板不存在");
|
||||
ErrorCode SMS_CALLBACK_SIGN_INVALID = new ErrorCode(1_002_013_100, "短信回调签名校验失败");
|
||||
|
||||
// ========== 短信验证码 1-002-014-000 ==========
|
||||
ErrorCode SMS_CODE_NOT_FOUND = new ErrorCode(1_002_014_000, "验证码不存在");
|
||||
|
||||
Reference in New Issue
Block a user