개발 db 접속 정보 수정

This commit is contained in:
yjnoh 2025-05-23 14:16:56 +09:00
parent 854857d435
commit d4f403b817
7 changed files with 52 additions and 18 deletions

3
.gitignore vendored
View File

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

View File

@ -4,11 +4,13 @@ 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;
@ -20,30 +22,51 @@ 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.info( openAPI
new Info().title("QCast API").version("1.0").description("QCast API Documentation")); .info(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().group("ALL").packagesToScan("com.interplug.qcast.biz").addOpenApiCustomizer(openApiCustomizer()).build(); return GroupedOpenApi.builder()
.group("ALL")
.packagesToScan("com.interplug.qcast.biz")
.addOpenApiCustomizer(openApiCustomizer())
.build();
} }
@Bean @Bean
public OpenApiCustomizer openApiCustomizer() { public OpenApiCustomizer openApiCustomizer() {
Parameter lang = new Parameter().name("lang").description("Language").in("header").schema(new StringSchema()); Parameter lang =
return openApi -> openApi.getPaths().values().forEach( new Parameter()
pathItem -> pathItem.readOperations().forEach( .name("lang")
operation -> operation.addParametersItem(lang) .description("Language")
) .in("header")
); .schema(new StringSchema());
return openApi ->
openApi
.getPaths()
.values()
.forEach(
pathItem ->
pathItem
.readOperations()
.forEach(operation -> operation.addParametersItem(lang)));
} }
} }

View File

@ -63,4 +63,6 @@ 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,9 +6,11 @@ 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:
@ -63,4 +65,6 @@ 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,9 +6,10 @@ 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(Zc3J45rtPR/uQDeDOcrnF/iGLlU6U3y6)
maximum-pool-size: 4 maximum-pool-size: 4
pool-name: Master-HikariPool pool-name: Master-HikariPool
# datasource: # datasource:

View File

@ -63,4 +63,6 @@ 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,3 +82,4 @@ springdoc:
swagger-ui: swagger-ui:
operations-sorter: alpha operations-sorter: alpha
swagger.url: http://localhost:8080