Parcourir la source

fix: swagger版本 aspectJ版本冲突

swagger版本降为2.5
370774330@qq.com il y a 5 ans
Parent
commit
73866b7027

+ 12 - 3
web/pom.xml

@@ -24,12 +24,21 @@
     <dependencies>
     <dependencies>
         <!-- Swagger -->
         <!-- Swagger -->
         <!-- https://mvnrepository.com/artifact/io.springfox/springfox-boot-starter -->
         <!-- https://mvnrepository.com/artifact/io.springfox/springfox-boot-starter -->
+<!--        <dependency>-->
+<!--            <groupId>io.springfox</groupId>-->
+<!--            <artifactId>springfox-boot-starter</artifactId>-->
+<!--            <version>3.0.0</version>-->
+<!--        </dependency>-->
         <dependency>
         <dependency>
             <groupId>io.springfox</groupId>
             <groupId>io.springfox</groupId>
-            <artifactId>springfox-boot-starter</artifactId>
-            <version>3.0.0</version>
+            <artifactId>springfox-swagger2</artifactId>
+            <version>2.5.0</version>
+        </dependency>
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger-ui</artifactId>
+            <version>2.5.0</version>
         </dependency>
         </dependency>
-
         <!-- END Swagger -->
         <!-- END Swagger -->
         <dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <groupId>org.springframework.boot</groupId>

+ 35 - 35
web/src/main/java/seecoder/devcloud/web/controller/gitlab/HookController.java

@@ -1,35 +1,35 @@
-//package seecoder.devcloud.web.controller.gitlab;
-//
-//import io.swagger.annotations.Api;
-//import io.swagger.annotations.ApiImplicitParam;
-//import io.swagger.annotations.ApiOperation;
-//import org.springframework.web.bind.annotation.PostMapping;
-//import org.springframework.web.bind.annotation.RequestBody;
-//import org.springframework.web.bind.annotation.RequestMapping;
-//import org.springframework.web.bind.annotation.RestController;
-//import seecoder.devcloud.web.model.vo.GitWebHookVO;
-//
-///**
-// * @author chenyz
-// * @date 2021/2/4
-// * @description: 与GitLab进行交互的接口
-// */
-//@Api(tags = "GitLab Hook API")
-//@RestController
-//@RequestMapping("/hook")
-//public class HookController {
-//
-//    /**
-//     * @author chenyz
-//     * @date 2021/2/4
-//     * @description: 此接口挂载在webhooks的push回调中
-//     */
-//    @ApiOperation(value = "push回调接口", httpMethod = "POST")
-//    @PostMapping("/push")
-//    @ApiImplicitParam(value = "gitWebHookVO",dataTypeClass = GitWebHookVO.class, paramType = "body")
-//    public void pushHook(@RequestBody GitWebHookVO gitWebHookVO)
-//    {
-//        System.out.println(gitWebHookVO);
-//        // todo:提取commit信息并进行处理
-//    }
-//}
+package seecoder.devcloud.web.controller.gitlab;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import seecoder.devcloud.web.model.vo.GitWebHookVO;
+
+/**
+ * @author chenyz
+ * @date 2021/2/4
+ * @description: 与GitLab进行交互的接口
+ */
+@Api(tags = "GitLab Hook API")
+@RestController
+@RequestMapping("/hook")
+public class HookController {
+
+    /**
+     * @author chenyz
+     * @date 2021/2/4
+     * @description: 此接口挂载在webhooks的push回调中
+     */
+    @ApiOperation(value = "push回调接口", httpMethod = "POST")
+    @PostMapping("/push")
+    @ApiImplicitParam(value = "gitWebHookVO",dataType = "object", paramType = "body")
+    public void pushHook(@RequestBody GitWebHookVO gitWebHookVO)
+    {
+        System.out.println(gitWebHookVO);
+        // todo:提取commit信息并进行处理
+    }
+}

+ 5 - 5
web/src/main/java/seecoder/devcloud/web/controller/pipeline/DeploymentController.java

@@ -30,7 +30,7 @@ public class DeploymentController {
     }
     }
 
 
     @ApiOperation(value = "获取项目所有部署的实例信息", httpMethod = "GET")
     @ApiOperation(value = "获取项目所有部署的实例信息", httpMethod = "GET")
-    @ApiImplicitParam(name = "projectId", dataTypeClass = Integer.class, paramType = "query")
+    @ApiImplicitParam(name = "projectId", dataType ="int", paramType = "query")
     @GetMapping("/list")
     @GetMapping("/list")
     public Response<List<DeploymentInfoVO>> retrieveDeploymentInfos(@RequestParam("projectId")Integer projectId){
     public Response<List<DeploymentInfoVO>> retrieveDeploymentInfos(@RequestParam("projectId")Integer projectId){
         return Response.buildSuccess(deploymentService.retrieveDeploymentInfos(projectId));
         return Response.buildSuccess(deploymentService.retrieveDeploymentInfos(projectId));
@@ -39,8 +39,8 @@ public class DeploymentController {
 
 
     @ApiOperation(value = "执行流水线构建实例", httpMethod = "POST")
     @ApiOperation(value = "执行流水线构建实例", httpMethod = "POST")
     @ApiImplicitParams({
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "projectId", dataTypeClass = Integer.class,paramType = "query"),
-            @ApiImplicitParam(name = "pipelineId", dataTypeClass = Integer.class,paramType = "query")
+            @ApiImplicitParam(name = "projectId", dataType ="int",paramType = "query"),
+            @ApiImplicitParam(name = "pipelineId", dataType ="int",paramType = "query")
     })
     })
     @PostMapping
     @PostMapping
     public Response deploy(@RequestParam("projectId")Integer projectId,
     public Response deploy(@RequestParam("projectId")Integer projectId,
@@ -51,8 +51,8 @@ public class DeploymentController {
 
 
     @ApiOperation(value = "删除一个部署的实例", httpMethod = "DELETE")
     @ApiOperation(value = "删除一个部署的实例", httpMethod = "DELETE")
     @ApiImplicitParams({
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "projectId", dataTypeClass = Integer.class,paramType = "query"),
-            @ApiImplicitParam(name = "pipelineId", dataTypeClass = Integer.class,paramType = "query")
+            @ApiImplicitParam(name = "projectId", dataType ="int",paramType = "query"),
+            @ApiImplicitParam(name = "pipelineId", dataType ="int",paramType = "query")
     })
     })
     @DeleteMapping
     @DeleteMapping
     public Response delete(@RequestParam("projectId")Integer projectId,
     public Response delete(@RequestParam("projectId")Integer projectId,

+ 11 - 11
web/src/main/java/seecoder/devcloud/web/controller/pipeline/PipelineController.java

@@ -37,7 +37,7 @@ public class PipelineController {
 
 
     @GetMapping("/list")
     @GetMapping("/list")
     @ApiOperation(value = "获取指定项目的所有流水线基本信息", httpMethod = "GET")
     @ApiOperation(value = "获取指定项目的所有流水线基本信息", httpMethod = "GET")
-    @ApiImplicitParam(name = "projectId", dataTypeClass = Integer.class,paramType = "query")
+    @ApiImplicitParam(name = "projectId", dataType ="int",paramType = "query")
     public Response<List<PipelineInfoVO>> retrievePipelineInfos(@RequestParam("projectId") Integer projectId){
     public Response<List<PipelineInfoVO>> retrievePipelineInfos(@RequestParam("projectId") Integer projectId){
         return Response.buildSuccess(pipelineService.retrievePipelineInfos(projectId));
         return Response.buildSuccess(pipelineService.retrievePipelineInfos(projectId));
     }
     }
@@ -45,8 +45,8 @@ public class PipelineController {
     @GetMapping
     @GetMapping
     @ApiOperation(value = "获取指定一条流水线的配置json信息", httpMethod = "GET")
     @ApiOperation(value = "获取指定一条流水线的配置json信息", httpMethod = "GET")
     @ApiImplicitParams({
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "projectId", dataTypeClass = Integer.class,paramType = "query"),
-            @ApiImplicitParam(name = "pipelineId", dataTypeClass = Integer.class,paramType = "query")
+            @ApiImplicitParam(name = "projectId", dataType ="int",paramType = "query"),
+            @ApiImplicitParam(name = "pipelineId", dataType ="int",paramType = "query")
     })
     })
     public Response<PipelineConfigVO> retrievePipelineConfig(@RequestParam("projectId")Integer projectId,
     public Response<PipelineConfigVO> retrievePipelineConfig(@RequestParam("projectId")Integer projectId,
                                                              @RequestParam("pipelineId")Integer pipelineId){
                                                              @RequestParam("pipelineId")Integer pipelineId){
@@ -57,8 +57,8 @@ public class PipelineController {
     @GetMapping("/history/list")
     @GetMapping("/history/list")
     @ApiOperation(value = "获取指定一条流水线的历史构建信息列表", httpMethod = "GET")
     @ApiOperation(value = "获取指定一条流水线的历史构建信息列表", httpMethod = "GET")
     @ApiImplicitParams({
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "projectId", dataTypeClass = Integer.class,paramType = "query"),
-            @ApiImplicitParam(name = "pipelineId", dataTypeClass = Integer.class,paramType = "query")
+            @ApiImplicitParam(name = "projectId", dataType ="int",paramType = "query"),
+            @ApiImplicitParam(name = "pipelineId", dataType ="int",paramType = "query")
     })
     })
     public Response<List<PipelineHistoryVO>> retrievePipelineHistory(@RequestParam("projectId")Integer projectId,
     public Response<List<PipelineHistoryVO>> retrievePipelineHistory(@RequestParam("projectId")Integer projectId,
                                                                      @RequestParam("pipelineId")Integer pipelineId){
                                                                      @RequestParam("pipelineId")Integer pipelineId){
@@ -67,7 +67,7 @@ public class PipelineController {
 
 
 
 
     @ApiOperation(value = "依据模板创建一个流水线配置", httpMethod = "POST")
     @ApiOperation(value = "依据模板创建一个流水线配置", httpMethod = "POST")
-    @ApiImplicitParam(name = "pipelineCreateVO", value = "流水线创建配置信息",dataTypeClass = PipelineCreateVO.class,paramType = "body")
+    @ApiImplicitParam(name = "pipelineCreateVO", value = "流水线创建配置信息",dataType = "object",paramType = "body")
     @PostMapping
     @PostMapping
     public Response createPipelineConfig(@RequestBody PipelineCreateVO pipelineCreateVO){
     public Response createPipelineConfig(@RequestBody PipelineCreateVO pipelineCreateVO){
         pipelineService.createPipelineConfig(pipelineCreateVO);
         pipelineService.createPipelineConfig(pipelineCreateVO);
@@ -77,9 +77,9 @@ public class PipelineController {
     @PutMapping("/config")
     @PutMapping("/config")
     @ApiOperation(value = "保存修改一条流水线的json配置信息", httpMethod = "PUT")
     @ApiOperation(value = "保存修改一条流水线的json配置信息", httpMethod = "PUT")
     @ApiImplicitParams({
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "projectId", dataTypeClass = Integer.class,paramType = "query"),
-            @ApiImplicitParam(name = "pipelineId", dataTypeClass = Integer.class,paramType = "query"),
-            @ApiImplicitParam(name = "configJson", dataTypeClass = String.class,paramType = "query")
+            @ApiImplicitParam(name = "projectId", dataType ="int",paramType = "query"),
+            @ApiImplicitParam(name = "pipelineId", dataType ="int",paramType = "query"),
+            @ApiImplicitParam(name = "configJson", dataType = "string",paramType = "query")
     })
     })
     public Response savePipelineConfig(@RequestParam("projectId")Integer projectId,
     public Response savePipelineConfig(@RequestParam("projectId")Integer projectId,
                                        @RequestParam("pipelineId")Integer pipelineId,
                                        @RequestParam("pipelineId")Integer pipelineId,
@@ -91,8 +91,8 @@ public class PipelineController {
 
 
     @ApiOperation(value = "删除一条流水线", httpMethod = "DELETE")
     @ApiOperation(value = "删除一条流水线", httpMethod = "DELETE")
     @ApiImplicitParams({
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "projectId", dataTypeClass = Integer.class,paramType = "query"),
-            @ApiImplicitParam(name = "pipelineId", dataTypeClass = Integer.class,paramType = "query"),
+            @ApiImplicitParam(name = "projectId", dataType ="int",paramType = "query"),
+            @ApiImplicitParam(name = "pipelineId", dataType ="int",paramType = "query"),
     })
     })
     @DeleteMapping
     @DeleteMapping
     public Response deletePipelineInfo(Integer projectId,Integer pipelineId){
     public Response deletePipelineInfo(Integer projectId,Integer pipelineId){

+ 5 - 5
web/src/main/java/seecoder/devcloud/web/controller/project/ProjectController.java

@@ -27,35 +27,35 @@ public class ProjectController {
 
 
     @ApiOperation(value = "根据group获取Project列表", httpMethod = "GET")
     @ApiOperation(value = "根据group获取Project列表", httpMethod = "GET")
     @GetMapping("/listByGroup/{groupId}")
     @GetMapping("/listByGroup/{groupId}")
-    @ApiImplicitParam(value = "groupId",dataTypeClass = Integer.class, paramType = "path")
+    @ApiImplicitParam(value = "groupId",dataType ="int", paramType = "path")
     public Response<List<ProjectVO>> listProjectsByGroupId(@PathVariable("groupId")int groupId){
     public Response<List<ProjectVO>> listProjectsByGroupId(@PathVariable("groupId")int groupId){
         return Response.buildSuccess(projectService.listProjectsByGroupId(groupId));
         return Response.buildSuccess(projectService.listProjectsByGroupId(groupId));
     }
     }
 
 
     @ApiOperation(value = "根据user获取Project列表", httpMethod = "GET")
     @ApiOperation(value = "根据user获取Project列表", httpMethod = "GET")
     @GetMapping("/listByUser/{userId}")
     @GetMapping("/listByUser/{userId}")
-    @ApiImplicitParam(value = "userId",dataTypeClass = Integer.class, paramType = "path")
+    @ApiImplicitParam(value = "userId",dataType ="int", paramType = "path")
     public Response<List<ProjectVO>> listProjectsByUserId(@PathVariable("userId")int userId){
     public Response<List<ProjectVO>> listProjectsByUserId(@PathVariable("userId")int userId){
         return Response.buildSuccess(projectService.listProjectsByUserId(userId));
         return Response.buildSuccess(projectService.listProjectsByUserId(userId));
     }
     }
 
 
     @ApiOperation(value = "根据projectId获取Project", httpMethod = "GET")
     @ApiOperation(value = "根据projectId获取Project", httpMethod = "GET")
     @GetMapping("/{projectId}")
     @GetMapping("/{projectId}")
-    @ApiImplicitParam(value = "projectId",dataTypeClass = Integer.class, paramType = "path")
+    @ApiImplicitParam(value = "projectId",dataType ="int", paramType = "path")
     public Response<ProjectVO> getProjectById(@PathVariable("projectId")int projectId){
     public Response<ProjectVO> getProjectById(@PathVariable("projectId")int projectId){
         return Response.buildSuccess(projectService.getProjectById(projectId));
         return Response.buildSuccess(projectService.getProjectById(projectId));
     }
     }
 
 
     @ApiOperation(value = "创建项目,传入的参数中不必带有效的projectId字段,返回一个创建后的结果,注入id", httpMethod = "POST")
     @ApiOperation(value = "创建项目,传入的参数中不必带有效的projectId字段,返回一个创建后的结果,注入id", httpMethod = "POST")
     @PostMapping("/create")
     @PostMapping("/create")
-    @ApiImplicitParam(value = "project",dataTypeClass = ProjectVO.class, paramType = "body")
+    @ApiImplicitParam(value = "project",dataType = "object", paramType = "body")
     public Response<ProjectVO> createProject(@RequestBody ProjectVO project){
     public Response<ProjectVO> createProject(@RequestBody ProjectVO project){
         return Response.buildSuccess(projectService.createProject(project));
         return Response.buildSuccess(projectService.createProject(project));
     }
     }
 
 
     @ApiOperation(value = "根据projectId删除项目", httpMethod = "DELETE")
     @ApiOperation(value = "根据projectId删除项目", httpMethod = "DELETE")
     @DeleteMapping("/delete/{projectId}")
     @DeleteMapping("/delete/{projectId}")
-    @ApiImplicitParam(value = "projectId",dataTypeClass = Integer.class, paramType = "path")
+    @ApiImplicitParam(value = "projectId",dataType ="int", paramType = "path")
     public Response deleteProject(@PathVariable("projectId")int projectId){
     public Response deleteProject(@PathVariable("projectId")int projectId){
         projectService.deleteProject(projectId);
         projectService.deleteProject(projectId);
         return Response.buildSuccess();
         return Response.buildSuccess();

+ 7 - 6
web/src/main/java/seecoder/devcloud/web/controller/tree/TreeNodesController.java

@@ -19,7 +19,7 @@ import java.util.List;
  * @Author cyz,xzh
  * @Author cyz,xzh
  * @Description 需求树相关操作
  * @Description 需求树相关操作
  */
  */
-@Api("需求相关API")
+@Api(tags = "需求相关API")
 @RestController
 @RestController
 @RequestMapping("/tree")
 @RequestMapping("/tree")
 public class TreeNodesController {
 public class TreeNodesController {
@@ -39,35 +39,36 @@ public class TreeNodesController {
      */
      */
     @ApiOperation(value = "获取project_id对应的所有nodes",httpMethod = "GET")
     @ApiOperation(value = "获取project_id对应的所有nodes",httpMethod = "GET")
     @GetMapping("/{projectId}")
     @GetMapping("/{projectId}")
-    @ApiImplicitParam(value = "projectId", dataTypeClass = Integer.class, paramType = "path")
+    @ApiImplicitParam(value = "projectId", dataType ="int", paramType = "path")
     public Response<List<TreeNodeVO>> listTreeNodesByProjectId(@PathVariable("projectId") int projectId){
     public Response<List<TreeNodeVO>> listTreeNodesByProjectId(@PathVariable("projectId") int projectId){
         return Response.buildSuccess(treeNodeService.listTreeNodesByProjectId(projectId));
         return Response.buildSuccess(treeNodeService.listTreeNodesByProjectId(projectId));
     }
     }
 
 
     @ApiOperation(value = "插入节点", httpMethod = "POST")
     @ApiOperation(value = "插入节点", httpMethod = "POST")
+    @ApiImplicitParam(value = "treeNodeVO",dataType ="object", paramType = "body")
     @PostMapping("/node")
     @PostMapping("/node")
-    public Response insertTreeNode(TreeNodeVO treeNodeVO){
+    public Response insertTreeNode(@RequestBody TreeNodeVO treeNodeVO){
         treeNodeService.insertTreeNode(treeNodeVO);
         treeNodeService.insertTreeNode(treeNodeVO);
         return Response.buildSuccess();
         return Response.buildSuccess();
     }
     }
 
 
     @ApiOperation(value = "根据nodeId删除节点", httpMethod = "DELETE")
     @ApiOperation(value = "根据nodeId删除节点", httpMethod = "DELETE")
     @DeleteMapping("/node/{nodeId}")
     @DeleteMapping("/node/{nodeId}")
-    @ApiImplicitParam(value = "nodeId",dataTypeClass = Integer.class, paramType = "path")
+    @ApiImplicitParam(value = "nodeId",dataType ="int", paramType = "path")
     public Response deleteTreeNode(@PathVariable("nodeId") int nodeId) {
     public Response deleteTreeNode(@PathVariable("nodeId") int nodeId) {
         treeNodeService.deleteTreeNode(nodeId);
         treeNodeService.deleteTreeNode(nodeId);
         return Response.buildSuccess();
         return Response.buildSuccess();
     }
     }
     @ApiOperation(value = "根据父节点fatherId创建一个子节点并返回", httpMethod = "POST")
     @ApiOperation(value = "根据父节点fatherId创建一个子节点并返回", httpMethod = "POST")
     @PostMapping("/subNode/{fatherId}")
     @PostMapping("/subNode/{fatherId}")
-    @ApiImplicitParam(value = "fatherId",dataTypeClass = Integer.class, paramType = "path")
+    @ApiImplicitParam(value = "fatherId",dataType ="int", paramType = "path")
     public Response insertTreeNodeByFatherNode(@PathVariable("fatherId") int fatherId){
     public Response insertTreeNodeByFatherNode(@PathVariable("fatherId") int fatherId){
         return Response.buildSuccess(treeNodeService.insertTreeNodeByFatherNode(fatherId));
         return Response.buildSuccess(treeNodeService.insertTreeNodeByFatherNode(fatherId));
     }
     }
 
 
     @ApiOperation(value = "修改节点属性", httpMethod = "PUT")
     @ApiOperation(value = "修改节点属性", httpMethod = "PUT")
     @PutMapping("/node")
     @PutMapping("/node")
-    @ApiImplicitParam(value = "treeNodeVO",dataTypeClass = TreeNodeVO.class, paramType = "body")
+    @ApiImplicitParam(value = "treeNodeVO",dataType = "object", paramType = "body")
     public Response updateTreeNode(@RequestBody TreeNodeVO treeNodeVO){
     public Response updateTreeNode(@RequestBody TreeNodeVO treeNodeVO){
         treeNodeService.updateTreeNode(treeNodeVO);
         treeNodeService.updateTreeNode(treeNodeVO);
         return Response.buildSuccess();
         return Response.buildSuccess();

+ 6 - 2
web/src/main/java/seecoder/devcloud/web/controller/user/UserController.java

@@ -1,5 +1,7 @@
 package seecoder.devcloud.web.controller.user;
 package seecoder.devcloud.web.controller.user;
 
 
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 import seecoder.devcloud.web.model.po.user.User;
 import seecoder.devcloud.web.model.po.user.User;
@@ -14,6 +16,7 @@ import seecoder.devcloud.web.service.user.UserService;
  */
  */
 @RestController
 @RestController
 @RequestMapping("/users")
 @RequestMapping("/users")
+@Api(tags = "用户 api")
 public class UserController {
 public class UserController {
 
 
     private final UserService userService;
     private final UserService userService;
@@ -23,8 +26,9 @@ public class UserController {
         this.userService = userService;
         this.userService = userService;
     }
     }
 
 
-    @GetMapping
-    public Response getLoginUser(){
+    @ApiOperation(value = "获取当前登陆的用户信息", httpMethod = "GET")
+    @GetMapping("/self")
+    public Response<UserVO> getLoginUser(){
         return Response.buildSuccess(userService.getLoginUser());
         return Response.buildSuccess(userService.getLoginUser());
     }
     }
 
 

+ 5 - 9
web/src/main/java/seecoder/devcloud/web/infrastructure/config/SwaggerConfig.java

@@ -1,19 +1,15 @@
 package seecoder.devcloud.web.infrastructure.config;
 package seecoder.devcloud.web.infrastructure.config;
 
 
-import org.glassfish.jersey.internal.guava.Predicates;
-import org.springframework.beans.factory.annotation.Value;
+
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.Configuration;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-import springfox.boot.starter.autoconfigure.SpringfoxConfigurationProperties;
 import springfox.documentation.builders.ApiInfoBuilder;
 import springfox.documentation.builders.ApiInfoBuilder;
 import springfox.documentation.builders.PathSelectors;
 import springfox.documentation.builders.PathSelectors;
 import springfox.documentation.builders.RequestHandlerSelectors;
 import springfox.documentation.builders.RequestHandlerSelectors;
-import springfox.documentation.oas.annotations.EnableOpenApi;
 import springfox.documentation.service.ApiInfo;
 import springfox.documentation.service.ApiInfo;
 import springfox.documentation.spi.DocumentationType;
 import springfox.documentation.spi.DocumentationType;
 import springfox.documentation.spring.web.plugins.Docket;
 import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
 
 
 /**
 /**
  * @author PuHong Weng
  * @author PuHong Weng
@@ -21,7 +17,7 @@ import springfox.documentation.spring.web.plugins.Docket;
  * @description:
  * @description:
  */
  */
 @Configuration
 @Configuration
-@EnableOpenApi
+@EnableSwagger2
 public class SwaggerConfig{
 public class SwaggerConfig{
 
 
 
 
@@ -42,13 +38,13 @@ public class SwaggerConfig{
 
 
     @Bean
     @Bean
     public Docket restfulApi() {
     public Docket restfulApi() {
-        return new Docket(DocumentationType.OAS_30)
+        return new Docket(DocumentationType.SWAGGER_2)
                 .apiInfo(initApiInfo())
                 .apiInfo(initApiInfo())
                 .select()
                 .select()
                 //.paths(doFilteringRules())
                 //.paths(doFilteringRules())
                 //不显示错误的接口地址
                 //不显示错误的接口地址
                 .apis(RequestHandlerSelectors.basePackage("seecoder.devcloud.web.controller"))
                 .apis(RequestHandlerSelectors.basePackage("seecoder.devcloud.web.controller"))
-                .paths(Predicates.not(PathSelectors.regex("/error.*")))
+                //.paths(Predicates.not(PathSelectors.regex("/error.*")))
                 .paths(PathSelectors.any())
                 .paths(PathSelectors.any())
                 .build();
                 .build();
 
 

+ 8 - 4
web/src/main/java/seecoder/devcloud/web/model/vo/user/UserVO.java

@@ -1,6 +1,8 @@
 package seecoder.devcloud.web.model.vo.user;
 package seecoder.devcloud.web.model.vo.user;
 
 
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;
 import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import lombok.NoArgsConstructor;
@@ -13,15 +15,17 @@ import java.sql.Timestamp;
 @Data
 @Data
 @NoArgsConstructor
 @NoArgsConstructor
 @AllArgsConstructor
 @AllArgsConstructor
+@ApiModel("用户")
 public class UserVO {
 public class UserVO {
+    @ApiModelProperty("用户id")
     private Integer id;
     private Integer id;
-
+    @ApiModelProperty("用户名")
     private String username;
     private String username;
-
+    @ApiModelProperty("手机")
     private String phone;
     private String phone;
-
+    @ApiModelProperty("邮箱")
     private String email;
     private String email;
-
+    @ApiModelProperty("角色")
     private UserIdentity role;
     private UserIdentity role;
 
 
     public UserVO(User user) {
     public UserVO(User user) {