mirror of https://github.com/jeecgboot/jeecg-boot
Merge remote-tracking branch 'origin/springboot3' into springboot3_sas
commit
d0f85ccc7e
|
@ -10,6 +10,7 @@ import io.swagger.v3.oas.models.security.SecurityRequirement;
|
||||||
import io.swagger.v3.oas.models.security.SecurityScheme;
|
import io.swagger.v3.oas.models.security.SecurityScheme;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.jeecg.common.constant.CommonConstant;
|
import org.jeecg.common.constant.CommonConstant;
|
||||||
|
import org.springdoc.core.customizers.GlobalOpenApiCustomizer;
|
||||||
import org.springdoc.core.filters.GlobalOpenApiMethodFilter;
|
import org.springdoc.core.filters.GlobalOpenApiMethodFilter;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
@ -59,29 +60,29 @@ public class Swagger3Config implements WebMvcConfigurer {
|
||||||
return method -> method.isAnnotationPresent(Operation.class);
|
return method -> method.isAnnotationPresent(Operation.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO 暂时注释掉,for:【issues/8638】springboot3分支,knife4j不能正确显示文档,但是swagger-ui和v3/api-docs正常 #8638
|
@Bean
|
||||||
// @Bean
|
public GlobalOpenApiCustomizer globalOpenApiCustomizer() {
|
||||||
// public GlobalOpenApiCustomizer globalOpenApiCustomizer() {
|
return openApi -> {
|
||||||
// return openApi -> {
|
// 全局添加鉴权参数
|
||||||
// // 全局添加鉴权参数
|
if (openApi.getPaths() != null) {
|
||||||
// if (openApi.getPaths() != null) {
|
openApi.getPaths().forEach((path, pathItem) -> {
|
||||||
// openApi.getPaths().forEach((path, pathItem) -> {
|
//log.info("path: {}", path);
|
||||||
// //log.debug("path: {}", path);
|
// 检查当前路径是否在排除列表中
|
||||||
// // 检查当前路径是否在排除列表中
|
boolean isExcluded = excludedPaths.stream().anyMatch(
|
||||||
// boolean isExcluded = excludedPaths.stream().anyMatch(
|
excludedPath -> excludedPath.equals(path) || (excludedPath.endsWith("**") && path.startsWith(excludedPath.substring(0, excludedPath.length() - 2)))
|
||||||
// excludedPath -> excludedPath.equals(path) || (excludedPath.endsWith("**") && path.startsWith(excludedPath.substring(0, excludedPath.length() - 2)))
|
);
|
||||||
// );
|
|
||||||
//
|
if (!isExcluded) {
|
||||||
// if (!isExcluded) {
|
//log.info(" 接口添加默认X_ACCESS_TOKEN: {}", path);
|
||||||
// // 接口添加鉴权参数
|
// 接口添加鉴权参数
|
||||||
// pathItem.readOperations().forEach(operation ->
|
pathItem.readOperations().forEach(operation ->
|
||||||
// operation.addSecurityItem(new SecurityRequirement().addList(CommonConstant.X_ACCESS_TOKEN))
|
operation.addSecurityItem(new SecurityRequirement().addList(CommonConstant.X_ACCESS_TOKEN))
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
// };
|
};
|
||||||
// }
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public OpenAPI customOpenAPI() {
|
public OpenAPI customOpenAPI() {
|
||||||
|
@ -90,11 +91,15 @@ public class Swagger3Config implements WebMvcConfigurer {
|
||||||
.title("JeecgBoot 后台服务API接口文档")
|
.title("JeecgBoot 后台服务API接口文档")
|
||||||
.version("3.8.1")
|
.version("3.8.1")
|
||||||
.contact(new Contact().name("北京国炬信息技术有限公司").url("www.jeccg.com").email("jeecgos@163.com"))
|
.contact(new Contact().name("北京国炬信息技术有限公司").url("www.jeccg.com").email("jeecgos@163.com"))
|
||||||
.description( "后台API接口")
|
.description("后台API接口")
|
||||||
.termsOfService("NO terms of service")
|
.termsOfService("NO terms of service")
|
||||||
.license(new License().name("Apache 2.0").url("http://www.apache.org/licenses/LICENSE-2.0.html")))
|
.license(new License().name("Apache 2.0").url("http://www.apache.org/licenses/LICENSE-2.0.html")))
|
||||||
.addSecurityItem(new SecurityRequirement().addList(CommonConstant.X_ACCESS_TOKEN))
|
.addSecurityItem(new SecurityRequirement().addList(CommonConstant.X_ACCESS_TOKEN))
|
||||||
.components(new Components().addSecuritySchemes(CommonConstant.X_ACCESS_TOKEN,
|
.components(new Components().addSecuritySchemes(CommonConstant.X_ACCESS_TOKEN,
|
||||||
new SecurityScheme().name(CommonConstant.X_ACCESS_TOKEN).type(SecurityScheme.Type.HTTP)));
|
new SecurityScheme()
|
||||||
|
.name(CommonConstant.X_ACCESS_TOKEN)
|
||||||
|
.type(SecurityScheme.Type.APIKEY)
|
||||||
|
.in(SecurityScheme.In.HEADER) // 关键:指定为 header
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -151,9 +151,9 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- langChain4j vextor support -->
|
<!-- langChain4j vextor support -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>dev.langchain4j</groupId>
|
<groupId>org.jeecgframework</groupId>
|
||||||
<artifactId>langchain4j-pgvector</artifactId>
|
<artifactId>langchain4j-pgvector</artifactId>
|
||||||
<version>${langchain4j.version}</version>
|
<version>0.35.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- langChain4j Document Parser -->
|
<!-- langChain4j Document Parser -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
Loading…
Reference in New Issue