Compare commits
No commits in common. "18bdcc98e553cb6267fea67276c8f11acc0b43c4" and "fe7a7607c55637d4c2be07fb8575de65dad8b686" have entirely different histories.
18bdcc98e5
...
fe7a7607c5
|
|
@ -1,22 +1,14 @@
|
|||
package org.qinan.safetyeval.adapter.web;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.jjb.saas.message.client.message.facede.MessageFacade;
|
||||
import com.jjb.saas.message.client.message.request.MessageSendCmd;
|
||||
import com.jjb.saas.message.client.message.request.MessageTargetCmd;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import java.util.UUID;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.qinan.safetyeval.client.api.AccountApi;
|
||||
import org.qinan.safetyeval.client.co.AccountCO;
|
||||
import org.qinan.safetyeval.client.dto.AccountAddCmd;
|
||||
import org.qinan.safetyeval.client.dto.AccountModifyCmd;
|
||||
import org.qinan.safetyeval.client.dto.AccountPageQuery;
|
||||
import org.qinan.safetyeval.client.dto.PageResponse;
|
||||
import org.qinan.safetyeval.client.dto.SendMessageCmd;
|
||||
import org.qinan.safetyeval.client.dto.SingleResponse;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
|
@ -33,7 +25,6 @@ import javax.annotation.Resource;
|
|||
*
|
||||
* @author safety-eval
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "用户管理")
|
||||
@RestController
|
||||
@RequestMapping("/account")
|
||||
|
|
@ -42,9 +33,6 @@ public class AccountController {
|
|||
@Resource
|
||||
private AccountApi accountApi;
|
||||
|
||||
@DubboReference
|
||||
private MessageFacade messageFacade;
|
||||
|
||||
@ApiOperation("新增用户")
|
||||
@PostMapping("/save")
|
||||
public SingleResponse<AccountCO> add(@Validated @RequestBody AccountAddCmd cmd) {
|
||||
|
|
@ -74,25 +62,4 @@ public class AccountController {
|
|||
public PageResponse<AccountCO> page(@Validated AccountPageQuery query) {
|
||||
return accountApi.page(query);
|
||||
}
|
||||
|
||||
@ApiOperation("发送短信")
|
||||
@PostMapping("/sendMessage")
|
||||
public com.alibaba.cola.dto.SingleResponse<Boolean> sendMessage(@Validated @RequestBody SendMessageCmd cmd) {
|
||||
MessageSendCmd messageSendCmd = new MessageSendCmd();
|
||||
messageSendCmd.setBusinessId(UUID.randomUUID().toString().replace("-", ""));
|
||||
|
||||
MessageTargetCmd messageTargetCmd = new MessageTargetCmd();
|
||||
messageTargetCmd.setUserId(cmd.getUserId());
|
||||
messageSendCmd.setTargetCmd(messageTargetCmd);
|
||||
|
||||
messageSendCmd.setSourceCode("MS000146");
|
||||
messageSendCmd.setNeedTokenEnum(false);
|
||||
messageSendCmd.setParams(cmd.getParams());
|
||||
|
||||
log.info("发送短信参数: messageSendCmd: {}", JSONUtil.toJsonStr(messageSendCmd));
|
||||
com.alibaba.cola.dto.SingleResponse<Boolean> result = messageFacade.send(messageSendCmd);
|
||||
log.info("发送短信结果: result: {}", JSONUtil.toJsonStr(result));
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,27 +0,0 @@
|
|||
package org.qinan.safetyeval.client.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.Map;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 发送短信命令
|
||||
*
|
||||
* @author safety-eval
|
||||
*/
|
||||
@Data
|
||||
public class SendMessageCmd {
|
||||
|
||||
@ApiModelProperty(value = "消息接受人ID", required = true)
|
||||
@NotNull(message = "消息接受人ID不能为空")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "消息模板编码", required = true)
|
||||
@NotBlank(message = "消息模板编码不能为空")
|
||||
private String sourceCode;
|
||||
|
||||
@ApiModelProperty(value = "消息模板参数")
|
||||
private Map<String, Object> params;
|
||||
}
|
||||
Loading…
Reference in New Issue