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); + } +}