From 7f0432762534d1c2e742062d3ca67968a606086f Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期五, 08 七月 2022 19:17:48 +0800 Subject: [PATCH] update 优化 自定义 openapi 处理器 彻底实现零注解无入侵生成文档 --- ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestI18nController.java | 1 ruoyi-demo/src/main/java/com/ruoyi/demo/controller/queue/PriorityQueueController.java | 2 ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java | 1 pom.xml | 15 + ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java | 1 ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java | 2 ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestDemoController.java | 1 ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java | 1 ruoyi-demo/src/main/java/com/ruoyi/demo/controller/Swagger3DemoController.java | 1 ruoyi-demo/src/main/java/com/ruoyi/demo/controller/queue/BoundedQueueController.java | 1 ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java | 1 ruoyi-generator/src/main/resources/vm/java/controller.java.vm | 4 ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestExcelController.java | 1 ruoyi-demo/src/main/java/com/ruoyi/demo/controller/queue/DelayedQueueController.java | 2 ruoyi-framework/src/main/java/com/ruoyi/framework/handler/OpenApiHandler.java | 272 +++++++++++++++++++++++++++++++++++++++++++++ ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java | 1 ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestBatchController.java | 2 ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java | 1 ruoyi-demo/src/main/java/com/ruoyi/demo/controller/MailController.java | 1 ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java | 1 ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisCacheController.java | 1 ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestTreeController.java | 1 ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java | 1 ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisLockController.java | 1 ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysOssConfigController.java | 1 ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestSensitiveController.java | 2 ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java | 1 ruoyi-framework/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java | 20 +++ ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java | 1 ruoyi-demo/src/main/java/com/ruoyi/demo/controller/SmsController.java | 1 ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java | 1 ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java | 2 ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisRateLimiterController.java | 1 ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java | 1 ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRegisterController.java | 1 ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java | 2 ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java | 1 ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysOssController.java | 1 ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisPubSubController.java | 1 ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java | 1 ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java | 1 41 files changed, 303 insertions(+), 52 deletions(-) diff --git a/pom.xml b/pom.xml index 4f59219..c5ed42b 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ <maven-jar-plugin.version>3.2.2</maven-jar-plugin.version> <spring-boot.mybatis>2.2.2</spring-boot.mybatis> <druid.version>1.2.11</druid.version> - <knife4j.version>3.0.3</knife4j.version> + <springdoc.version>1.6.9</springdoc.version> <swagger-annotations.version>1.5.22</swagger-annotations.version> <poi.version>5.2.2</poi.version> <easyexcel.version>3.1.1</easyexcel.version> @@ -37,6 +37,7 @@ <dynamic-ds.version>3.5.1</dynamic-ds.version> <tlog.version>1.4.3</tlog.version> <xxl-job.version>2.3.1</xxl-job.version> + <lombok.version>1.18.24</lombok.version> <!-- 缁熶竴 guava 鐗堟湰 瑙e喅闅愬紡婕忔礊闂 --> <guava.version>30.0-jre</guava.version> @@ -87,13 +88,19 @@ <dependency> <groupId>org.springdoc</groupId> <artifactId>springdoc-openapi-ui</artifactId> - <version>1.6.9</version> + <version>${springdoc.version}</version> </dependency> <dependency> <groupId>org.springdoc</groupId> <artifactId>springdoc-openapi-javadoc</artifactId> - <version>1.6.9</version> + <version>${springdoc.version}</version> + </dependency> + + <dependency> + <groupId>org.projectlombok</groupId> + <artifactId>lombok</artifactId> + <version>${lombok.version}</version> </dependency> <dependency> @@ -341,7 +348,7 @@ <path> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> - <version>1.18.24</version> + <version>${lombok.version}</version> </path> <path> <groupId>org.springframework.boot</groupId> diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java index f2279db..f4e7dff 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java @@ -19,7 +19,6 @@ import com.ruoyi.sms.core.SmsTemplate; import com.ruoyi.sms.entity.SmsResult; import com.ruoyi.system.service.ISysConfigService; -import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; @@ -39,7 +38,6 @@ @Anonymous @Slf4j @Validated -@Tag(name = "楠岃瘉鐮佹搷浣滃鐞�", description = "楠岃瘉鐮佺鐞�") @RequiredArgsConstructor @RestController public class CaptchaController { diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java index 849d7c3..1e116bc 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java @@ -19,7 +19,6 @@ * * @author Lion Li */ -@Tag(name = "缂撳瓨鐩戞帶", description = "缂撳瓨鐩戞帶绠$悊") @RequiredArgsConstructor @RestController @RequestMapping("/monitor/cache") diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java index a58c54e..0d50a6e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java @@ -24,7 +24,6 @@ * @author Lion Li */ @Validated -@Tag(name = "绯荤粺璁块棶璁板綍", description = "绯荤粺璁块棶璁板綍绠$悊") @RequiredArgsConstructor @RestController @RequestMapping("/monitor/logininfor") diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java index 7176962..3684c2d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java @@ -24,7 +24,6 @@ * @author Lion Li */ @Validated -@Tag(name = "鎿嶄綔鏃ュ織璁板綍", description = "鎿嶄綔鏃ュ織璁板綍绠$悊") @RequiredArgsConstructor @RestController @RequestMapping("/monitor/operlog") diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java index ec611ca..1a42b4e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java @@ -28,7 +28,6 @@ * * @author Lion Li */ -@Tag(name = "鍦ㄧ嚎鐢ㄦ埛鐩戞帶", description = "鍦ㄧ嚎鐢ㄦ埛鐩戞帶绠$悊") @RequiredArgsConstructor @RestController @RequestMapping("/monitor/online") diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java index d2cdcb7..b8cacca 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java @@ -25,7 +25,6 @@ * @author Lion Li */ @Validated -@Tag(name = "鍙傛暟閰嶇疆鎺у埗鍣�", description = "鍙傛暟閰嶇疆绠$悊") @RequiredArgsConstructor @RestController @RequestMapping("/system/config") diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java index b17cf51..916b124 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java @@ -26,7 +26,6 @@ * @author Lion Li */ @Validated -@Tag(name = "閮ㄩ棬鎺у埗鍣�", description = "閮ㄩ棬绠$悊") @RequiredArgsConstructor @RestController @RequestMapping("/system/dept") diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java index 6dfa05f..22a5017 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java @@ -12,7 +12,6 @@ import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.system.service.ISysDictDataService; import com.ruoyi.system.service.ISysDictTypeService; -import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -27,7 +26,6 @@ * @author Lion Li */ @Validated -@Tag(name = "鏁版嵁瀛楀吀淇℃伅鎺у埗鍣�", description = "鏁版嵁瀛楀吀淇℃伅绠$悊") @RequiredArgsConstructor @RestController @RequestMapping("/system/dict/data") diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java index 3eb3480..ba2b048 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java @@ -25,7 +25,6 @@ * @author Lion Li */ @Validated -@Tag(name = "鏁版嵁瀛楀吀淇℃伅鎺у埗鍣�", description = "鏁版嵁瀛楀吀淇℃伅绠$悊") @RequiredArgsConstructor @RestController @RequestMapping("/system/dict/type") diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java index 11d0d50..5a9eba2 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java @@ -12,7 +12,6 @@ * * @author Lion Li */ -@Tag(name ="棣栭〉鎺у埗鍣�", description = "棣栭〉绠$悊") @RequiredArgsConstructor @RestController public class SysIndexController { diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java index 10b9dce..2097825 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java @@ -33,7 +33,6 @@ * @author Lion Li */ @Validated -@Tag(name = "鐧诲綍楠岃瘉鎺у埗鍣�", description = "鐧诲綍楠岃瘉绠$悊") @RequiredArgsConstructor @RestController public class SysLoginController { diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java index 713dfbe..faf68ce 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java @@ -25,7 +25,6 @@ * @author Lion Li */ @Validated -@Tag(name = "鑿滃崟淇℃伅鎺у埗鍣�", description = "鑿滃崟淇℃伅绠$悊") @RequiredArgsConstructor @RestController @RequestMapping("/system/menu") diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java index 0e2eb58..17e18bf 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java @@ -20,7 +20,6 @@ * @author Lion Li */ @Validated -@Tag(name = "鍏憡淇℃伅鎺у埗鍣�", description = "鍏憡淇℃伅绠$悊") @RequiredArgsConstructor @RestController @RequestMapping("/system/notice") diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysOssConfigController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysOssConfigController.java index c9afca0..d8c4c0d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysOssConfigController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysOssConfigController.java @@ -31,7 +31,6 @@ * @date 2021-08-13 */ @Validated -@Tag(name = "瀵硅薄瀛樺偍閰嶇疆鎺у埗鍣�", description = "瀵硅薄瀛樺偍閰嶇疆绠$悊") @RequiredArgsConstructor @RestController @RequestMapping("/system/oss/config") diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysOssController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysOssController.java index 85faa16..4092e4a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysOssController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysOssController.java @@ -40,7 +40,6 @@ * @author Lion Li */ @Validated -@Tag(name = "瀵硅薄瀛樺偍鎺у埗鍣�", description = "瀵硅薄瀛樺偍绠$悊") @RequiredArgsConstructor @RestController @RequestMapping("/system/oss") diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java index 5feaa6c..6569877 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java @@ -11,7 +11,6 @@ import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.system.domain.SysPost; import com.ruoyi.system.service.ISysPostService; -import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -25,7 +24,6 @@ * @author Lion Li */ @Validated -@Tag(name ="宀椾綅淇℃伅鎺у埗鍣�", description = "宀椾綅淇℃伅绠$悊") @RequiredArgsConstructor @RestController @RequestMapping("/system/post") diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java index ee45ac2..eb926c7 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java @@ -31,7 +31,6 @@ * @author Lion Li */ @Validated -@Tag(name = "涓汉淇℃伅鎺у埗鍣�", description = "涓汉淇℃伅绠$悊") @RequiredArgsConstructor @RestController @RequestMapping("/system/user/profile") diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRegisterController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRegisterController.java index 79b5d86..e45d826 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRegisterController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRegisterController.java @@ -19,7 +19,6 @@ * @author Lion Li */ @Validated -@Tag(name = "娉ㄥ唽楠岃瘉鎺у埗鍣�", description = "娉ㄥ唽楠岃瘉绠$悊") @RequiredArgsConstructor @RestController public class SysRegisterController extends BaseController { diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java index 31694b0..5b6b88b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java @@ -32,7 +32,6 @@ * @author Lion Li */ @Validated -@Tag(name = "瑙掕壊淇℃伅鎺у埗鍣�", description = "瑙掕壊淇℃伅绠$悊") @RequiredArgsConstructor @RestController @RequestMapping("/system/role") diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java index c32af70..f7662e8 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java @@ -45,7 +45,6 @@ * @author Lion Li */ @Validated -@Tag(name = "鐢ㄦ埛淇℃伅鎺у埗鍣�", description = "鐢ㄦ埛淇℃伅绠$悊") @RequiredArgsConstructor @RestController @RequestMapping("/system/user") diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/MailController.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/MailController.java index ddfca7f..2eb8ea6 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/MailController.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/MailController.java @@ -18,7 +18,6 @@ * @author Michelle.Chung */ @Validated -@Tag(name = "閭欢鍙戦�佹渚�", description = "閭欢鍙戦�佹渚�") @RequiredArgsConstructor @RestController @RequestMapping("/demo/mail") diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisCacheController.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisCacheController.java index a345167..80c576c 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisCacheController.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisCacheController.java @@ -20,7 +20,6 @@ */ // 绫荤骇鍒� 缂撳瓨缁熶竴閰嶇疆 //@CacheConfig(cacheNames = "redissonCacheMap") -@Tag(name = "spring-cache 婕旂ず妗堜緥", description = "spring-cache 婕旂ず妗堜緥") @RequiredArgsConstructor @RestController @RequestMapping("/demo/cache") diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisLockController.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisLockController.java index 69d231d..9b27b44 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisLockController.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisLockController.java @@ -20,7 +20,6 @@ * * @author shenxinquan */ -@Tag(name = "娴嬭瘯鍒嗗竷寮忛攣鐨勬牱渚�", description = "娴嬭瘯鍒嗗竷寮忛攣鐨勬牱渚�") @Slf4j @RestController @RequestMapping("/demo/redisLock") diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisPubSubController.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisPubSubController.java index dae1036..320d8e1 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisPubSubController.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisPubSubController.java @@ -13,7 +13,6 @@ * * @author Lion Li */ -@Tag(name = "Redis鍙戝竷璁㈤槄 婕旂ず妗堜緥", description = "Redis鍙戝竷璁㈤槄") @RequiredArgsConstructor @RestController @RequestMapping("/demo/redis/pubsub") diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisRateLimiterController.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisRateLimiterController.java index 39e5034..dae3e72 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisRateLimiterController.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisRateLimiterController.java @@ -15,7 +15,6 @@ * * @author Lion Li */ -@Tag(name = "娴嬭瘯鍒嗗竷寮忛檺娴佹牱渚�", description = "娴嬭瘯鍒嗗竷寮忛檺娴佹牱渚�") @Slf4j @RestController @RequestMapping("/demo/rateLimiter") diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/SmsController.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/SmsController.java index a9c38a7..8547dd3 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/SmsController.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/SmsController.java @@ -22,7 +22,6 @@ * @version 4.2.0 */ @Validated -@Tag(name = "鐭俊婕旂ず妗堜緥", description = "鐭俊婕旂ず妗堜緥") @RequiredArgsConstructor @RestController @RequestMapping("/demo/sms") diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/Swagger3DemoController.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/Swagger3DemoController.java index b044277..fdf9654 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/Swagger3DemoController.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/Swagger3DemoController.java @@ -14,7 +14,6 @@ * * @author Lion Li */ -@Tag(name = "婕旂ずswagger3鎺у埗鍣�", description = "婕旂ずswagger3鎺ュ彛") @RestController @RequestMapping("/swagger/demo") public class Swagger3DemoController { diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestBatchController.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestBatchController.java index 6f5e850..caed975 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestBatchController.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestBatchController.java @@ -5,7 +5,6 @@ import com.ruoyi.common.core.domain.R; import com.ruoyi.demo.domain.TestDemo; import com.ruoyi.demo.mapper.TestDemoMapper; -import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -21,7 +20,6 @@ * @author Lion Li * @date 2021-05-30 */ -@Tag(name = "娴嬭瘯鎵归噺鏂规硶", description = "娴嬭瘯鎵归噺鏂规硶") @RequiredArgsConstructor @RestController @RequestMapping("/demo/batch") diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestDemoController.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestDemoController.java index b4b977a..77bb10e 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestDemoController.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestDemoController.java @@ -41,7 +41,6 @@ * @date 2021-07-26 */ @Validated -@Tag(name = "娴嬭瘯鍗曡〃鎺у埗鍣�", description = "娴嬭瘯鍗曡〃绠$悊") @RequiredArgsConstructor @RestController @RequestMapping("/demo/demo") diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestExcelController.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestExcelController.java index 95d307b..454ceb7 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestExcelController.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestExcelController.java @@ -20,7 +20,6 @@ * * @author Lion Li */ -@Tag(name = "娴嬭瘯Excel鍔熻兘", description = "娴嬭瘯Excel鍔熻兘") @RestController @RequestMapping("/demo/excel") public class TestExcelController { diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestI18nController.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestI18nController.java index adb7f6f..cd44adb 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestI18nController.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestI18nController.java @@ -20,7 +20,6 @@ * @author Lion Li */ @Validated -@Tag(name = "娴嬭瘯鍥介檯鍖栨帶鍒跺櫒", description = "娴嬭瘯鍥介檯鍖栫鐞�") @RestController @RequestMapping("/demo/i18n") public class TestI18nController { diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestSensitiveController.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestSensitiveController.java index 53a56d8..6bf904c 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestSensitiveController.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestSensitiveController.java @@ -4,7 +4,6 @@ import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.enums.SensitiveStrategy; -import io.swagger.v3.oas.annotations.tags.Tag; import lombok.Data; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -20,7 +19,6 @@ * @version 3.6.0 * @see com.ruoyi.common.core.service.SensitiveService */ -@Tag(name = "娴嬭瘯鏁版嵁鑴辨晱鎺у埗鍣�", description = "娴嬭瘯鏁版嵁鑴辨晱绠$悊") @RestController @RequestMapping("/demo/sensitive") public class TestSensitiveController extends BaseController { diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestTreeController.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestTreeController.java index 38e314b..6a7a2ef 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestTreeController.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestTreeController.java @@ -31,7 +31,6 @@ * @date 2021-07-26 */ @Validated -@Tag(name = "娴嬭瘯鏍戣〃鎺у埗鍣�", description = "娴嬭瘯鏍戣〃绠$悊") @RequiredArgsConstructor @RestController @RequestMapping("/demo/tree") diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/queue/BoundedQueueController.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/queue/BoundedQueueController.java index 6f921f5..9fd8764 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/queue/BoundedQueueController.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/queue/BoundedQueueController.java @@ -21,7 +21,6 @@ * @version 3.6.0 */ @Slf4j -@Tag(name = "鏈夌晫闃熷垪 婕旂ず妗堜緥", description = "鏈夌晫闃熷垪") @RequiredArgsConstructor @RestController @RequestMapping("/demo/queue/bounded") diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/queue/DelayedQueueController.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/queue/DelayedQueueController.java index 32067e5..e6dbee8 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/queue/DelayedQueueController.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/queue/DelayedQueueController.java @@ -2,7 +2,6 @@ import com.ruoyi.common.core.domain.R; import com.ruoyi.common.utils.redis.QueueUtils; -import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.GetMapping; @@ -24,7 +23,6 @@ * @version 3.6.0 */ @Slf4j -@Tag(name = "寤惰繜闃熷垪 婕旂ず妗堜緥", description = "寤惰繜闃熷垪") @RequiredArgsConstructor @RestController @RequestMapping("/demo/queue/delayed") diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/queue/PriorityQueueController.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/queue/PriorityQueueController.java index 1e7425f..ba6c340 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/queue/PriorityQueueController.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/queue/PriorityQueueController.java @@ -3,7 +3,6 @@ import cn.hutool.core.util.RandomUtil; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.utils.redis.QueueUtils; -import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.GetMapping; @@ -22,7 +21,6 @@ * @version 3.6.0 */ @Slf4j -@Tag(name = "浼樺厛闃熷垪 婕旂ず妗堜緥", description = "浼樺厛闃熷垪") @RequiredArgsConstructor @RestController @RequestMapping("/demo/queue/priority") diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java index 271f01f..6f7a8c8 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java @@ -1,11 +1,15 @@ package com.ruoyi.framework.config; import com.ruoyi.framework.config.properties.SwaggerProperties; +import com.ruoyi.framework.handler.OpenApiHandler; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.security.SecurityRequirement; import lombok.RequiredArgsConstructor; -import org.springdoc.core.SpringDocConfiguration; +import org.springdoc.core.*; +import org.springdoc.core.customizers.OpenApiBuilderCustomizer; +import org.springdoc.core.customizers.ServerBaseUrlCustomizer; +import org.springdoc.core.providers.JavadocProvider; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; @@ -14,6 +18,7 @@ import java.util.ArrayList; import java.util.List; +import java.util.Optional; /** * Swagger 鏂囨。閰嶇疆 @@ -57,4 +62,17 @@ info.setVersion(infoProperties.getVersion()); return info; } + + /** + * 鑷畾涔� openapi 澶勭悊鍣� + */ + @Bean + public OpenAPIService openApiBuilder(Optional<OpenAPI> openAPI, + SecurityService securityParser, + SpringDocConfigProperties springDocConfigProperties, PropertyResolverUtils propertyResolverUtils, + Optional<List<OpenApiBuilderCustomizer>> openApiBuilderCustomisers, + Optional<List<ServerBaseUrlCustomizer>> serverBaseUrlCustomisers, Optional<JavadocProvider> javadocProvider) { + return new OpenApiHandler(openAPI, securityParser, springDocConfigProperties, propertyResolverUtils, openApiBuilderCustomisers, serverBaseUrlCustomisers, javadocProvider); + } + } diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/handler/OpenApiHandler.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/handler/OpenApiHandler.java new file mode 100644 index 0000000..608cae5 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/handler/OpenApiHandler.java @@ -0,0 +1,272 @@ +package com.ruoyi.framework.handler; + +import cn.hutool.core.io.IoUtil; +import io.swagger.v3.core.jackson.TypeNameResolver; +import io.swagger.v3.core.util.AnnotationsUtils; +import io.swagger.v3.oas.annotations.tags.Tags; +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.Paths; +import io.swagger.v3.oas.models.tags.Tag; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springdoc.core.OpenAPIService; +import org.springdoc.core.PropertyResolverUtils; +import org.springdoc.core.SecurityService; +import org.springdoc.core.SpringDocConfigProperties; +import org.springdoc.core.customizers.OpenApiBuilderCustomizer; +import org.springdoc.core.customizers.ServerBaseUrlCustomizer; +import org.springdoc.core.providers.JavadocProvider; +import org.springframework.context.ApplicationContext; +import org.springframework.core.annotation.AnnotatedElementUtils; +import org.springframework.util.CollectionUtils; +import org.springframework.web.method.HandlerMethod; + +import java.io.StringReader; +import java.lang.reflect.Method; +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * 鑷畾涔� openapi 澶勭悊鍣� + * 瀵规簮鐮佸姛鑳借繘琛屼慨鏀� 澧炲己浣跨敤 + */ +@SuppressWarnings("all") +public class OpenApiHandler extends OpenAPIService { + + /** + * The constant LOGGER. + */ + private static final Logger LOGGER = LoggerFactory.getLogger(OpenAPIService.class); + + /** + * The Context. + */ + private ApplicationContext context; + + /** + * The Security parser. + */ + private final SecurityService securityParser; + + /** + * The Mappings map. + */ + private final Map<String, Object> mappingsMap = new HashMap<>(); + + /** + * The Springdoc tags. + */ + private final Map<HandlerMethod, io.swagger.v3.oas.models.tags.Tag> springdocTags = new HashMap<>(); + + /** + * The Open api builder customisers. + */ + private final Optional<List<OpenApiBuilderCustomizer>> openApiBuilderCustomisers; + + /** + * The server base URL customisers. + */ + private final Optional<List<ServerBaseUrlCustomizer>> serverBaseUrlCustomizers; + + /** + * The Spring doc config properties. + */ + private final SpringDocConfigProperties springDocConfigProperties; + + /** + * The Open api. + */ + private OpenAPI openAPI; + + /** + * The Cached open api map. + */ + private final Map<String, OpenAPI> cachedOpenAPI = new HashMap<>(); + + /** + * The Is servers present. + */ + private boolean isServersPresent; + + /** + * The Server base url. + */ + private String serverBaseUrl; + + /** + * The Property resolver utils. + */ + private final PropertyResolverUtils propertyResolverUtils; + + /** + * The javadoc provider. + */ + private final Optional<JavadocProvider> javadocProvider; + + /** + * The Basic error controller. + */ + private static Class<?> basicErrorController; + + static { + try { + //spring-boot 2 + basicErrorController = Class.forName("org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController"); + } catch (ClassNotFoundException e) { + //spring-boot 1 + try { + basicErrorController = Class.forName("org.springframework.boot.autoconfigure.web.BasicErrorController"); + } catch (ClassNotFoundException classNotFoundException) { + //Basic error controller class not found + LOGGER.trace(classNotFoundException.getMessage()); + } + } + } + + /** + * Instantiates a new Open api builder. + * + * @param openAPI the open api + * @param securityParser the security parser + * @param springDocConfigProperties the spring doc config properties + * @param propertyResolverUtils the property resolver utils + * @param openApiBuilderCustomizers the open api builder customisers + * @param serverBaseUrlCustomizers the server base url customizers + * @param javadocProvider the javadoc provider + */ + public OpenApiHandler(Optional<OpenAPI> openAPI, SecurityService securityParser, + SpringDocConfigProperties springDocConfigProperties, PropertyResolverUtils propertyResolverUtils, + Optional<List<OpenApiBuilderCustomizer>> openApiBuilderCustomizers, + Optional<List<ServerBaseUrlCustomizer>> serverBaseUrlCustomizers, + Optional<JavadocProvider> javadocProvider) { + super(openAPI, securityParser, springDocConfigProperties, propertyResolverUtils, openApiBuilderCustomizers, serverBaseUrlCustomizers, javadocProvider); + if (openAPI.isPresent()) { + this.openAPI = openAPI.get(); + if (this.openAPI.getComponents() == null) + this.openAPI.setComponents(new Components()); + if (this.openAPI.getPaths() == null) + this.openAPI.setPaths(new Paths()); + if (!CollectionUtils.isEmpty(this.openAPI.getServers())) + this.isServersPresent = true; + } + this.propertyResolverUtils = propertyResolverUtils; + this.securityParser = securityParser; + this.springDocConfigProperties = springDocConfigProperties; + this.openApiBuilderCustomisers = openApiBuilderCustomizers; + this.serverBaseUrlCustomizers = serverBaseUrlCustomizers; + this.javadocProvider = javadocProvider; + if (springDocConfigProperties.isUseFqn()) + TypeNameResolver.std.setUseFqn(true); + } + + @Override + public Operation buildTags(HandlerMethod handlerMethod, Operation operation, OpenAPI openAPI, Locale locale) { + + Set<Tag> tags = new HashSet<>(); + Set<String> tagsStr = new HashSet<>(); + + buildTagsFromMethod(handlerMethod.getMethod(), tags, tagsStr, locale); + buildTagsFromClass(handlerMethod.getBeanType(), tags, tagsStr, locale); + + if (!CollectionUtils.isEmpty(tagsStr)) + tagsStr = tagsStr.stream() + .map(str -> propertyResolverUtils.resolve(str, locale)) + .collect(Collectors.toSet()); + + if (springdocTags.containsKey(handlerMethod)) { + io.swagger.v3.oas.models.tags.Tag tag = springdocTags.get(handlerMethod); + tagsStr.add(tag.getName()); + if (openAPI.getTags() == null || !openAPI.getTags().contains(tag)) { + openAPI.addTagsItem(tag); + } + } + + if (!CollectionUtils.isEmpty(tagsStr)) { + if (CollectionUtils.isEmpty(operation.getTags())) + operation.setTags(new ArrayList<>(tagsStr)); + else { + Set<String> operationTagsSet = new HashSet<>(operation.getTags()); + operationTagsSet.addAll(tagsStr); + operation.getTags().clear(); + operation.getTags().addAll(operationTagsSet); + } + } + + if (isAutoTagClasses(operation)) { + + + if (javadocProvider.isPresent()) { + String description = javadocProvider.get().getClassJavadoc(handlerMethod.getBeanType()); + if (StringUtils.isNotBlank(description)) { + io.swagger.v3.oas.models.tags.Tag tag = new io.swagger.v3.oas.models.tags.Tag(); + + // 鑷畾涔夐儴鍒� 淇敼浣跨敤java娉ㄩ噴褰搕ag鍚� + List<String> list = IoUtil.readLines(new StringReader(description), new ArrayList<>()); + // tag.setName(tagAutoName); + tag.setName(list.get(0)); + operation.addTagsItem(list.get(0)); + + tag.setDescription(description); + if (openAPI.getTags() == null || !openAPI.getTags().contains(tag)) { + openAPI.addTagsItem(tag); + } + } + } else { + String tagAutoName = splitCamelCase(handlerMethod.getBeanType().getSimpleName()); + operation.addTagsItem(tagAutoName); + } + } + + if (!CollectionUtils.isEmpty(tags)) { + // Existing tags + List<io.swagger.v3.oas.models.tags.Tag> openApiTags = openAPI.getTags(); + if (!CollectionUtils.isEmpty(openApiTags)) + tags.addAll(openApiTags); + openAPI.setTags(new ArrayList<>(tags)); + } + + // Handle SecurityRequirement at operation level + io.swagger.v3.oas.annotations.security.SecurityRequirement[] securityRequirements = securityParser + .getSecurityRequirements(handlerMethod); + if (securityRequirements != null) { + if (securityRequirements.length == 0) + operation.setSecurity(Collections.emptyList()); + else + securityParser.buildSecurityRequirement(securityRequirements, operation); + } + + return operation; + } + + private void buildTagsFromMethod(Method method, Set<io.swagger.v3.oas.models.tags.Tag> tags, Set<String> tagsStr, Locale locale) { + // method tags + Set<Tags> tagsSet = AnnotatedElementUtils + .findAllMergedAnnotations(method, Tags.class); + Set<io.swagger.v3.oas.annotations.tags.Tag> methodTags = tagsSet.stream() + .flatMap(x -> Stream.of(x.value())).collect(Collectors.toSet()); + methodTags.addAll(AnnotatedElementUtils.findAllMergedAnnotations(method, io.swagger.v3.oas.annotations.tags.Tag.class)); + if (!CollectionUtils.isEmpty(methodTags)) { + tagsStr.addAll(methodTags.stream().map(tag -> propertyResolverUtils.resolve(tag.name(), locale)).collect(Collectors.toSet())); + List<io.swagger.v3.oas.annotations.tags.Tag> allTags = new ArrayList<>(methodTags); + addTags(allTags, tags, locale); + } + } + + private void addTags(List<io.swagger.v3.oas.annotations.tags.Tag> sourceTags, Set<io.swagger.v3.oas.models.tags.Tag> tags, Locale locale) { + Optional<Set<io.swagger.v3.oas.models.tags.Tag>> optionalTagSet = AnnotationsUtils + .getTags(sourceTags.toArray(new io.swagger.v3.oas.annotations.tags.Tag[0]), true); + optionalTagSet.ifPresent(tagsSet -> { + tagsSet.forEach(tag -> { + tag.name(propertyResolverUtils.resolve(tag.getName(), locale)); + tag.description(propertyResolverUtils.resolve(tag.getDescription(), locale)); + if (tags.stream().noneMatch(t -> t.getName().equals(tag.getName()))) + tags.add(tag); + }); + }); + } + +} diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java index 7a20df1..f7c2cfa 100644 --- a/ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java @@ -29,7 +29,6 @@ * @author Lion Li */ @Validated -@Tag(name = "浠g爜鐢熸垚", description = "浠g爜鐢熸垚绠$悊") @RequiredArgsConstructor @RestController @RequestMapping("/tool/gen") diff --git a/ruoyi-generator/src/main/resources/vm/java/controller.java.vm b/ruoyi-generator/src/main/resources/vm/java/controller.java.vm index 550be92..1b2bc13 100644 --- a/ruoyi-generator/src/main/resources/vm/java/controller.java.vm +++ b/ruoyi-generator/src/main/resources/vm/java/controller.java.vm @@ -27,16 +27,14 @@ import com.ruoyi.common.core.page.TableDataInfo; #elseif($table.tree) #end -import io.swagger.v3.oas.annotations.tags.Tag; /** - * ${functionName}Controller + * ${functionName} * * @author ${author} * @date ${datetime} */ @Validated -@Tag(name ="${functionName}鎺у埗鍣�", description = "${functionName}绠$悊") @RequiredArgsConstructor @RestController @RequestMapping("/${moduleName}/${businessName}") -- Gitblit v1.9.3