From 02c635e50d1a3f24191ec6f6cc6cd687486992b9 Mon Sep 17 00:00:00 2001 From: wans <747101512@qq.com> Date: Fri, 14 Jan 2022 10:23:59 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E8=A6=81=E5=85=B3=E7=88=B1=E4=BA=BA?= =?UTF-8?q?=E7=BE=A4=E6=8E=A5=E5=8F=A3-=E6=96=B0=E5=A2=9E-=E5=88=A0?= =?UTF-8?q?=E9=99=A4-=E5=88=86=E9=A1=B5=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../KeyPeopleConcernsResourceController.java | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 src/main/java/cn/com/tenlion/commonpopulation/controller/resource/keypeopleconcerns/KeyPeopleConcernsResourceController.java diff --git a/src/main/java/cn/com/tenlion/commonpopulation/controller/resource/keypeopleconcerns/KeyPeopleConcernsResourceController.java b/src/main/java/cn/com/tenlion/commonpopulation/controller/resource/keypeopleconcerns/KeyPeopleConcernsResourceController.java new file mode 100644 index 0000000..4bfd46a --- /dev/null +++ b/src/main/java/cn/com/tenlion/commonpopulation/controller/resource/keypeopleconcerns/KeyPeopleConcernsResourceController.java @@ -0,0 +1,68 @@ +package cn.com.tenlion.commonpopulation.controller.resource.keypeopleconcerns; + +import cn.com.tenlion.commonpopulation.service.keypeopleconcerns.IKeyPeopleConcernsService; +import ink.wgink.common.base.DefaultBaseController; +import ink.wgink.exceptions.RemoveException; +import ink.wgink.exceptions.SaveException; +import ink.wgink.exceptions.SearchException; +import ink.wgink.interfaces.consts.ISystemConstant; +import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.result.ErrorResult; +import ink.wgink.pojo.result.SuccessResult; +import ink.wgink.pojo.result.SuccessResultList; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + +/** + * 重要关爱人员 Resource接口 + * @author xwangs + * @create 2022-01-11 14:46 + * @description + */ +@Api(tags = ISystemConstant.API_TAGS_RESOURCE_PREFIX + "重要关爱人员") +@RestController +@RequestMapping(ISystemConstant.RESOURCE_PREFIX + "/key-people-concerns") +public class KeyPeopleConcernsResourceController extends DefaultBaseController { + + @Autowired + private IKeyPeopleConcernsService keyPeopleConcernsService; + + @ApiOperation(value = "重要关爱人群-分页列表", notes = "重要关爱人群-分页列表") + @ApiImplicitParams({ + @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), + @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"), + @ApiImplicitParam(name = "keywords", value = "身份证号|姓名", paramType = "query", dataType = "String") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("list-page") + public SuccessResultList>> listPageKeyPeopleConcerns(ListPage page) throws SearchException { + Map params = requestParams(); + page.setParams(params); + return keyPeopleConcernsService.listPageKeyPeopleConcerns(page); + } + + @ApiOperation(value = "重要关爱人员-新增", notes = "重要关爱人员-新增") + @ApiImplicitParams({ + @ApiImplicitParam(name = "fullName", value = "姓名", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "idCardNumber", value = "身份证号", paramType = "query", dataType = "string") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PostMapping("save") + public SuccessResult save(@RequestBody Map params) throws SaveException { + return keyPeopleConcernsService.saveKeyPeopleConcerns(params); + } + + @ApiOperation(value = "重要关爱人群-删除", notes = "重要关爱人群-删除") + @ApiImplicitParams({ + @ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @DeleteMapping("remove/{ids}") + public SuccessResult remove(@PathVariable("ids") String ids) throws RemoveException { + return keyPeopleConcernsService.removeKeyPeopleConcerns(ids); + } +}