From 45e57a4e5e436d77d8c682ff380eb41955047ebb Mon Sep 17 00:00:00 2001 From: "eko.zhan" Date: Wed, 18 Dec 2024 16:35:39 +0800 Subject: [PATCH] feat: upgrade swagger --- kbase-stack-base/pom.xml | 20 ++----- .../heap/base/config/SwaggerConfig.java | 45 +++++----------- .../heap/base/exception/ResultCode.java | 5 +- .../heap/base/model/vo/ResponseEntity.java | 18 +++---- .../web/controller/ExpenseController.java | 20 +++---- .../web/controller/FlowableController.java | 16 +++--- .../minio/web/controller/MinioController.java | 14 ++--- .../screw/web/controller/ScrewController.java | 4 +- .../heap/shiro/config/SwaggerConfig.java | 53 ------------------- .../shiro/web/controller/LoginController.java | 6 +-- .../web/controller/LogoutController.java | 4 +- .../shiro/web/controller/UserController.java | 15 +++--- pom.xml | 1 + 13 files changed, 68 insertions(+), 153 deletions(-) delete mode 100644 kbase-stack-shiro/kbase-stack-shiro-boot/src/main/java/com/ibothub/heap/shiro/config/SwaggerConfig.java diff --git a/kbase-stack-base/pom.xml b/kbase-stack-base/pom.xml index 9cbc72f..3029ec5 100644 --- a/kbase-stack-base/pom.xml +++ b/kbase-stack-base/pom.xml @@ -26,23 +26,9 @@ - io.springfox - springfox-swagger2 - - - org.mapstruct - mapstruct - - - - - io.springfox - springfox-swagger-ui - - - io.springfox - springfox-boot-starter - 3.0.0 + org.springdoc + springdoc-openapi-starter-webmvc-ui + ${springdoc.version} diff --git a/kbase-stack-base/src/main/java/com/ibothub/heap/base/config/SwaggerConfig.java b/kbase-stack-base/src/main/java/com/ibothub/heap/base/config/SwaggerConfig.java index 6999599..21e7fd7 100644 --- a/kbase-stack-base/src/main/java/com/ibothub/heap/base/config/SwaggerConfig.java +++ b/kbase-stack-base/src/main/java/com/ibothub/heap/base/config/SwaggerConfig.java @@ -1,19 +1,12 @@ package com.ibothub.heap.base.config; -import io.swagger.annotations.Api; -import org.apache.tomcat.util.net.openssl.ciphers.Authentication; +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Contact; +import io.swagger.v3.oas.models.info.Info; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.http.MediaType; -import springfox.documentation.builders.ApiInfoBuilder; -import springfox.documentation.builders.PathSelectors; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.service.ApiInfo; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spring.web.plugins.Docket; -import java.util.Collections; -import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; /** * @author eko.zhan @@ -21,30 +14,18 @@ * @date 2020/10/15 20:25 */ @Configuration -@EnableSwagger2WebMvc +@OpenAPIDefinition public class SwaggerConfig { @Bean - public Docket createRestApi() { - return new Docket(DocumentationType.SWAGGER_2) - .produces(Collections.singleton(MediaType.APPLICATION_JSON_UTF8_VALUE)) - .consumes(Collections.singleton(MediaType.APPLICATION_JSON_UTF8_VALUE)) - .ignoredParameterTypes(Authentication.class) - .useDefaultResponseMessages(false) - .apiInfo(apiInfo()) - .select() - .apis(RequestHandlerSelectors.withClassAnnotation(Api.class)) - .paths(PathSelectors.any()) - .build(); - } - - - private ApiInfo apiInfo() { - return new ApiInfoBuilder() - .title("接口文档") - .termsOfServiceUrl("http://ibothub.com/") - .version("1.0") - .build(); + public OpenAPI openAPI() { + return new OpenAPI() + .info(new Info() + .title("swagger api") + .contact(new Contact().name("eko.zhan").url("https://ekozhan.com")) + .description("swagger api") + .version("2.0.0") + ); } } diff --git a/kbase-stack-base/src/main/java/com/ibothub/heap/base/exception/ResultCode.java b/kbase-stack-base/src/main/java/com/ibothub/heap/base/exception/ResultCode.java index 1e8bef4..3cd8509 100644 --- a/kbase-stack-base/src/main/java/com/ibothub/heap/base/exception/ResultCode.java +++ b/kbase-stack-base/src/main/java/com/ibothub/heap/base/exception/ResultCode.java @@ -1,6 +1,7 @@ package com.ibothub.heap.base.exception; -import io.swagger.annotations.ApiModel; + +import io.swagger.v3.oas.annotations.media.Schema; /** *
@@ -14,7 +15,7 @@
  * @version v1.0 , 2019-03-02 16:03
  * @see org.springframework.web.client.HttpClientErrorException.BadRequest
  */
-@ApiModel
+@Schema
 public enum ResultCode {
     /**
      * request handle success
diff --git a/kbase-stack-base/src/main/java/com/ibothub/heap/base/model/vo/ResponseEntity.java b/kbase-stack-base/src/main/java/com/ibothub/heap/base/model/vo/ResponseEntity.java
index cf78de6..4b3d4eb 100644
--- a/kbase-stack-base/src/main/java/com/ibothub/heap/base/model/vo/ResponseEntity.java
+++ b/kbase-stack-base/src/main/java/com/ibothub/heap/base/model/vo/ResponseEntity.java
@@ -2,8 +2,9 @@
 
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.ibothub.heap.base.exception.ResultCode;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import java.io.IOException;
+import java.io.Serializable;
 import lombok.AllArgsConstructor;
 import lombok.Getter;
 import lombok.NoArgsConstructor;
@@ -12,9 +13,6 @@
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 
-import java.io.IOException;
-import java.io.Serializable;
-
 /**
  * wrapper for response entity
  *
@@ -26,31 +24,31 @@
 @Accessors(chain = true)
 @NoArgsConstructor
 @AllArgsConstructor
-@ApiModel(description = "响应数据")
+@Schema(description = "响应数据")
 public class ResponseEntity implements Serializable {
 
     /**
      * response result code, not http response code
      */
-    @ApiModelProperty("响应码")
+    @Schema(description = "响应码")
     private String code = "";
 
     /**
      * response result code meaning
      */
-    @ApiModelProperty("响应码含义")
+    @Schema(description = "响应码含义")
     private String message = "";
 
     /**
      * response result explanation, usually used to describe exception detail
      */
-    @ApiModelProperty("响应码解释,通常用于描述异常细节")
+    @Schema(description = "响应码解释,通常用于描述异常细节")
     private String description = "";
 
     /**
      * response result data
      */
-    @ApiModelProperty("响应主体")
+    @Schema(description = "响应主体")
     private T data;
 
     /**
diff --git a/kbase-stack-flowable/kbase-stack-flowable-alpha/src/main/java/com/ibothub/heap/flowable/web/controller/ExpenseController.java b/kbase-stack-flowable/kbase-stack-flowable-alpha/src/main/java/com/ibothub/heap/flowable/web/controller/ExpenseController.java
index f0ec7e3..941cf17 100644
--- a/kbase-stack-flowable/kbase-stack-flowable-alpha/src/main/java/com/ibothub/heap/flowable/web/controller/ExpenseController.java
+++ b/kbase-stack-flowable/kbase-stack-flowable-alpha/src/main/java/com/ibothub/heap/flowable/web/controller/ExpenseController.java
@@ -14,8 +14,8 @@
 import com.ibothub.heap.flowable.model.vo.TaskVO;
 import com.ibothub.heap.flowable.service.BeanConverterContext;
 import com.ibothub.heap.flowable.util.FlowableUtils;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Operation;
 import lombok.extern.slf4j.Slf4j;
 import org.flowable.engine.*;
 //import org.flowable.engine.common.impl.identity.Authentication;
@@ -36,7 +36,7 @@
  * @version v1.0
  * @date 2022/2/21 21:50
  */
-@Api(tags = "费用报销")
+@Tag(name = "费用报销")
 @RestController
 @RequestMapping("/api/expense")
 @Slf4j
@@ -65,7 +65,7 @@ public class ExpenseController {
     @Resource
     BeanConverterContext beanConverterContext;
 
-    @ApiOperation("test")
+    @Operation(summary = "test")
     @PostMapping("test")
     public ResponseEntity test() {
 
@@ -76,7 +76,7 @@ public ResponseEntity test() {
         return ResponseEntity.ok();
     }
 
-    @ApiOperation("发起流程")
+    @Operation(summary = "发起流程")
     @PostMapping("start")
     public ResponseEntity start(String userId, Double money, String summary) {
 
@@ -113,7 +113,7 @@ public ResponseEntity start(String userId, Double money, String summary)
         return ResponseEntity.ok(String.format("提交成功.流程实例Id为:%s", processInstance.getId()));
     }
 
-    @ApiOperation("查询所有流程实例")
+    @Operation(summary = "查询所有流程实例")
     @GetMapping(value = "/historyList")
     public ResponseEntity> historyList(String userId){
 
@@ -132,7 +132,7 @@ public ResponseEntity> historyList(String userId){
         return ResponseEntity.ok(beanConverter.forwardProcessInstance(list));
     }
 
-    @ApiOperation("查询指定用户的待办事项")
+    @Operation(summary = "查询指定用户的待办事项")
     @GetMapping(value = "/taskList")
     public ResponseEntity> taskList(String userId){
 
@@ -165,7 +165,7 @@ public ResponseEntity> taskList(String userId){
      *
      * @param taskId 任务ID
      */
-    @ApiOperation("通过")
+    @Operation(summary = "通过")
     @PostMapping(value = "apply")
     public ResponseEntity apply(String taskId) {
         Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
@@ -182,7 +182,7 @@ public ResponseEntity apply(String taskId) {
     /**
      * 拒绝
      */
-    @ApiOperation("拒绝")
+    @Operation(summary = "拒绝")
     @PostMapping(value = "reject")
     public ResponseEntity reject(String taskId) {
         HashMap map = Maps.newHashMap();
@@ -195,7 +195,7 @@ public ResponseEntity reject(String taskId) {
      * 删除所有流程实例
      * @return
      */
-    @ApiOperation("删除所有流程实例")
+    @Operation(summary = "删除所有流程实例")
     @DeleteMapping(value="deleteAll")
     public ResponseEntity deleteAll(){
 
diff --git a/kbase-stack-flowable/kbase-stack-flowable-ui/src/main/java/com/ibothub/heap/flowable/web/controller/FlowableController.java b/kbase-stack-flowable/kbase-stack-flowable-ui/src/main/java/com/ibothub/heap/flowable/web/controller/FlowableController.java
index 1278471..b4ced71 100644
--- a/kbase-stack-flowable/kbase-stack-flowable-ui/src/main/java/com/ibothub/heap/flowable/web/controller/FlowableController.java
+++ b/kbase-stack-flowable/kbase-stack-flowable-ui/src/main/java/com/ibothub/heap/flowable/web/controller/FlowableController.java
@@ -9,8 +9,8 @@
 import com.ibothub.heap.flowable.model.vo.TaskVO;
 import com.ibothub.heap.flowable.service.BeanConverterContext;
 import com.ibothub.heap.flowable.util.FlowableUtils;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Operation;
 import lombok.extern.slf4j.Slf4j;
 import org.flowable.common.engine.impl.identity.Authentication;
 import org.flowable.engine.*;
@@ -34,7 +34,7 @@
  * @version v1.0
  * @date 2022/3/10 20:41
  */
-@Api(tags = "工作流流转接口")
+@Tag(name = "工作流流转接口")
 @RestController
 @RequestMapping("/api/flowable")
 @Slf4j
@@ -64,7 +64,7 @@ public class FlowableController {
     BeanConverterContext beanConverterContext;
 
 
-    @ApiOperation("发起流程")
+    @Operation(summary = "发起流程")
     @PostMapping("start")
     public ResponseEntity start(String userId, String deptLeader) {
         // 设置流程发起人,流程发起人默认是从 security 框架中获取的,可以在这里设置下
@@ -94,7 +94,7 @@ public ResponseEntity start(String userId, String deptLeader) {
      *
      * @param taskId 任务ID
      */
-    @ApiOperation("继续流转,通过或拒绝")
+    @Operation(summary = "继续流转,通过或拒绝")
     @PostMapping(value = "apply")
     public ResponseEntity apply(String taskId, Integer acceptType, String deptMgr) {
         Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
@@ -111,7 +111,7 @@ public ResponseEntity apply(String taskId, Integer acceptType, String deptMgr) {
     }
 
 
-    @ApiOperation("查询指定用户的待办事项")
+    @Operation(summary = "查询指定用户的待办事项")
     @GetMapping(value = "/listTodo")
     public ResponseEntity> listTodo(String userId){
 
@@ -127,7 +127,7 @@ public ResponseEntity> listTodo(String userId){
         return ResponseEntity.ok(voList);
     }
 
-    @ApiOperation("查询指定用户的已办事项")
+    @Operation(summary = "查询指定用户的已办事项")
     @GetMapping(value = "/listDone")
     public ResponseEntity> listDone(String userId){
 
@@ -157,7 +157,7 @@ public ResponseEntity> listDone(String userId){
         return ResponseEntity.ok(taskInstanceList);
     }
 
-    @ApiOperation("查询指定用户的发起事项")
+    @Operation(summary = "查询指定用户的发起事项")
     @GetMapping(value = "/listCreated")
     public ResponseEntity> listCreated(String userId){
 
diff --git a/kbase-stack-minio/src/main/java/com/ibothub/heap/minio/web/controller/MinioController.java b/kbase-stack-minio/src/main/java/com/ibothub/heap/minio/web/controller/MinioController.java
index 2fd609c..a252227 100644
--- a/kbase-stack-minio/src/main/java/com/ibothub/heap/minio/web/controller/MinioController.java
+++ b/kbase-stack-minio/src/main/java/com/ibothub/heap/minio/web/controller/MinioController.java
@@ -2,8 +2,8 @@
 
 import com.ibothub.heap.base.model.vo.ResponseEntity;
 import com.ibothub.heap.minio.service.MinioService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Operation;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 import software.amazon.awssdk.services.s3.model.Bucket;
@@ -17,7 +17,7 @@
  * @version v1.0
  * @date 2022/6/11 14:28
  */
-@Api(tags = "Minio Restful Api")
+@Tag(name = "Minio Restful Api")
 @RestController
 @RequestMapping("api")
 public class MinioController {
@@ -25,28 +25,28 @@ public class MinioController {
     @Resource
     MinioService minioService;
 
-    @ApiOperation("创建bucket")
+    @Operation(summary = "创建bucket")
     @PostMapping("bucket")
     public ResponseEntity createBucket(String bucketName){
         minioService.createBucket(bucketName);
         return ResponseEntity.ok();
     }
 
-    @ApiOperation("删除bucket")
+    @Operation(summary = "删除bucket")
     @DeleteMapping("bucket")
     public ResponseEntity deleteBucket(String bucketName){
         minioService.deleteBucket(bucketName);
         return ResponseEntity.ok();
     }
 
-    @ApiOperation("上传文件")
+    @Operation(summary = "上传文件")
     @PostMapping("upload")
     public ResponseEntity> upload(String bucketName, MultipartFile file) throws IOException {
         minioService.upload(bucketName, file);
         return ResponseEntity.ok();
     }
 
-    @ApiOperation("下载文件")
+    @Operation(summary = "下载文件")
     @GetMapping("download")
     public org.springframework.http.ResponseEntity upload(String bucketName, String key) throws IOException {
         return minioService.download(bucketName, key);
diff --git a/kbase-stack-screw/src/main/java/com/ibothub/heap/screw/web/controller/ScrewController.java b/kbase-stack-screw/src/main/java/com/ibothub/heap/screw/web/controller/ScrewController.java
index e884eea..8dcf3cf 100644
--- a/kbase-stack-screw/src/main/java/com/ibothub/heap/screw/web/controller/ScrewController.java
+++ b/kbase-stack-screw/src/main/java/com/ibothub/heap/screw/web/controller/ScrewController.java
@@ -3,7 +3,7 @@
 import com.ibothub.heap.base.model.vo.ResponseEntity;
 import com.ibothub.heap.screw.model.vo.req.DriverReq;
 import com.ibothub.heap.screw.service.ScrewService;
-import io.swagger.annotations.Api;
+import io.swagger.v3.oas.annotations.tags.Tag;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.io.IOUtils;
 import org.springframework.http.HttpHeaders;
@@ -22,7 +22,7 @@
  * @version v1.0
  * @date 2022/8/3 20:55
  */
-@Api
+@Tag(name = "Screw")
 @RestController
 @RequestMapping("/screw")
 @Slf4j
diff --git a/kbase-stack-shiro/kbase-stack-shiro-boot/src/main/java/com/ibothub/heap/shiro/config/SwaggerConfig.java b/kbase-stack-shiro/kbase-stack-shiro-boot/src/main/java/com/ibothub/heap/shiro/config/SwaggerConfig.java
deleted file mode 100644
index 6604443..0000000
--- a/kbase-stack-shiro/kbase-stack-shiro-boot/src/main/java/com/ibothub/heap/shiro/config/SwaggerConfig.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * powered by https://zhengxinacc.com
- */
-package com.ibothub.heap.shiro.config;
-
-import com.google.common.collect.Lists;
-import io.swagger.annotations.Api;
-import org.apache.tomcat.util.net.openssl.ciphers.Authentication;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.http.MediaType;
-import springfox.documentation.builders.ApiInfoBuilder;
-import springfox.documentation.builders.PathSelectors;
-import springfox.documentation.builders.RequestHandlerSelectors;
-import springfox.documentation.service.ApiInfo;
-import springfox.documentation.spi.DocumentationType;
-import springfox.documentation.spring.web.plugins.Docket;
-import java.util.Collections;
-import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
-
-/**
- * @author eko.zhan
- * @version v1.0
- * @date 2020/10/15 20:25
- */
-@Configuration
-@EnableSwagger2WebMvc
-public class SwaggerConfig {
-
-    @Bean
-    public Docket createRestApi() {
-        return new Docket(DocumentationType.SWAGGER_2)
-                .produces(Collections.singleton(MediaType.APPLICATION_JSON_UTF8_VALUE))
-                .consumes(Collections.singleton(MediaType.APPLICATION_JSON_UTF8_VALUE))
-                .ignoredParameterTypes(Authentication.class)
-                .useDefaultResponseMessages(false)
-                .apiInfo(apiInfo())
-                .select()
-                .apis(RequestHandlerSelectors.withClassAnnotation(Api.class))
-                .paths(PathSelectors.any())
-                .build();
-    }
-
-
-    private ApiInfo apiInfo() {
-        return new ApiInfoBuilder()
-                .title("接口文档")
-                .termsOfServiceUrl("http://ibothub.com/")
-                .version("1.0")
-                .build();
-    }
-
-}
diff --git a/kbase-stack-shiro/kbase-stack-shiro-boot/src/main/java/com/ibothub/heap/shiro/web/controller/LoginController.java b/kbase-stack-shiro/kbase-stack-shiro-boot/src/main/java/com/ibothub/heap/shiro/web/controller/LoginController.java
index 5c169ec..cfe2a6d 100644
--- a/kbase-stack-shiro/kbase-stack-shiro-boot/src/main/java/com/ibothub/heap/shiro/web/controller/LoginController.java
+++ b/kbase-stack-shiro/kbase-stack-shiro-boot/src/main/java/com/ibothub/heap/shiro/web/controller/LoginController.java
@@ -3,13 +3,11 @@
  */
 package com.ibothub.heap.shiro.web.controller;
 
-import io.swagger.annotations.Api;
+import io.swagger.v3.oas.annotations.tags.Tag;
 import org.apache.shiro.SecurityUtils;
 import org.apache.shiro.authc.IncorrectCredentialsException;
-import org.apache.shiro.authc.SimpleAuthenticationInfo;
 import org.apache.shiro.authc.UnknownAccountException;
 import org.apache.shiro.authc.UsernamePasswordToken;
-import org.apache.shiro.authz.SimpleAuthorizationInfo;
 import org.apache.shiro.subject.Subject;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -21,7 +19,7 @@
  * @version v1.0
  * @date 2020/10/15 20:45
  */
-@Api("登录")
+@Tag(name = "登录")
 @RestController
 @RequestMapping("/login")
 public class LoginController {
diff --git a/kbase-stack-shiro/kbase-stack-shiro-boot/src/main/java/com/ibothub/heap/shiro/web/controller/LogoutController.java b/kbase-stack-shiro/kbase-stack-shiro-boot/src/main/java/com/ibothub/heap/shiro/web/controller/LogoutController.java
index 4447664..8f3f77d 100644
--- a/kbase-stack-shiro/kbase-stack-shiro-boot/src/main/java/com/ibothub/heap/shiro/web/controller/LogoutController.java
+++ b/kbase-stack-shiro/kbase-stack-shiro-boot/src/main/java/com/ibothub/heap/shiro/web/controller/LogoutController.java
@@ -3,7 +3,7 @@
  */
 package com.ibothub.heap.shiro.web.controller;
 
-import io.swagger.annotations.Api;
+import io.swagger.v3.oas.annotations.tags.Tag;
 import org.apache.shiro.SecurityUtils;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -14,7 +14,7 @@
  * @version v1.0
  * @date 2020/10/15 20:45
  */
-@Api("登出")
+@Tag(name = "登出")
 @RestController
 @RequestMapping("/logout")
 public class LogoutController {
diff --git a/kbase-stack-shiro/kbase-stack-shiro-boot/src/main/java/com/ibothub/heap/shiro/web/controller/UserController.java b/kbase-stack-shiro/kbase-stack-shiro-boot/src/main/java/com/ibothub/heap/shiro/web/controller/UserController.java
index 1d1ce2a..d9d0d28 100644
--- a/kbase-stack-shiro/kbase-stack-shiro-boot/src/main/java/com/ibothub/heap/shiro/web/controller/UserController.java
+++ b/kbase-stack-shiro/kbase-stack-shiro-boot/src/main/java/com/ibothub/heap/shiro/web/controller/UserController.java
@@ -5,20 +5,23 @@
 
 import com.ibothub.heap.shiro.model.entity.User;
 import com.ibothub.heap.shiro.service.UserService;
-import io.swagger.annotations.Api;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.apache.shiro.authz.annotation.RequiresRoles;
-import org.springframework.web.bind.annotation.*;
-
+import io.swagger.v3.oas.annotations.tags.Tag;
 import jakarta.annotation.Resource;
 import java.util.List;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 /**
  * @author eko.zhan
  * @version v1.0
  * @date 2020/10/14 23:58
  */
-@Api("用户管理")
+@Tag(name = "用户管理")
 @RestController
 @RequestMapping("/user")
 public class UserController {
diff --git a/pom.xml b/pom.xml
index 7d7eaf8..300c834 100644
--- a/pom.xml
+++ b/pom.xml
@@ -58,6 +58,7 @@
         1.6.3
         1.6.3
         3.4.0
+        2.7.0
         true