From 19bbb04fe271943850e5b0cdba1aaeed633bc83f Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期四, 08 六月 2023 16:25:08 +0800
Subject: [PATCH] 添加swagger

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedOuthospController.java |   41 ++++++++++++++++++++++++-----------------
 1 files changed, 24 insertions(+), 17 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedOuthospController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedOuthospController.java
index e5cca58..671b110 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedOuthospController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedOuthospController.java
@@ -1,7 +1,12 @@
-package com.smartor.controller;
+package com.ruoyi.web.controller.smartor;
 
+import java.lang.reflect.Array;
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -23,14 +28,14 @@
 
 /**
  * 鎮h�呴棬璇婅褰旵ontroller
- * 
+ *
  * @author smartor
  * @date 2023-03-04
  */
 @RestController
 @RequestMapping("/smartor/patouthosp")
-public class PatMedOuthospController extends BaseController
-{
+@Api("鎮h�呴棬璇婅褰�")
+public class PatMedOuthospController extends BaseController {
     @Autowired
     private IPatMedOuthospService patMedOuthospService;
 
@@ -39,8 +44,8 @@
      */
     @PreAuthorize("@ss.hasPermi('smartor:patouthosp:list')")
     @GetMapping("/list")
-    public TableDataInfo list(PatMedOuthosp patMedOuthosp)
-    {
+    @ApiOperation("鏌ヨ鎮h�呴棬璇婅褰曞垪琛�")
+    public TableDataInfo list(PatMedOuthosp patMedOuthosp) {
         startPage();
         List<PatMedOuthosp> list = patMedOuthospService.selectPatMedOuthospList(patMedOuthosp);
         return getDataTable(list);
@@ -51,9 +56,9 @@
      */
     @PreAuthorize("@ss.hasPermi('smartor:patouthosp:export')")
     @Log(title = "鎮h�呴棬璇婅褰�", businessType = BusinessType.EXPORT)
+    @ApiOperation("鎮h�呴棬璇婅褰�")
     @PostMapping("/export")
-    public void export(HttpServletResponse response, PatMedOuthosp patMedOuthosp)
-    {
+    public void export(HttpServletResponse response, PatMedOuthosp patMedOuthosp) {
         List<PatMedOuthosp> list = patMedOuthospService.selectPatMedOuthospList(patMedOuthosp);
         ExcelUtil<PatMedOuthosp> util = new ExcelUtil<PatMedOuthosp>(PatMedOuthosp.class);
         util.exportExcel(response, list, "鎮h�呴棬璇婅褰曟暟鎹�");
@@ -62,43 +67,45 @@
     /**
      * 鑾峰彇鎮h�呴棬璇婅褰曡缁嗕俊鎭�
      */
+    @ApiOperation("鑾峰彇鎮h�呴棬璇婅褰曡缁嗕俊鎭�")
+    @ApiImplicitParam(name = "getInfo", value = "涓婚敭ID", dataType = "long", dataTypeClass = Long.class)
     @PreAuthorize("@ss.hasPermi('smartor:patouthosp:query')")
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Long id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
         return success(patMedOuthospService.selectPatMedOuthospById(id));
     }
 
     /**
      * 鏂板鎮h�呴棬璇婅褰�
      */
+    @ApiOperation("鏂板鎮h�呴棬璇婅褰�")
     @PreAuthorize("@ss.hasPermi('smartor:patouthosp:add')")
     @Log(title = "鎮h�呴棬璇婅褰�", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody PatMedOuthosp patMedOuthosp)
-    {
+    public AjaxResult add(@RequestBody PatMedOuthosp patMedOuthosp) {
         return toAjax(patMedOuthospService.insertPatMedOuthosp(patMedOuthosp));
     }
 
     /**
      * 淇敼鎮h�呴棬璇婅褰�
      */
+    @ApiOperation("淇敼鎮h�呴棬璇婅褰�")
     @PreAuthorize("@ss.hasPermi('smartor:patouthosp:edit')")
     @Log(title = "鎮h�呴棬璇婅褰�", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody PatMedOuthosp patMedOuthosp)
-    {
+    public AjaxResult edit(@RequestBody PatMedOuthosp patMedOuthosp) {
         return toAjax(patMedOuthospService.updatePatMedOuthosp(patMedOuthosp));
     }
 
     /**
      * 鍒犻櫎鎮h�呴棬璇婅褰�
      */
+    @ApiOperation("鍒犻櫎鎮h�呴棬璇婅褰�")
     @PreAuthorize("@ss.hasPermi('smartor:patouthosp:remove')")
+    @ApiImplicitParam(name = "remove", value = "涓婚敭ID", dataType = "long", dataTypeClass = Array.class)
     @Log(title = "鎮h�呴棬璇婅褰�", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids)
-    {
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(patMedOuthospService.deletePatMedOuthospByIds(ids));
     }
 }

--
Gitblit v1.9.3