From e53334611e8d51fb67e769cba898743f11dcf627 Mon Sep 17 00:00:00 2001 From: liusheng <337615773@qq.com> Date: 星期五, 16 六月 2023 17:45:23 +0800 Subject: [PATCH] 患者管理相关接口,提交 --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyCategoryController.java | 51 ++++++++++++++++++++++----------------------------- 1 files changed, 22 insertions(+), 29 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyCategoryController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyCategoryController.java index dfe83ea..f9b4d93 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyCategoryController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyCategoryController.java @@ -1,17 +1,15 @@ -package com.smartor.controller; +package com.ruoyi.web.controller.smartor; import java.util.List; import javax.servlet.http.HttpServletResponse; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; @@ -23,14 +21,14 @@ /** * 闂嵎鍒嗙被Controller - * + * * @author ruoyi * @date 2023-03-02 */ +@Api(description = "闂嵎鍒嗙被") @RestController @RequestMapping("/smartor/svycategory") -public class SvyCategoryController extends BaseController -{ +public class SvyCategoryController extends BaseController { @Autowired private ISvyCategoryService svyCategoryService; @@ -39,8 +37,7 @@ */ @PreAuthorize("@ss.hasPermi('smartor:svycategory:list')") @GetMapping("/list") - public TableDataInfo list(SvyCategory svyCategory) - { + public TableDataInfo list(SvyCategory svyCategory) { startPage(); List<SvyCategory> list = svyCategoryService.selectSvyCategoryList(svyCategory); return getDataTable(list); @@ -52,21 +49,20 @@ @PreAuthorize("@ss.hasPermi('smartor:svycategory:export')") @Log(title = "闂嵎鍒嗙被", businessType = BusinessType.EXPORT) @PostMapping("/export") - public void export(HttpServletResponse response, SvyCategory svyCategory) - { + public void export(HttpServletResponse response, SvyCategory svyCategory) { List<SvyCategory> list = svyCategoryService.selectSvyCategoryList(svyCategory); ExcelUtil<SvyCategory> util = new ExcelUtil<SvyCategory>(SvyCategory.class); util.exportExcel(response, list, "闂嵎鍒嗙被鏁版嵁"); } /** - * 鑾峰彇闂嵎鍒嗙被璇︾粏淇℃伅 + * 鑾峰彇闂嵎鍒嗙被淇℃伅閫氳繃鍒嗙被鍚嶇О */ - @PreAuthorize("@ss.hasPermi('smartor:svycategory:query')") - @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) - { - return success(svyCategoryService.selectSvyCategoryById(id)); + // @PreAuthorize("@ss.hasPermi('smartor:svycategory:query')") + @ApiOperation("鑾峰彇闂嵎鍒嗙被璇︾粏淇℃伅锛堥棶鍗风被鍒級") + @PostMapping(value = "/getInfo") + public TableDataInfo getInfo(@RequestParam(required = false) String categoryname) { + return getDataTable(svyCategoryService.selectSvyCategoryById(categoryname)); } /** @@ -75,8 +71,7 @@ @PreAuthorize("@ss.hasPermi('smartor:svycategory:add')") @Log(title = "闂嵎鍒嗙被", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody SvyCategory svyCategory) - { + public AjaxResult add(@RequestBody SvyCategory svyCategory) { return toAjax(svyCategoryService.insertSvyCategory(svyCategory)); } @@ -86,8 +81,7 @@ @PreAuthorize("@ss.hasPermi('smartor:svycategory:edit')") @Log(title = "闂嵎鍒嗙被", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody SvyCategory svyCategory) - { + public AjaxResult edit(@RequestBody SvyCategory svyCategory) { return toAjax(svyCategoryService.updateSvyCategory(svyCategory)); } @@ -96,9 +90,8 @@ */ @PreAuthorize("@ss.hasPermi('smartor:svycategory:remove')") @Log(title = "闂嵎鍒嗙被", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) - { + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(svyCategoryService.deleteSvyCategoryByIds(ids)); } } -- Gitblit v1.9.3