From 1217bda7a36ad1b48fe0b453b54c84095d62f8d7 Mon Sep 17 00:00:00 2001 From: wanglizhong <wlz> Date: 星期一, 05 五月 2025 19:05:56 +0800 Subject: [PATCH] fix:增加swagger配置 --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TbOrdersController.java | 80 ++++++++++++++++++++++++++------------- 1 files changed, 53 insertions(+), 27 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TbOrdersController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TbOrdersController.java index 716e251..d7a9801 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TbOrdersController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TbOrdersController.java @@ -13,17 +13,14 @@ import com.ruoyi.common.utils.civilAviation.ServiceOrderUtil; import com.ruoyi.system.domain.SysClientApp; import com.ruoyi.system.service.ISysClientAppService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; -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; @@ -40,6 +37,7 @@ * @author wzp * @date 2025-05-01 */ +@Api("璁㈠崟绠$悊") @RestController @RequestMapping("/system/orders") public class TbOrdersController extends BaseController @@ -50,9 +48,7 @@ @Autowired private ISysClientAppService clientAppService; - /** - * 鏌ヨorders鍒楄〃 - */ + @ApiOperation("鏌ヨ璁㈠崟鍒楄〃") @PreAuthorize("@ss.hasPermi('system:orders:list')") @GetMapping("/list") public TableDataInfo list(TbOrders tbOrders) @@ -62,9 +58,7 @@ return getDataTable(list); } - /** - * 瀵煎嚭orders鍒楄〃 - */ + @ApiOperation("瀵煎嚭璁㈠崟鍒楄〃") @PreAuthorize("@ss.hasPermi('system:orders:export')") @Log(title = "orders", businessType = BusinessType.EXPORT) @PostMapping("/export") @@ -75,9 +69,8 @@ util.exportExcel(response, list, "orders鏁版嵁"); } - /** - * 鑾峰彇orders璇︾粏淇℃伅 - */ + @ApiOperation("鑾峰彇璁㈠崟璇︾粏淇℃伅") + @ApiImplicitParam(name = "OrderID", value = "璁㈠崟ID", required = true, dataType = "Long", paramType = "path") @PreAuthorize("@ss.hasPermi('system:orders:query')") @GetMapping(value = "/{OrderID}") public AjaxResult getInfo(@PathVariable("OrderID") Long OrderID) @@ -93,6 +86,22 @@ // @Anonymous(needSign = true) @Anonymous // @Log(title = "orders", businessType = BusinessType.INSERT) + @ApiOperation("鏂板璁㈠崟") + @ApiImplicitParams({ + @ApiImplicitParam(name = "orderID", value = "璁㈠崟ID", dataType = "Long"), + @ApiImplicitParam(name = "typeCode", value = "璁㈠崟绫诲瀷", dataType = "Integer"), + @ApiImplicitParam(name = "linkTel", value = "鑱旂郴鐢佃瘽", dataType = "String"), + @ApiImplicitParam(name = "linkPerson", value = "鑱旂郴浜�", dataType = "String"), + @ApiImplicitParam(name = "bookingDate", value = "棰勭害鏃堕棿", dataType = "Date"), + @ApiImplicitParam(name = "patientName", value = "鎮h�呭鍚�", dataType = "String"), + @ApiImplicitParam(name = "age", value = "骞撮緞", dataType = "Integer"), + @ApiImplicitParam(name = "sex", value = "鎬у埆", dataType = "Integer"), + @ApiImplicitParam(name = "localAddress", value = "杞嚭鍖婚櫌", dataType = "String"), + @ApiImplicitParam(name = "sendAddress", value = "杞叆鍖婚櫌", dataType = "String"), + @ApiImplicitParam(name = "complaint", value = "璇婃柇淇℃伅", dataType = "String"), + @ApiImplicitParam(name = "remark", value = "澶囨敞", dataType = "String"), + @ApiImplicitParam(name = "bookingPrice", value = "鎶ヤ环", dataType = "BigDecimal") + }) @PostMapping("/add") public AjaxResult add(@RequestBody TbOrders tbOrders) { try { @@ -154,9 +163,8 @@ } } - /** - * 閲嶆柊鍙戦�佽鍗� - */ + @ApiOperation("閲嶆柊鍙戦�佽鍗�") + @ApiImplicitParam(name = "orderId", value = "璁㈠崟ID", required = true, dataType = "Long", paramType = "path") @PostMapping("/resend/{orderId}") public AjaxResult resendOrder(@PathVariable Long orderId) { @@ -217,6 +225,12 @@ + @ApiOperation("鍙栨秷璁㈠崟") + @ApiImplicitParams({ + @ApiImplicitParam(name = "orderID", value = "璁㈠崟ID", required = true, dataType = "Long"), + @ApiImplicitParam(name = "thirdOrderNo", value = "绗笁鏂硅鍗曞彿", required = true, dataType = "String"), + @ApiImplicitParam(name = "reason", value = "鍙栨秷鍘熷洜", required = true, dataType = "String") + }) @Anonymous @PostMapping("/cancelOrder") public AjaxResult cancelOrder(@RequestBody OrderCancelVo cancelVo) @@ -252,9 +266,22 @@ } } - /** - * 淇敼orders - */ + @ApiOperation("淇敼璁㈠崟") + @ApiImplicitParams({ + @ApiImplicitParam(name = "orderID", value = "璁㈠崟ID", required = true, dataType = "Long"), + @ApiImplicitParam(name = "typeCode", value = "璁㈠崟绫诲瀷", dataType = "Integer"), + @ApiImplicitParam(name = "linkTel", value = "鑱旂郴鐢佃瘽", dataType = "String"), + @ApiImplicitParam(name = "linkPerson", value = "鑱旂郴浜�", dataType = "String"), + @ApiImplicitParam(name = "bookingDate", value = "棰勭害鏃堕棿", dataType = "Date"), + @ApiImplicitParam(name = "patientName", value = "鎮h�呭鍚�", dataType = "String"), + @ApiImplicitParam(name = "age", value = "骞撮緞", dataType = "Integer"), + @ApiImplicitParam(name = "sex", value = "鎬у埆", dataType = "Integer"), + @ApiImplicitParam(name = "localAddress", value = "杞嚭鍖婚櫌", dataType = "String"), + @ApiImplicitParam(name = "sendAddress", value = "杞叆鍖婚櫌", dataType = "String"), + @ApiImplicitParam(name = "complaint", value = "璇婃柇淇℃伅", dataType = "String"), + @ApiImplicitParam(name = "remark", value = "澶囨敞", dataType = "String"), + @ApiImplicitParam(name = "bookingPrice", value = "鎶ヤ环", dataType = "BigDecimal") + }) @PreAuthorize("@ss.hasPermi('system:orders:edit')") @Log(title = "orders", businessType = BusinessType.UPDATE) @PutMapping @@ -263,12 +290,11 @@ return toAjax(tbOrdersService.updateTbOrders(tbOrders)); } - /** - * 鍒犻櫎orders - */ + @ApiOperation("鍒犻櫎璁㈠崟") + @ApiImplicitParam(name = "OrderIDs", value = "璁㈠崟ID鏁扮粍", required = true, dataType = "Long[]", paramType = "path") @PreAuthorize("@ss.hasPermi('system:orders:remove')") @Log(title = "orders", businessType = BusinessType.DELETE) - @DeleteMapping("/{OrderIDs}") + @DeleteMapping("/{OrderIDs}") public AjaxResult remove(@PathVariable Long[] OrderIDs) { return toAjax(tbOrdersService.deleteTbOrdersByOrderIDs(OrderIDs)); -- Gitblit v1.9.1