增加接口
This commit is contained in:
parent
81737962f3
commit
347d0d5d4a
@ -45,7 +45,7 @@ public class SmsResourceController extends DefaultBaseController {
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "发送短信", notes = "通过手机号直接发送短信接口")
|
||||
@ApiOperation(value = "手机用户名发送短信", notes = "通过手机号发送短信接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query", required = true),
|
||||
})
|
||||
@ -57,4 +57,16 @@ public class SmsResourceController extends DefaultBaseController {
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@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-directly/phones")
|
||||
@CheckRequestBodyAnnotation
|
||||
public SuccessResult sendDirectlyByPhones(@RequestBody SmsPhoneSendVO smsPhoneSendVO) throws Exception {
|
||||
smsService.sendDirectlyByPhones(smsPhoneSendVO);
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,68 @@
|
||||
package ink.wgink.module.wechat.miniapp.controller.resources;
|
||||
|
||||
import ink.wgink.exceptions.ParamsException;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.module.wechat.miniapp.service.IMiniappUserService;
|
||||
import ink.wgink.pojo.dtos.miniapp.MiniappUserDTO;
|
||||
import ink.wgink.pojo.result.ErrorResult;
|
||||
import ink.wgink.pojo.result.SuccessResult;
|
||||
import ink.wgink.pojo.vos.IdsVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiResponse;
|
||||
import io.swagger.annotations.ApiResponses;
|
||||
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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName: MiniappUserResourceController
|
||||
* @Description: 小程序用户接口
|
||||
* @Author: wanggeng
|
||||
* @Date: 2022/6/22 14:51
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Api(tags = ISystemConstant.API_TAGS_RESOURCE_PREFIX + "小程序用户")
|
||||
@RestController
|
||||
@RequestMapping(ISystemConstant.RESOURCE_PREFIX + "/miniapp-user")
|
||||
public class MiniappUserResourceController {
|
||||
|
||||
@Autowired
|
||||
private IMiniappUserService miniappUserService;
|
||||
|
||||
@ApiOperation(value = "通过用户ID删除", notes = "通过用户ID删除接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PostMapping("delete/user-ids")
|
||||
public SuccessResult deleteByUserIds(@RequestBody IdsVO idsVO) {
|
||||
if (idsVO.getIds().isEmpty()) {
|
||||
throw new ParamsException("id列表不能为空");
|
||||
}
|
||||
miniappUserService.delete(idsVO.getIds());
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "通过用户ID列表获取列表", notes = "通过ID列表获取列表接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PostMapping("list/user-ids")
|
||||
public List<MiniappUserDTO> listByUserIds(@RequestBody IdsVO idsVO) {
|
||||
if (idsVO.getIds().isEmpty()) {
|
||||
throw new ParamsException("id列表不能为空");
|
||||
}
|
||||
return miniappUserService.listByUserIds(idsVO.getIds());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "通过用户编码列表获取列表", notes = "通过用户编码获取列表接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PostMapping("list/user-codes")
|
||||
public List<MiniappUserDTO> listByUserCodes(@RequestBody IdsVO idsVO) {
|
||||
if (idsVO.getIds().isEmpty()) {
|
||||
throw new ParamsException("codes列表不能为空");
|
||||
}
|
||||
return miniappUserService.listByUserCodes(idsVO.getIds());
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user