chore(deps): Swagger springfox → Springdoc OpenAPI 1.8.0
迁移内容: - 移除 springfox-boot-starter:3.0.0 (已停维, 与 Spring Boot 2.7 不兼容) - 新增 springdoc-openapi-ui:1.8.0 (OpenAPI 3.0, 兼容 Spring Boot 2.7) - 重写 SwaggerConfig.java → 使用 OpenAPI bean + SecurityScheme - 移除 ResourcesConfig 中 springfox-swagger-ui 资源映射 - 移除 ISchedulePoolService 中未使用的 io.swagger.models.auth.In import - application.yml: springfox 配置 → springdoc 配置 验证结果: - ✅ Swagger UI 页面 HTTP 200 - ✅ OpenAPI JSON 正常 (1373 个 API) - ✅ 登录/分页/路由接口正常 - ✅ 71 个 @ApiOperation 注解兼容无需修改
This commit is contained in:
@@ -6,7 +6,6 @@ import com.core.framework.interceptor.RepeatSubmitInterceptor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.CacheControl;
|
||||
import org.springframework.web.cors.CorsConfiguration;
|
||||
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
||||
import org.springframework.web.filter.CorsFilter;
|
||||
@@ -14,7 +13,6 @@ import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 通用配置
|
||||
@@ -32,10 +30,7 @@ public class ResourcesConfig implements WebMvcConfigurer {
|
||||
registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**")
|
||||
.addResourceLocations("file:" + CoreConfig.getProfile() + "/");
|
||||
|
||||
/** swagger配置 */
|
||||
registry.addResourceHandler("/swagger-ui/**")
|
||||
.addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/")
|
||||
.setCacheControl(CacheControl.maxAge(5, TimeUnit.HOURS).cachePublic());
|
||||
/** springdoc UI 由 springdoc-openapi 自动提供,无需手动配置 */
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user