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 ++++++++++++++++++++++++++------------- ruoyi-admin/pom.xml | 27 ++++++++++++- sql/menu_client_app.sql | 0 ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java | 4 +- ruoyi-ui/src/views/login.vue | 6 +- 5 files changed, 83 insertions(+), 34 deletions(-) diff --git a/ruoyi-admin/pom.xml b/ruoyi-admin/pom.xml index e4ff18f..da03592 100644 --- a/ruoyi-admin/pom.xml +++ b/ruoyi-admin/pom.xml @@ -44,8 +44,7 @@ </dependency> <dependency> <groupId>com.microsoft.sqlserver</groupId> - <artifactId>mssql-jdbc</artifactId> - <version>9.4.0.jre8</version> + <artifactId>mssql-jdbc</artifactId> </dependency> <!-- 鏍稿績妯″潡--> <dependency> @@ -80,6 +79,10 @@ <version>2.5.15</version> <configuration> <fork>true</fork> <!-- 濡傛灉娌℃湁璇ラ厤缃紝devtools涓嶄細鐢熸晥 --> + <profiles> + <profile>dev</profile> + <profile>prod</profile> + </profiles> </configuration> <executions> <execution> @@ -102,4 +105,24 @@ <finalName>${project.artifactId}</finalName> </build> + <profiles> + <profile> + <id>dev</id> + <properties> + <spring.profiles.active>dev</spring.profiles.active> + <logging.level.com.ruoyi>debug</logging.level.com.ruoyi> + </properties> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + </profile> + <profile> + <id>prod</id> + <properties> + <spring.profiles.active>prod</spring.profiles.active> + <logging.level.com.ruoyi>info</logging.level.com.ruoyi> + </properties> + </profile> + </profiles> + </project> \ No newline at end of file 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)); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java b/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java index ae1c3ec..222d24d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java @@ -113,9 +113,9 @@ // 鐢ˋpiInfoBuilder杩涜瀹氬埗 return new ApiInfoBuilder() // 璁剧疆鏍囬 - .title("鏍囬锛氳嫢渚濈鐞嗙郴缁焈鎺ュ彛鏂囨。") + .title("骞夸笢姘戣埅鍖荤枟蹇嚎") // 鎻忚堪 - .description("鎻忚堪锛氱敤浜庣鐞嗛泦鍥㈡棗涓嬪叕鍙哥殑浜哄憳淇℃伅,鍏蜂綋鍖呮嫭XXX,XXX妯″潡...") + .description("鐢ㄤ簬绠$悊骞夸笢姘戣埅鍖荤枟蹇嚎") // 浣滆�呬俊鎭� .contact(new Contact(ruoyiConfig.getName(), null, null)) // 鐗堟湰 diff --git a/ruoyi-ui/src/views/login.vue b/ruoyi-ui/src/views/login.vue index c859548..ec59f2b 100644 --- a/ruoyi-ui/src/views/login.vue +++ b/ruoyi-ui/src/views/login.vue @@ -65,7 +65,7 @@ import { getCodeImg } from "@/api/login"; import Cookies from "js-cookie"; import { encrypt, decrypt } from '@/utils/jsencrypt' - +//admin admin123 export default { name: "Login", data() { @@ -73,8 +73,8 @@ title: process.env.VUE_APP_TITLE, codeUrl: "", loginForm: { - username: "admin", - password: "admin123", + username: "", + password: "", rememberMe: false, code: "", uuid: "" diff --git a/ruoyi-admin/src/main/resources/sql/menu_client_app.sql b/sql/menu_client_app.sql similarity index 100% rename from ruoyi-admin/src/main/resources/sql/menu_client_app.sql rename to sql/menu_client_app.sql -- Gitblit v1.9.1