Compare commits

..

No commits in common. "70c45a13004fc6d0f44f0c977a4472ac53183ade" and "07c9884d31832fb87c7e9870391034de6f47310d" have entirely different histories.

7 changed files with 18 additions and 52 deletions

3
.gitignore vendored
View File

@ -35,5 +35,4 @@ build/
.vscode/ .vscode/
### logs ### ### logs ###
qcast3/ qcast3/
src/test

View File

@ -4,13 +4,11 @@ import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.media.StringSchema; import io.swagger.v3.oas.models.media.StringSchema;
import io.swagger.v3.oas.models.parameters.Parameter; import io.swagger.v3.oas.models.parameters.Parameter;
import io.swagger.v3.oas.models.servers.Server;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springdoc.core.customizers.OpenApiCustomizer; import org.springdoc.core.customizers.OpenApiCustomizer;
import org.springdoc.core.models.GroupedOpenApi; import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
@ -22,51 +20,30 @@ public class SwaggerConfig {
@Autowired Environment env; @Autowired Environment env;
@Value("${swagger.url}")
private String swaggerUrl;
@Bean @Bean
public OpenAPI baseApi() { public OpenAPI baseApi() {
String activeProfile = env.getProperty("spring.profiles.active"); String activeProfile = env.getProperty("spring.profiles.active");
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("Active profile: {}", activeProfile); log.debug("Active profile: {}", activeProfile);
} }
Server server = new Server();
server.setUrl(swaggerUrl);
OpenAPI openAPI = new OpenAPI(); OpenAPI openAPI = new OpenAPI();
openAPI openAPI.info(
.info(new Info().title("QCast API").version("1.0").description("QCast API Documentation")) new Info().title("QCast API").version("1.0").description("QCast API Documentation"));
.addServersItem(server);
return openAPI; return openAPI;
} }
@Bean @Bean
public GroupedOpenApi allApi() { public GroupedOpenApi allApi() {
return GroupedOpenApi.builder() return GroupedOpenApi.builder().group("ALL").packagesToScan("com.interplug.qcast.biz").addOpenApiCustomizer(openApiCustomizer()).build();
.group("ALL")
.packagesToScan("com.interplug.qcast.biz")
.addOpenApiCustomizer(openApiCustomizer())
.build();
} }
@Bean @Bean
public OpenApiCustomizer openApiCustomizer() { public OpenApiCustomizer openApiCustomizer() {
Parameter lang = Parameter lang = new Parameter().name("lang").description("Language").in("header").schema(new StringSchema());
new Parameter() return openApi -> openApi.getPaths().values().forEach(
.name("lang") pathItem -> pathItem.readOperations().forEach(
.description("Language") operation -> operation.addParametersItem(lang)
.in("header") )
.schema(new StringSchema()); );
return openApi ->
openApi
.getPaths()
.values()
.forEach(
pathItem ->
pathItem
.readOperations()
.forEach(operation -> operation.addParametersItem(lang)));
} }
} }

View File

@ -63,6 +63,4 @@ file:
ini.drawing.img.path: https://files.hanasys.jp/Drawing ini.drawing.img.path: https://files.hanasys.jp/Drawing
front: front:
url: http://1.248.227.176:3000 url: http://1.248.227.176:3000
swagger.url: http://localhost:38080

View File

@ -6,11 +6,9 @@ server:
spring: spring:
datasource: datasource:
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
#jdbc-url: jdbc:log4jdbc:sqlserver://1.248.227.176:1433;databaseName=NEWPVCAD;encrypt=true;trustServerCertificate=true jdbc-url: jdbc:log4jdbc:sqlserver://1.248.227.176:1433;databaseName=NEWPVCAD;encrypt=true;trustServerCertificate=true
jdbc-url: jdbc:log4jdbc:sqlserver://192.168.200.220:1433;databaseName=NEWPVCAD;encrypt=false;trustServerCertificate=false
username: pvDBuser username: pvDBuser
#password: ENC(W7owprYnvf7vqwO6Piw4dHfVBCSxE4Ck) password: ENC(W7owprYnvf7vqwO6Piw4dHfVBCSxE4Ck)
password: ENC(Zc3J45rtPR/uQDeDOcrnF/iGLlU6U3y6)
maximum-pool-size: 4 maximum-pool-size: 4
pool-name: Master-HikariPool pool-name: Master-HikariPool
# datasource: # datasource:
@ -65,6 +63,4 @@ file:
ini.drawing.img.path: https://files.hanasys.jp/Drawing ini.drawing.img.path: https://files.hanasys.jp/Drawing
front: front:
url: http://1.248.227.176:3000 url: http://1.248.227.176:3000
swagger.url: https://dev-api.hanasys.jp

View File

@ -6,10 +6,9 @@ server:
spring: spring:
datasource: datasource:
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
#jdbc-url: jdbc:log4jdbc:sqlserver://1.248.227.176:1433;databaseName=NEWPVCAD;encrypt=true;trustServerCertificate=true jdbc-url: jdbc:log4jdbc:sqlserver://1.248.227.176:1433;databaseName=NEWPVCAD;encrypt=true;trustServerCertificate=true
jdbc-url: jdbc:log4jdbc:sqlserver://192.168.200.220:1433;databaseName=NEWPVCAD;encrypt=false;trustServerCertificate=false
username: pvDBuser username: pvDBuser
password: ENC(Zc3J45rtPR/uQDeDOcrnF/iGLlU6U3y6) password: ENC(W7owprYnvf7vqwO6Piw4dHfVBCSxE4Ck)
maximum-pool-size: 4 maximum-pool-size: 4
pool-name: Master-HikariPool pool-name: Master-HikariPool
# datasource: # datasource:

View File

@ -63,6 +63,4 @@ file:
ini.drawing.img.path: https://files.hanasys.jp/Drawing ini.drawing.img.path: https://files.hanasys.jp/Drawing
front: front:
url: https://hanasys.jp url: https://hanasys.jp
swagger.url: https://api.hanasys.jp

View File

@ -82,4 +82,3 @@ springdoc:
swagger-ui: swagger-ui:
operations-sorter: alpha operations-sorter: alpha
swagger.url: http://localhost:8080