From b5f708114be076b1cba1fcfa2df78e21200abe8e Mon Sep 17 00:00:00 2001 From: niudehua <657563945@qq.com> Date: Sat, 6 Mar 2021 22:47:00 +0800 Subject: [PATCH 1/3] =?UTF-8?q?knife4j=20=E7=89=88=E6=9C=AC=20=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=202.x=20=E8=A7=A3=E5=86=B3=20swagger=20=E5=86=B2?= =?UTF-8?q?=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../swagger/config/SwaggerAutoConfiguration.java | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index bab83344e..5ee4b2191 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ 2.4.2 - 3.0.2 + 2.0.8 5.1.46 1.2.4 diff --git a/src/main/java/cn/iocoder/dashboard/framework/swagger/config/SwaggerAutoConfiguration.java b/src/main/java/cn/iocoder/dashboard/framework/swagger/config/SwaggerAutoConfiguration.java index b550511af..d544c4a2a 100644 --- a/src/main/java/cn/iocoder/dashboard/framework/swagger/config/SwaggerAutoConfiguration.java +++ b/src/main/java/cn/iocoder/dashboard/framework/swagger/config/SwaggerAutoConfiguration.java @@ -10,15 +10,17 @@ import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpHeaders; import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.PathSelectors; -import springfox.documentation.service.*; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.ApiKey; +import springfox.documentation.service.AuthorizationScope; +import springfox.documentation.service.Contact; +import springfox.documentation.service.SecurityReference; +import springfox.documentation.service.SecurityScheme; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spi.service.contexts.SecurityContext; import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; -import springfox.documentation.service.ApiKey; +import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; -import java.util.ArrayList; -import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -30,7 +32,7 @@ import static springfox.documentation.builders.RequestHandlerSelectors.basePacka * @author 芋道源码 */ @Configuration -@EnableSwagger2 +@EnableSwagger2WebMvc @EnableKnife4j @ConditionalOnClass({Docket.class, ApiInfoBuilder.class}) @ConditionalOnProperty(prefix = "yudao.swagger", value = "enable", matchIfMissing = true) From 5351917b67177f3cfc338f137e3702d0166b55e6 Mon Sep 17 00:00:00 2001 From: niudehua <657563945@qq.com> Date: Sun, 7 Mar 2021 21:06:39 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=BC=95=E5=85=A5=20swagger-annotations=20?= =?UTF-8?q?1.5.22=20=E6=8E=92=E9=99=A4knife4j3.0.2=20=E4=B8=AD=20swagger-a?= =?UTF-8?q?nnotations=20=E8=A7=A3=E5=86=B3=E4=BE=9D=E8=B5=96=E5=86=B2?= =?UTF-8?q?=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 14 ++++++++++++-- .../swagger/config/SwaggerAutoConfiguration.java | 4 ++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 5ee4b2191..a601b907d 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ - 4.0.0 + 4.0.0 cn.iocoder dashboard @@ -24,7 +24,8 @@ 2.4.2 - 2.0.8 + 3.0.2 + 1.5.22 5.1.46 1.2.4 @@ -104,8 +105,17 @@ guava com.google.guava + + swagger-annotations + io.swagger + + + io.swagger + swagger-annotations + ${swagger-annotations.version} + diff --git a/src/main/java/cn/iocoder/dashboard/framework/swagger/config/SwaggerAutoConfiguration.java b/src/main/java/cn/iocoder/dashboard/framework/swagger/config/SwaggerAutoConfiguration.java index d544c4a2a..21511c37c 100644 --- a/src/main/java/cn/iocoder/dashboard/framework/swagger/config/SwaggerAutoConfiguration.java +++ b/src/main/java/cn/iocoder/dashboard/framework/swagger/config/SwaggerAutoConfiguration.java @@ -19,7 +19,7 @@ import springfox.documentation.service.SecurityScheme; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spi.service.contexts.SecurityContext; import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; +import springfox.documentation.swagger2.annotations.EnableSwagger2; import java.util.Collections; import java.util.List; @@ -32,7 +32,7 @@ import static springfox.documentation.builders.RequestHandlerSelectors.basePacka * @author 芋道源码 */ @Configuration -@EnableSwagger2WebMvc +@EnableSwagger2 @EnableKnife4j @ConditionalOnClass({Docket.class, ApiInfoBuilder.class}) @ConditionalOnProperty(prefix = "yudao.swagger", value = "enable", matchIfMissing = true) From 7b4d7f5e65d89bb872e11e765996be6252595308 Mon Sep 17 00:00:00 2001 From: niudehua <657563945@qq.com> Date: Mon, 8 Mar 2021 00:39:04 +0800 Subject: [PATCH 3/3] sort String -> Integer --- .../modules/system/controller/dept/vo/dept/SysDeptBaseVO.java | 2 +- .../modules/system/controller/dept/vo/post/SysPostBaseVO.java | 2 +- .../modules/system/controller/dept/vo/post/SysPostExcelVO.java | 2 +- .../system/controller/permission/vo/menu/SysMenuBaseVO.java | 2 +- .../system/controller/permission/vo/role/SysRoleBaseVO.java | 2 +- .../dashboard/modules/system/dal/dataobject/dept/SysDeptDO.java | 2 +- .../dashboard/modules/system/dal/dataobject/dept/SysPostDO.java | 2 +- .../modules/system/dal/dataobject/permission/SysMenuDO.java | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/dept/SysDeptBaseVO.java b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/dept/SysDeptBaseVO.java index fd40fd7de..922c395fd 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/dept/SysDeptBaseVO.java +++ b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/dept/SysDeptBaseVO.java @@ -26,7 +26,7 @@ public class SysDeptBaseVO { @ApiModelProperty(value = "显示顺序不能为空", required = true, example = "1024") @NotBlank(message = "显示顺序不能为空") - private String sort; + private Integer sort; @ApiModelProperty(value = "负责人", example = "芋道") private String leader; diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/post/SysPostBaseVO.java b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/post/SysPostBaseVO.java index 162f71387..9a7943b0f 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/post/SysPostBaseVO.java +++ b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/post/SysPostBaseVO.java @@ -25,7 +25,7 @@ public class SysPostBaseVO { @ApiModelProperty(value = "显示顺序不能为空", required = true, example = "1024") @NotBlank(message = "显示顺序不能为空") - private String sort; + private Integer sort; @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 SysCommonStatusEnum 枚举类") private Integer status; diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/post/SysPostExcelVO.java b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/post/SysPostExcelVO.java index 05ac0e962..74afa919e 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/post/SysPostExcelVO.java +++ b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/post/SysPostExcelVO.java @@ -23,7 +23,7 @@ public class SysPostExcelVO { private String name; @ExcelProperty("岗位排序") - private String sort; + private Integer sort; @ExcelProperty(value = "状态", converter = DictConvert.class) @DictFormat(SYS_COMMON_STATUS) diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/controller/permission/vo/menu/SysMenuBaseVO.java b/src/main/java/cn/iocoder/dashboard/modules/system/controller/permission/vo/menu/SysMenuBaseVO.java index 818ef8c93..5882f825c 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/system/controller/permission/vo/menu/SysMenuBaseVO.java +++ b/src/main/java/cn/iocoder/dashboard/modules/system/controller/permission/vo/menu/SysMenuBaseVO.java @@ -29,7 +29,7 @@ public class SysMenuBaseVO { @ApiModelProperty(value = "显示顺序不能为空", required = true, example = "1024") @NotBlank(message = "显示顺序不能为空") - private String sort; + private Integer sort; @ApiModelProperty(value = "父菜单 ID", required = true, example = "1024") @NotNull(message = "父菜单 ID 不能为空") diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/controller/permission/vo/role/SysRoleBaseVO.java b/src/main/java/cn/iocoder/dashboard/modules/system/controller/permission/vo/role/SysRoleBaseVO.java index 80ee8bfcd..bf9a1b141 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/system/controller/permission/vo/role/SysRoleBaseVO.java +++ b/src/main/java/cn/iocoder/dashboard/modules/system/controller/permission/vo/role/SysRoleBaseVO.java @@ -25,7 +25,7 @@ public class SysRoleBaseVO { @ApiModelProperty(value = "显示顺序不能为空", required = true, example = "1024") @NotBlank(message = "显示顺序不能为空") - private String sort; + private Integer sort; @ApiModelProperty(value = "角色类型", required = true, example = "1", notes = "见 SysRoleTypeEnum 枚举") private Integer type; diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/dal/dataobject/dept/SysDeptDO.java b/src/main/java/cn/iocoder/dashboard/modules/system/dal/dataobject/dept/SysDeptDO.java index e2218f461..e116bd3b0 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/system/dal/dataobject/dept/SysDeptDO.java +++ b/src/main/java/cn/iocoder/dashboard/modules/system/dal/dataobject/dept/SysDeptDO.java @@ -35,7 +35,7 @@ public class SysDeptDO extends BaseDO { /** * 显示顺序 */ - private String sort; + private Integer sort; /** * 负责人 */ diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/dal/dataobject/dept/SysPostDO.java b/src/main/java/cn/iocoder/dashboard/modules/system/dal/dataobject/dept/SysPostDO.java index d2eaefd3b..ba5f3e0ad 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/system/dal/dataobject/dept/SysPostDO.java +++ b/src/main/java/cn/iocoder/dashboard/modules/system/dal/dataobject/dept/SysPostDO.java @@ -34,7 +34,7 @@ public class SysPostDO extends BaseDO { /** * 岗位排序 */ - private String sort; + private Integer sort; /** * 状态 * diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/dal/dataobject/permission/SysMenuDO.java b/src/main/java/cn/iocoder/dashboard/modules/system/dal/dataobject/permission/SysMenuDO.java index ee8f302dd..82956e9f9 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/system/dal/dataobject/permission/SysMenuDO.java +++ b/src/main/java/cn/iocoder/dashboard/modules/system/dal/dataobject/permission/SysMenuDO.java @@ -49,7 +49,7 @@ public class SysMenuDO extends BaseDO { /** * 显示顺序 */ - private String sort; + private Integer sort; /** * 父菜单ID */