diff --git a/pig-common/pig-common-bom/pom.xml b/pig-common/pig-common-bom/pom.xml index 1fd4d3c7..b392d9dd 100644 --- a/pig-common/pig-common-bom/pom.xml +++ b/pig-common/pig-common-bom/pom.xml @@ -22,7 +22,7 @@ 1.8 1.2.83 3.0.3 - 1.8.0 + 1.6.9 2.2.0 3.5.5 4.3.0 diff --git a/pig-common/pig-common-swagger/pom.xml b/pig-common/pig-common-swagger/pom.xml index e3974c73..03b55e42 100644 --- a/pig-common/pig-common-swagger/pom.xml +++ b/pig-common/pig-common-swagger/pom.xml @@ -69,5 +69,9 @@ spring-webmvc provided + + com.pig4cloud + pig-common-core + diff --git a/pig-common/pig-common-swagger/src/main/java/com/pig4cloud/pig/common/swagger/annotation/EnablePigDoc.java b/pig-common/pig-common-swagger/src/main/java/com/pig4cloud/pig/common/swagger/annotation/EnablePigDoc.java index 1ddf61ef..a9b0de24 100644 --- a/pig-common/pig-common-swagger/src/main/java/com/pig4cloud/pig/common/swagger/annotation/EnablePigDoc.java +++ b/pig-common/pig-common-swagger/src/main/java/com/pig4cloud/pig/common/swagger/annotation/EnablePigDoc.java @@ -16,10 +16,12 @@ package com.pig4cloud.pig.common.swagger.annotation; +import com.pig4cloud.pig.common.core.factory.YamlPropertySourceFactory; import com.pig4cloud.pig.common.swagger.config.OpenAPIDefinitionImportSelector; import com.pig4cloud.pig.common.swagger.support.SwaggerProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Import; +import org.springframework.context.annotation.PropertySource; import java.lang.annotation.*; @@ -35,6 +37,7 @@ import java.lang.annotation.*; @Inherited @EnableConfigurationProperties(SwaggerProperties.class) @Import({ OpenAPIDefinitionImportSelector.class }) +@PropertySource(value = "classpath:openapi-config.yaml", factory = YamlPropertySourceFactory.class) public @interface EnablePigDoc { /** diff --git a/pig-common/pig-common-swagger/src/main/resources/openapi-config.yaml b/pig-common/pig-common-swagger/src/main/resources/openapi-config.yaml new file mode 100644 index 00000000..f1823a02 --- /dev/null +++ b/pig-common/pig-common-swagger/src/main/resources/openapi-config.yaml @@ -0,0 +1,7 @@ +# swagger 配置 +swagger: + enabled: true + title: Pig Swagger API + gateway: http://${GATEWAY-HOST:pig-gateway}:${GATEWAY-PORT:9999} + token-url: ${swagger.gateway}/auth/oauth2/token + scope: server