新增在线发送短信功能

This commit is contained in:
wanggeng 2021-11-01 11:25:42 +08:00
parent d4050c6a00
commit db892fa00a
2 changed files with 49 additions and 2 deletions

View File

@ -0,0 +1,47 @@
package ink.wgink.module.sms.controller.resources.sms;
import ink.wgink.annotation.CheckRequestBodyAnnotation;
import ink.wgink.common.base.DefaultBaseController;
import ink.wgink.interfaces.consts.ISystemConstant;
import ink.wgink.module.sms.pojo.vos.sms.SmsSendVO;
import ink.wgink.module.sms.service.sms.ISmsService;
import ink.wgink.pojo.result.ErrorResult;
import ink.wgink.pojo.result.SuccessResult;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* When you feel like quitting. Think about why you started
* 当你想要放弃的时候想想当初你为何开始
*
* @ClassName: VerificationCodeController
* @Description: 验证码
* @Author: WangGeng
* @Date: 2020/3/4 7:13 下午
* @Version: 1.0
**/
@Api(tags = ISystemConstant.API_TAGS_RESOURCE_PREFIX + "短信")
@RestController
@RequestMapping(ISystemConstant.RESOURCE_PREFIX + "/sms")
public class SmsResourceController extends DefaultBaseController {
@Autowired
private ISmsService smsService;
@ApiOperation(value = "发送短信", notes = "发送短信接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query", required = true),
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PostMapping("send")
@CheckRequestBodyAnnotation
public SuccessResult send(@RequestBody SmsSendVO smsSendVO) throws Exception {
smsService.send(smsSendVO);
return new SuccessResult();
}
}

View File

@ -14,10 +14,10 @@ import io.swagger.annotations.ApiModelProperty;
@ApiModel
public class SmsSendVO {
@ApiModelProperty(name = "userIds", value = "用户ID列表")
@ApiModelProperty(name = "userIds", value = "用户ID列表(下划线分割)", required = true)
@CheckEmptyAnnotation(name = "用户ID列表")
private String userIds;
@ApiModelProperty(name = "content", value = "发送内容")
@ApiModelProperty(name = "content", value = "发送内容", required = true)
@CheckEmptyAnnotation(name = "发送内容")
private String content;