diff --git a/yudao-dependencies/pom.xml b/yudao-dependencies/pom.xml index d117b58bb..66f6abaa9 100644 --- a/yudao-dependencies/pom.xml +++ b/yudao-dependencies/pom.xml @@ -23,6 +23,7 @@ 4.0.0 1.6.8 2.5 + 1.6.14 1.2.15 3.5.3.1 @@ -197,27 +198,13 @@ com.github.xiaoymin - knife4j-openapi2-spring-boot-starter + knife4j-openapi3-spring-boot-starter ${knife4j.version} - - - mapstruct - org.mapstruct - - - guava - com.google.guava - - - swagger-annotations - io.swagger - - - io.swagger - swagger-annotations - ${swagger-annotations.version} + org.springdoc + springdoc-openapi-ui + ${springdoc.version} diff --git a/yudao-framework/yudao-common/pom.xml b/yudao-framework/yudao-common/pom.xml index 45a0331dc..77638edd6 100644 --- a/yudao-framework/yudao-common/pom.xml +++ b/yudao-framework/yudao-common/pom.xml @@ -59,8 +59,8 @@ - io.swagger - swagger-annotations + org.springdoc + springdoc-openapi-ui provided diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/PageParam.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/PageParam.java index 80029703b..72708f8c7 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/PageParam.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/PageParam.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.framework.common.pojo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.Min; @@ -9,19 +8,19 @@ import javax.validation.constraints.Max; import javax.validation.constraints.NotNull; import java.io.Serializable; -@ApiModel("分页参数") +@Schema(description = "分页参数") @Data public class PageParam implements Serializable { private static final Integer PAGE_NO = 1; private static final Integer PAGE_SIZE = 10; - @ApiModelProperty(value = "页码,从 1 开始", required = true,example = "1") + @Schema(description = "页码,从 1 开始", required = true, example = "1") @NotNull(message = "页码不能为空") @Min(value = 1, message = "页码最小值为 1") private Integer pageNo = PAGE_NO; - @ApiModelProperty(value = "每页条数,最大值为 100", required = true, example = "10") + @Schema(description = "每页条数,最大值为 100", required = true, example = "10") @NotNull(message = "每页条数不能为空") @Min(value = 1, message = "每页条数最小值为 1") @Max(value = 100, message = "每页条数最大值为 100") diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/PageResult.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/PageResult.java index dbdeb85ba..ff167d149 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/PageResult.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/PageResult.java @@ -1,21 +1,20 @@ package cn.iocoder.yudao.framework.common.pojo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.io.Serializable; import java.util.ArrayList; import java.util.List; -@ApiModel("分页结果") +@Schema(description = "分页结果") @Data public final class PageResult implements Serializable { - @ApiModelProperty(value = "数据", required = true) + @Schema(description = "数据", required = true) private List list; - @ApiModelProperty(value = "总量", required = true) + @Schema(description = "总量", required = true) private Long total; public PageResult() { diff --git a/yudao-framework/yudao-spring-boot-starter-web/pom.xml b/yudao-framework/yudao-spring-boot-starter-web/pom.xml index 790dc5ebd..91a1d7c56 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/pom.xml +++ b/yudao-framework/yudao-spring-boot-starter-web/pom.xml @@ -35,11 +35,11 @@ com.github.xiaoymin - knife4j-openapi2-spring-boot-starter + knife4j-openapi3-spring-boot-starter - io.swagger - swagger-annotations + org.springdoc + springdoc-openapi-ui diff --git a/yudao-gateway/pom.xml b/yudao-gateway/pom.xml index a0a03fd6d..a2e13af96 100644 --- a/yudao-gateway/pom.xml +++ b/yudao-gateway/pom.xml @@ -46,11 +46,11 @@ com.github.xiaoymin - knife4j-openapi2-spring-boot-starter + knife4j-openapi3-spring-boot-starter - io.swagger - swagger-annotations + org.springdoc + springdoc-openapi-ui diff --git a/yudao-module-infra/yudao-module-infra-api/pom.xml b/yudao-module-infra/yudao-module-infra-api/pom.xml index 003b7d7f0..86fcbd037 100644 --- a/yudao-module-infra/yudao-module-infra-api/pom.xml +++ b/yudao-module-infra/yudao-module-infra-api/pom.xml @@ -24,9 +24,12 @@ - io.swagger - swagger-annotations - true + com.github.xiaoymin + knife4j-openapi3-spring-boot-starter + + + org.springdoc + springdoc-openapi-ui diff --git a/yudao-module-system/yudao-module-system-api/pom.xml b/yudao-module-system/yudao-module-system-api/pom.xml index f125b277e..fafb194c0 100644 --- a/yudao-module-system/yudao-module-system-api/pom.xml +++ b/yudao-module-system/yudao-module-system-api/pom.xml @@ -24,9 +24,12 @@ - io.swagger - swagger-annotations - true + com.github.xiaoymin + knife4j-openapi3-spring-boot-starter + + + org.springdoc + springdoc-openapi-ui diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApi.java index b9e417541..affa89ea1 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApi.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApi.java @@ -4,9 +4,9 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO; import cn.iocoder.yudao.module.system.enums.ApiConstants; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -17,24 +17,24 @@ import java.util.Map; import java.util.Set; @FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory = -@Api(tags = "RPC 服务 - 部门") +@Tag(name = "RPC 服务 - 部门") public interface DeptApi { String PREFIX = ApiConstants.PREFIX + "/dept"; @GetMapping(PREFIX + "/get") - @ApiOperation("获得部门信息") - @ApiImplicitParam(name = "id", value = "部门编号", example = "1024", required = true, dataTypeClass = Long.class) + @Operation(summary = "获得部门信息") + @Parameter(name = "id", description = "部门编号", example = "1024", required = true) CommonResult getDept(@RequestParam("id") Long id); @GetMapping(PREFIX + "/list") - @ApiOperation("获得部门信息数组") - @ApiImplicitParam(name = "ids", value = "部门编号数组", example = "1,2", required = true, allowMultiple = true) + @Operation(summary = "获得部门信息数组") + @Parameter(name = "ids", description = "部门编号数组", example = "1,2", required = true) CommonResult> getDeptList(@RequestParam("ids") Collection ids); @GetMapping(PREFIX + "/valid") - @ApiOperation("校验部门是否合法") - @ApiImplicitParam(name = "ids", value = "部门编号数组", example = "1,2", required = true, allowMultiple = true) + @Operation(summary = "校验部门是否合法") + @Parameter(name = "ids", description = "部门编号数组", example = "1,2", required = true) CommonResult validateDeptList(@RequestParam("ids") Collection ids); /** diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/PostApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/PostApi.java index 1cd8fc71c..73d3d38a9 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/PostApi.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/PostApi.java @@ -2,9 +2,9 @@ package cn.iocoder.yudao.module.system.api.dept; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.module.system.enums.ApiConstants; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -12,14 +12,14 @@ import org.springframework.web.bind.annotation.RequestParam; import java.util.Collection; @FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory = -@Api(tags = "RPC 服务 - 岗位") +@Tag(name = "RPC 服务 - 岗位") public interface PostApi { String PREFIX = ApiConstants.PREFIX + "/post"; @GetMapping(PREFIX + "/valid") - @ApiOperation("校验岗位是否合法") - @ApiImplicitParam(name = "ids", value = "岗位编号数组", example = "1,2", required = true, allowMultiple = true) + @Operation(summary = "校验岗位是否合法") + @Parameter(name = "ids", description = "岗位编号数组", example = "1,2", required = true) CommonResult validPostList(@RequestParam("ids") Collection ids); } diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/DictDataApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/DictDataApi.java index 0b53c3137..82069db63 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/DictDataApi.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/DictDataApi.java @@ -3,10 +3,6 @@ package cn.iocoder.yudao.module.system.api.dict; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.module.system.api.dict.dto.DictDataRespDTO; import cn.iocoder.yudao.module.system.enums.ApiConstants; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam;