📝 swagger ui -> springdoc openapi ui 변경
This commit is contained in:
@@ -29,8 +29,7 @@ dependencies {
|
||||
implementation 'io.jsonwebtoken:jjwt:0.9.1'
|
||||
implementation 'javax.xml.bind:jaxb-api:2.3.1'
|
||||
|
||||
implementation group: 'io.springfox', name: 'springfox-swagger2', version: '2.9.2'
|
||||
implementation group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.9.2'
|
||||
implementation 'org.springdoc:springdoc-openapi-webflux-ui:1.5.8'
|
||||
|
||||
compileOnly 'org.projectlombok:lombok'
|
||||
annotationProcessor 'org.projectlombok:lombok'
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
package org.egovframe.cloud.apigateway.api;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import reactor.core.publisher.Mono;
|
||||
import springfox.documentation.swagger.web.*;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* org.egovframe.cloud.apigateway.api.SwaggerResourcesController
|
||||
*
|
||||
* Swagger resource 들을 모으는 controller class
|
||||
*
|
||||
* @author 표준프레임워크센터 shinmj
|
||||
* @version 1.0
|
||||
* @since 2021/07/07
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2021/07/07 shinmj 최초 생성
|
||||
* </pre>
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/swagger-resources")
|
||||
public class SwaggerResourcesController {
|
||||
|
||||
@Autowired(required = false)
|
||||
private SecurityConfiguration securityConfiguration;
|
||||
|
||||
@Autowired(required = false)
|
||||
private UiConfiguration uiConfiguration;
|
||||
|
||||
private final SwaggerResourcesProvider swaggerResources;
|
||||
|
||||
@Autowired
|
||||
public SwaggerResourcesController(SwaggerResourcesProvider swaggerResources) {
|
||||
this.swaggerResources = swaggerResources;
|
||||
}
|
||||
|
||||
@GetMapping("/configuration/security")
|
||||
public Mono<ResponseEntity<SecurityConfiguration>> securityConfiguration() {
|
||||
return Mono.just(new ResponseEntity<>(
|
||||
Optional.ofNullable(securityConfiguration).orElse(SecurityConfigurationBuilder.builder().build()),
|
||||
HttpStatus.OK
|
||||
));
|
||||
}
|
||||
|
||||
@GetMapping("/configuration/ui")
|
||||
public Mono<ResponseEntity<UiConfiguration>> uiConfiguration() {
|
||||
return Mono.just(new ResponseEntity<>(
|
||||
Optional.ofNullable(uiConfiguration).orElse(UiConfigurationBuilder.builder().build()),
|
||||
HttpStatus.OK
|
||||
));
|
||||
}
|
||||
|
||||
@GetMapping("")
|
||||
public Mono<ResponseEntity> swaggerResources() {
|
||||
return Mono.just(new ResponseEntity(
|
||||
swaggerResources.get(), HttpStatus.OK
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,7 @@ import java.nio.file.Paths;
|
||||
@Configuration
|
||||
public class MessageSourceConfig {
|
||||
|
||||
@Value("${messages.directory:${user.home}/msa-attach-volume/messages}")
|
||||
@Value("${messages.directory}")
|
||||
private String messagesDirectory;
|
||||
|
||||
@Value("${spring.profiles.active:default}")
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package org.egovframe.cloud.apigateway.config;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.springdoc.core.GroupedOpenApi;
|
||||
import org.springdoc.core.SwaggerUiConfigParameters;
|
||||
import org.springframework.cloud.gateway.route.RouteDefinition;
|
||||
import org.springframework.cloud.gateway.route.RouteDefinitionLocator;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
|
||||
@Configuration
|
||||
public class OpenApiDocConfig {
|
||||
|
||||
@Bean
|
||||
@Lazy(false)
|
||||
public List<GroupedOpenApi> apis(SwaggerUiConfigParameters swaggerUiConfigParameters, RouteDefinitionLocator locator) {
|
||||
List<GroupedOpenApi> groups = new ArrayList<>();
|
||||
|
||||
List<RouteDefinition> definitions = locator.getRouteDefinitions().log("OpenApiDocConfig").collectList().block();
|
||||
definitions.stream().filter(routeDefinition -> routeDefinition.getId().matches(".*-service")).forEach(routeDefinition -> {
|
||||
String name = routeDefinition.getId();
|
||||
swaggerUiConfigParameters.addGroup(name);
|
||||
GroupedOpenApi.builder().pathsToMatch("/" + name + "/**").group(name).build();
|
||||
});
|
||||
return groups;
|
||||
}
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
package org.egovframe.cloud.apigateway.config;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.cloud.gateway.config.GatewayProperties;
|
||||
import org.springframework.cloud.gateway.route.RouteLocator;
|
||||
import org.springframework.cloud.gateway.support.NameUtils;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.stereotype.Component;
|
||||
import springfox.documentation.swagger.web.SwaggerResource;
|
||||
import springfox.documentation.swagger.web.SwaggerResourcesProvider;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* org.egovframe.cloud.apigateway.config.SwaggerProvider
|
||||
*
|
||||
* Swagger API Doc aggregator class
|
||||
* Swagger Resource인 api-docs를 가져오는 provider
|
||||
*
|
||||
* @author 표준프레임워크센터 shinmj
|
||||
* @version 1.0
|
||||
* @since 2021/07/07
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2021/07/07 shinmj 최초 생성
|
||||
* </pre>
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Component
|
||||
@Primary
|
||||
public class SwaggerProvider implements SwaggerResourcesProvider {
|
||||
|
||||
public static final String API_URL = "/v2/api-docs";
|
||||
public static final String WEBFLUX_API_URL = "/v3/api-docs";
|
||||
private final RouteLocator routeLocator;
|
||||
private final GatewayProperties gatewayProperties;
|
||||
|
||||
@Override
|
||||
public List<SwaggerResource> get() {
|
||||
List<SwaggerResource> resources = new ArrayList<>();
|
||||
List<String> routes = new ArrayList<>();
|
||||
|
||||
routeLocator.getRoutes().subscribe(route -> routes.add(route.getId()));
|
||||
|
||||
gatewayProperties.getRoutes().stream()
|
||||
.filter(routeDefinition -> routes.contains(routeDefinition.getId()))
|
||||
.forEach(routeDefinition -> routeDefinition.getPredicates().stream()
|
||||
.filter(predicateDefinition -> ("Path").equalsIgnoreCase(predicateDefinition.getName()))
|
||||
.forEach(predicateDefinition ->
|
||||
resources.add(
|
||||
swaggerResource(routeDefinition.getId(),
|
||||
predicateDefinition.
|
||||
getArgs().
|
||||
get(NameUtils.GENERATED_NAME_PREFIX+"0").
|
||||
replace("/**", API_URL))))
|
||||
);
|
||||
|
||||
return resources;
|
||||
}
|
||||
|
||||
private SwaggerResource swaggerResource(String name, String location) {
|
||||
SwaggerResource swaggerResource = new SwaggerResource();
|
||||
swaggerResource.setName(name);
|
||||
if (name.contains("reserve")) {
|
||||
swaggerResource.setLocation(location.replace(API_URL, WEBFLUX_API_URL));
|
||||
}else {
|
||||
swaggerResource.setLocation(location);
|
||||
}
|
||||
|
||||
swaggerResource.setSwaggerVersion("2.0");
|
||||
return swaggerResource;
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,7 @@ public class WebFluxSecurityConfig {
|
||||
ReactiveAuthorization.AUTHORIZATION_URI, "/", "/csrf",
|
||||
"/user-service/login", "/?*-service/api/v1/messages/**", "/api/v1/messages/**",
|
||||
"/?*-service/actuator/?*", "/actuator/?*",
|
||||
"/?*-service/v2/api-docs", "/?*-service/v3/api-docs", "**/configuration/*", "/swagger*/**", "/webjars/**"
|
||||
"/v3/api-docs/**", "/?*-service/v3/api-docs", "**/configuration/*", "/swagger*/**", "/webjars/**"
|
||||
};
|
||||
private final static String USER_JOIN_ANTPATTERNS = "/user-service/api/v1/users";
|
||||
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
package org.egovframe.cloud.apigateway.filter;
|
||||
|
||||
import org.egovframe.cloud.apigateway.config.SwaggerProvider;
|
||||
import org.springframework.cloud.gateway.filter.GatewayFilter;
|
||||
import org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory;
|
||||
import org.springframework.http.server.reactive.ServerHttpRequest;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
|
||||
/**
|
||||
* org.egovframe.cloud.apigateway.filter.SwaggerHeaderFilter
|
||||
*
|
||||
* Swagger header filter class
|
||||
* 각 서비스 명을 붙여서 호출 할 수 있도록 filter를 추가 한다.
|
||||
*
|
||||
* @author 표준프레임워크센터 shinmj
|
||||
* @version 1.0
|
||||
* @since 2021/07/07
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2021/07/07 shinmj 최초 생성
|
||||
* </pre>
|
||||
*/
|
||||
@Component
|
||||
public class SwaggerHeaderFilter extends AbstractGatewayFilterFactory {
|
||||
private static final String HEADER_NAME = "X-Forwarded-Prefix";
|
||||
|
||||
@Override
|
||||
public GatewayFilter apply(Object config) {
|
||||
return (exchange, chain) -> {
|
||||
ServerHttpRequest request = exchange.getRequest();
|
||||
String path = request.getURI().getPath();
|
||||
if (!StringUtils.endsWithIgnoreCase(path, SwaggerProvider.API_URL)) {
|
||||
return chain.filter(exchange);
|
||||
}
|
||||
|
||||
String basePath = path.substring(0, path.lastIndexOf(SwaggerProvider.API_URL));
|
||||
ServerHttpRequest newRequest = request.mutate().header(HEADER_NAME, basePath).build();
|
||||
ServerWebExchange newExchange = exchange.mutate().request(newRequest).build();
|
||||
|
||||
return chain.filter(newExchange);
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -14,42 +14,42 @@ spring:
|
||||
filters:
|
||||
- RemoveRequestHeader=Cookie
|
||||
- RewritePath=/user-service/(?<segment>.*), /$\{segment}
|
||||
- SwaggerHeaderFilter
|
||||
- id: portal-service
|
||||
uri: lb://PORTAL-SERVICE
|
||||
predicates:
|
||||
- Path=/portal-service/**
|
||||
filters:
|
||||
- RewritePath=/portal-service/(?<segment>.*), /$\{segment}
|
||||
- SwaggerHeaderFilter
|
||||
- id: board-service
|
||||
uri: lb://BOARD-SERVICE
|
||||
predicates:
|
||||
- Path=/board-service/**
|
||||
filters:
|
||||
- RewritePath=/board-service/(?<segment>.*), /$\{segment}
|
||||
- SwaggerHeaderFilter
|
||||
- id: reserve-item-service
|
||||
uri: lb://RESERVE-ITEM-SERVICE
|
||||
predicates:
|
||||
- Path=/reserve-item-service/**
|
||||
filters:
|
||||
- RewritePath=/reserve-item-service/(?<segment>.*), /$\{segment}
|
||||
- SwaggerHeaderFilter
|
||||
- id: reserve-check-service
|
||||
uri: lb://RESERVE-CHECK-SERVICE
|
||||
predicates:
|
||||
- Path=/reserve-check-service/**
|
||||
filters:
|
||||
- RewritePath=/reserve-check-service/(?<segment>.*), /$\{segment}
|
||||
- SwaggerHeaderFilter
|
||||
- id: reserve-request-service
|
||||
uri: lb://RESERVE-REQUEST-SERVICE
|
||||
predicates:
|
||||
- Path=/reserve-request-service/**
|
||||
filters:
|
||||
- RewritePath=/reserve-request-service/(?<segment>.*), /$\{segment}
|
||||
- SwaggerHeaderFilter
|
||||
- id: openapi
|
||||
uri: http://localhost:${server.port}
|
||||
predicates:
|
||||
- Path=/v3/api-docs/**
|
||||
filters:
|
||||
- RewritePath=/v3/api-docs/(?<segment>.*), /$\{segment}/v3/api-docs
|
||||
default-filters:
|
||||
- name: GlobalFilter
|
||||
args:
|
||||
@@ -67,4 +67,4 @@ management:
|
||||
include: refresh, health, beans
|
||||
|
||||
messages:
|
||||
directory: ${user.dir}/msa-attach-volume/messages
|
||||
directory: ${user.dir}/msa-attach-volume/messages
|
||||
@@ -54,9 +54,8 @@ dependencies {
|
||||
implementation 'org.springframework.cloud:spring-cloud-stream'
|
||||
implementation 'org.springframework.cloud:spring-cloud-stream-binder-rabbit'
|
||||
|
||||
// swagger
|
||||
implementation group: 'io.springfox', name: 'springfox-swagger2', version: '2.9.2'
|
||||
implementation group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.9.2'
|
||||
// openapi docs
|
||||
implementation 'org.springdoc:springdoc-openapi-webmvc-core:1.5.8'
|
||||
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
|
||||
|
||||
// lombok
|
||||
|
||||
@@ -11,7 +11,7 @@ spring:
|
||||
server:
|
||||
native:
|
||||
search-locations: ${search.location:file:///${user.home}/workspace.edu/egovframe-msa-edu/config} # Windows
|
||||
# search-locations: file://${user.home}/workspace.edu/egovframe-msa-edu/config # MacOS
|
||||
# search-locations: file://${user.home}/workspace.edu/egovframe-msa-edu/config # MacOS
|
||||
rabbitmq:
|
||||
host: localhost
|
||||
port: 5672
|
||||
|
||||
@@ -38,6 +38,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
.headers().frameOptions().disable()
|
||||
.and()
|
||||
.authorizeRequests()
|
||||
.antMatchers("/actuator/?*").permitAll()
|
||||
.anyRequest().authenticated()
|
||||
.and()
|
||||
.httpBasic();
|
||||
|
||||
@@ -56,9 +56,8 @@ dependencies {
|
||||
// querydsl
|
||||
implementation 'com.querydsl:querydsl-jpa'
|
||||
|
||||
// swagger
|
||||
implementation group: 'io.springfox', name: 'springfox-swagger2', version: '2.9.2'
|
||||
implementation group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.9.2'
|
||||
// openapi docs
|
||||
implementation 'org.springdoc:springdoc-openapi-webmvc-core:1.5.8'
|
||||
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
|
||||
|
||||
// lombok
|
||||
@@ -97,4 +96,4 @@ configurations {
|
||||
compileQuerydsl {
|
||||
options.annotationProcessorPath = configurations.querydsl
|
||||
}
|
||||
// querydsl 추가 끝
|
||||
// querydsl 추가 끝
|
||||
|
||||
@@ -37,6 +37,7 @@ import org.springframework.test.context.TestPropertySource;
|
||||
@ActiveProfiles(profiles = "test")
|
||||
class MenuApiControllerTest {
|
||||
|
||||
|
||||
@Autowired
|
||||
private TestRestTemplate restTemplate;
|
||||
|
||||
@@ -50,9 +51,9 @@ class MenuApiControllerTest {
|
||||
@BeforeEach
|
||||
public void setup() throws Exception {
|
||||
siteRepository.save(Site.builder()
|
||||
.name("site")
|
||||
.isUse(true)
|
||||
.build()
|
||||
.name("site")
|
||||
.isUse(true)
|
||||
.build()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,18 +68,18 @@ class MenuApiControllerTest {
|
||||
Site site = siteRepository.findAll().get(0);
|
||||
|
||||
Menu parentMenu = menuRepository.save(Menu.builder()
|
||||
.menuKorName("parent")
|
||||
.sortSeq(1)
|
||||
.site(site)
|
||||
.build());
|
||||
.menuKorName("parent")
|
||||
.sortSeq(1)
|
||||
.site(site)
|
||||
.build());
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
Menu childMenu = Menu.builder()
|
||||
.menuKorName("child_" + i)
|
||||
.site(site)
|
||||
.parent(parentMenu)
|
||||
.sortSeq(i + 1)
|
||||
.build();
|
||||
.menuKorName("child_" + i)
|
||||
.site(site)
|
||||
.parent(parentMenu)
|
||||
.sortSeq(i + 1)
|
||||
.build();
|
||||
childMenu.setParentMenu(parentMenu);
|
||||
menuRepository.save(childMenu);
|
||||
}
|
||||
@@ -101,14 +102,14 @@ class MenuApiControllerTest {
|
||||
public void 메뉴관리_사이트콤보_목록_조회한다() throws Exception {
|
||||
//given
|
||||
siteRepository.save(Site.builder()
|
||||
.name("portal")
|
||||
.isUse(true)
|
||||
.build()
|
||||
.name("portal")
|
||||
.isUse(true)
|
||||
.build()
|
||||
);
|
||||
siteRepository.save(Site.builder()
|
||||
.name("admin")
|
||||
.isUse(true)
|
||||
.build()
|
||||
.name("admin")
|
||||
.isUse(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
//when
|
||||
@@ -126,50 +127,50 @@ class MenuApiControllerTest {
|
||||
Site site = siteRepository.findAll().get(0);
|
||||
|
||||
Menu parentMenu1 = menuRepository.save(Menu.builder()
|
||||
.menuKorName("parent_1")
|
||||
.sortSeq(1)
|
||||
.site(site)
|
||||
.build());
|
||||
.menuKorName("parent_1")
|
||||
.sortSeq(1)
|
||||
.site(site)
|
||||
.build());
|
||||
Menu parentMenu2 = menuRepository.save(Menu.builder()
|
||||
.menuKorName("parent_2")
|
||||
.sortSeq(2)
|
||||
.site(site)
|
||||
.build());
|
||||
.menuKorName("parent_2")
|
||||
.sortSeq(2)
|
||||
.site(site)
|
||||
.build());
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
Menu childMenu1 = Menu.builder()
|
||||
.menuKorName("child_1_" + i)
|
||||
.site(site)
|
||||
.parent(parentMenu1)
|
||||
.sortSeq(i + 1)
|
||||
.build();
|
||||
.menuKorName("child_1_" + i)
|
||||
.site(site)
|
||||
.parent(parentMenu1)
|
||||
.sortSeq(i + 1)
|
||||
.build();
|
||||
childMenu1.setParentMenu(parentMenu1);
|
||||
menuRepository.save(childMenu1);
|
||||
if (i == 1) {
|
||||
Menu childChildMenu = Menu.builder()
|
||||
.menuKorName("child_child_1")
|
||||
.site(site)
|
||||
.parent(childMenu1)
|
||||
.sortSeq(1)
|
||||
.build();
|
||||
.menuKorName("child_child_1")
|
||||
.site(site)
|
||||
.parent(childMenu1)
|
||||
.sortSeq(1)
|
||||
.build();
|
||||
childChildMenu.setParentMenu(childMenu1);
|
||||
menuRepository.save(childChildMenu);
|
||||
Menu childChildMenu2 = Menu.builder()
|
||||
.menuKorName("child_child_1")
|
||||
.site(site)
|
||||
.parent(childMenu1)
|
||||
.sortSeq(2)
|
||||
.build();
|
||||
.menuKorName("child_child_1")
|
||||
.site(site)
|
||||
.parent(childMenu1)
|
||||
.sortSeq(2)
|
||||
.build();
|
||||
childChildMenu2.setParentMenu(childMenu1);
|
||||
menuRepository.save(childChildMenu2);
|
||||
}
|
||||
|
||||
Menu childMenu2 = Menu.builder()
|
||||
.menuKorName("child_2_" + i)
|
||||
.site(site)
|
||||
.parent(parentMenu2)
|
||||
.sortSeq(i + 1)
|
||||
.build();
|
||||
.menuKorName("child_2_" + i)
|
||||
.site(site)
|
||||
.parent(parentMenu2)
|
||||
.sortSeq(i + 1)
|
||||
.build();
|
||||
childMenu1.setParentMenu(parentMenu2);
|
||||
menuRepository.save(childMenu2);
|
||||
}
|
||||
@@ -196,11 +197,11 @@ class MenuApiControllerTest {
|
||||
Site site = siteRepository.findAll().get(0);
|
||||
|
||||
Menu parentMenu = menuRepository.save(Menu.builder()
|
||||
.menuKorName("parent")
|
||||
.menuKorName("parenteng")
|
||||
.sortSeq(1)
|
||||
.site(site)
|
||||
.build());
|
||||
.menuKorName("parent")
|
||||
.menuKorName("parenteng")
|
||||
.sortSeq(1)
|
||||
.site(site)
|
||||
.build());
|
||||
|
||||
//when
|
||||
String url = "/api/v1/menus/"+parentMenu.getId();
|
||||
@@ -219,11 +220,11 @@ class MenuApiControllerTest {
|
||||
Site site = siteRepository.findAll().get(0);
|
||||
|
||||
MenuTreeRequestDto menuTreeRequestDto = MenuTreeRequestDto.builder()
|
||||
.parentId(null)
|
||||
.siteId(site.getId())
|
||||
.name("parent")
|
||||
.sortSeq(1)
|
||||
.build();
|
||||
.parentId(null)
|
||||
.siteId(site.getId())
|
||||
.name("parent")
|
||||
.sortSeq(1)
|
||||
.build();
|
||||
|
||||
String url = "/api/v1/menus";
|
||||
|
||||
@@ -243,24 +244,24 @@ class MenuApiControllerTest {
|
||||
Site site = siteRepository.findAll().get(0);
|
||||
|
||||
Menu parentMenu1 = menuRepository.save(Menu.builder()
|
||||
.menuKorName("parent_1")
|
||||
.sortSeq(1)
|
||||
.site(site)
|
||||
.build());
|
||||
.menuKorName("parent_1")
|
||||
.sortSeq(1)
|
||||
.site(site)
|
||||
.build());
|
||||
Menu parentMenu2 = menuRepository.save(Menu.builder()
|
||||
.menuKorName("parent_2")
|
||||
.sortSeq(2)
|
||||
.site(site)
|
||||
.build());
|
||||
.menuKorName("parent_2")
|
||||
.sortSeq(2)
|
||||
.site(site)
|
||||
.build());
|
||||
|
||||
Long menuId = 0L;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
Menu childMenu1 = Menu.builder()
|
||||
.menuKorName("child_1_" + i)
|
||||
.site(site)
|
||||
.parent(parentMenu1)
|
||||
.sortSeq(i + 1)
|
||||
.build();
|
||||
.menuKorName("child_1_" + i)
|
||||
.site(site)
|
||||
.parent(parentMenu1)
|
||||
.sortSeq(i + 1)
|
||||
.build();
|
||||
childMenu1.setParentMenu(parentMenu1);
|
||||
Menu save = menuRepository.save(childMenu1);
|
||||
menuId = save.getId();
|
||||
@@ -269,13 +270,13 @@ class MenuApiControllerTest {
|
||||
List<MenuDnDRequestDto> updateList = new ArrayList<>();
|
||||
|
||||
updateList.add(MenuDnDRequestDto.builder()
|
||||
.menuId(menuId)
|
||||
.sortSeq(1)
|
||||
.parentId(parentMenu2.getId())
|
||||
.build());
|
||||
.menuId(menuId)
|
||||
.sortSeq(1)
|
||||
.parentId(parentMenu2.getId())
|
||||
.build());
|
||||
|
||||
HttpEntity<List<MenuDnDRequestDto>> httpEntity = new HttpEntity<>(
|
||||
updateList
|
||||
updateList
|
||||
);
|
||||
|
||||
|
||||
@@ -283,7 +284,7 @@ class MenuApiControllerTest {
|
||||
|
||||
//when
|
||||
ResponseEntity<Long> responseEntity =
|
||||
restTemplate.exchange(url, HttpMethod.PUT, httpEntity, Long.class);
|
||||
restTemplate.exchange(url, HttpMethod.PUT, httpEntity, Long.class);
|
||||
|
||||
//then
|
||||
assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
@@ -295,19 +296,19 @@ class MenuApiControllerTest {
|
||||
Site site = siteRepository.findAll().get(0);
|
||||
|
||||
Menu parentMenu1 = menuRepository.save(Menu.builder()
|
||||
.menuKorName("parent_1")
|
||||
.sortSeq(1)
|
||||
.site(site)
|
||||
.build());
|
||||
.menuKorName("parent_1")
|
||||
.sortSeq(1)
|
||||
.site(site)
|
||||
.build());
|
||||
|
||||
Long menuId = 0L;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
Menu childMenu1 = Menu.builder()
|
||||
.menuKorName("child_1_" + i)
|
||||
.site(site)
|
||||
.parent(parentMenu1)
|
||||
.sortSeq(i + 1)
|
||||
.build();
|
||||
.menuKorName("child_1_" + i)
|
||||
.site(site)
|
||||
.parent(parentMenu1)
|
||||
.sortSeq(i + 1)
|
||||
.build();
|
||||
childMenu1.setParentMenu(parentMenu1);
|
||||
Menu save = menuRepository.save(childMenu1);
|
||||
menuId = save.getId();
|
||||
@@ -317,7 +318,7 @@ class MenuApiControllerTest {
|
||||
|
||||
//when
|
||||
ResponseEntity<MenuTreeResponseDto> responseEntity =
|
||||
restTemplate.exchange(url, HttpMethod.PUT, null, MenuTreeResponseDto.class);
|
||||
restTemplate.exchange(url, HttpMethod.PUT, null, MenuTreeResponseDto.class);
|
||||
|
||||
assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
assertThat(responseEntity.getBody().getName()).isEqualTo("updateName");
|
||||
@@ -330,31 +331,31 @@ class MenuApiControllerTest {
|
||||
Site site = siteRepository.findAll().get(0);
|
||||
|
||||
Menu parentMenu1 = menuRepository.save(Menu.builder()
|
||||
.menuKorName("parent_1")
|
||||
.sortSeq(1)
|
||||
.site(site)
|
||||
.build());
|
||||
.menuKorName("parent_1")
|
||||
.sortSeq(1)
|
||||
.site(site)
|
||||
.build());
|
||||
|
||||
String url = "/api/v1/menus/"+parentMenu1.getId();
|
||||
|
||||
|
||||
HttpEntity<MenuUpdateRequestDto> httpEntity = new HttpEntity<>(
|
||||
MenuUpdateRequestDto.builder()
|
||||
.description("상위메뉴")
|
||||
.connectId(1)
|
||||
.menuType("menuType")
|
||||
.urlPath("/index")
|
||||
.subName("subname")
|
||||
.isUse(true)
|
||||
.isShow(true)
|
||||
.isBlank(false)
|
||||
.icon("icon")
|
||||
MenuUpdateRequestDto.builder()
|
||||
.description("상위메뉴")
|
||||
.connectId(1)
|
||||
.menuType("menuType")
|
||||
.urlPath("/index")
|
||||
.subName("subname")
|
||||
.isUse(true)
|
||||
.isShow(true)
|
||||
.isBlank(false)
|
||||
.icon("icon")
|
||||
.build()
|
||||
);
|
||||
|
||||
//when
|
||||
ResponseEntity<MenuResponseDto> responseEntity =
|
||||
restTemplate.exchange(url, HttpMethod.PUT, httpEntity, MenuResponseDto.class);
|
||||
restTemplate.exchange(url, HttpMethod.PUT, httpEntity, MenuResponseDto.class);
|
||||
|
||||
//then
|
||||
assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
@@ -369,19 +370,19 @@ class MenuApiControllerTest {
|
||||
Site site = siteRepository.findAll().get(0);
|
||||
|
||||
Menu parentMenu1 = menuRepository.save(Menu.builder()
|
||||
.menuKorName("parent_1")
|
||||
.sortSeq(1)
|
||||
.site(site)
|
||||
.build());
|
||||
.menuKorName("parent_1")
|
||||
.sortSeq(1)
|
||||
.site(site)
|
||||
.build());
|
||||
|
||||
Long menuId = 0L;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
Menu childMenu1 = Menu.builder()
|
||||
.menuKorName("child_1_" + i)
|
||||
.site(site)
|
||||
.parent(parentMenu1)
|
||||
.sortSeq(i + 1)
|
||||
.build();
|
||||
.menuKorName("child_1_" + i)
|
||||
.site(site)
|
||||
.parent(parentMenu1)
|
||||
.sortSeq(i + 1)
|
||||
.build();
|
||||
childMenu1.setParentMenu(parentMenu1);
|
||||
Menu save = menuRepository.save(childMenu1);
|
||||
menuId = save.getId();
|
||||
@@ -403,19 +404,19 @@ class MenuApiControllerTest {
|
||||
Site site = siteRepository.findAll().get(0);
|
||||
|
||||
Menu parentMenu1 = menuRepository.save(Menu.builder()
|
||||
.menuKorName("parent_1")
|
||||
.sortSeq(1)
|
||||
.site(site)
|
||||
.build());
|
||||
.menuKorName("parent_1")
|
||||
.sortSeq(1)
|
||||
.site(site)
|
||||
.build());
|
||||
|
||||
Long menuId = 0L;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
Menu childMenu1 = Menu.builder()
|
||||
.menuKorName("child_1_" + i)
|
||||
.site(site)
|
||||
.parent(parentMenu1)
|
||||
.sortSeq(i + 1)
|
||||
.build();
|
||||
.menuKorName("child_1_" + i)
|
||||
.site(site)
|
||||
.parent(parentMenu1)
|
||||
.sortSeq(i + 1)
|
||||
.build();
|
||||
childMenu1.setParentMenu(parentMenu1);
|
||||
Menu save = menuRepository.save(childMenu1);
|
||||
menuId = save.getId();
|
||||
|
||||
@@ -30,6 +30,7 @@ import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
import org.springframework.test.context.TestPropertySource;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@EnableConfigurationProperties
|
||||
@@ -37,6 +38,7 @@ import org.springframework.test.context.TestPropertySource;
|
||||
@ActiveProfiles(profiles = "test")
|
||||
class MenuRoleApiControllerTest {
|
||||
|
||||
|
||||
@Autowired
|
||||
private TestRestTemplate restTemplate;
|
||||
|
||||
@@ -52,24 +54,24 @@ class MenuRoleApiControllerTest {
|
||||
@BeforeEach
|
||||
public void setup() throws Exception {
|
||||
Site site = Site.builder()
|
||||
.name("site")
|
||||
.isUse(true)
|
||||
.build();
|
||||
.name("site")
|
||||
.isUse(true)
|
||||
.build();
|
||||
siteRepository.save(site);
|
||||
|
||||
Menu parentMenu = menuRepository.save(Menu.builder()
|
||||
.menuKorName("parent")
|
||||
.sortSeq(1)
|
||||
.site(site)
|
||||
.build());
|
||||
.menuKorName("parent")
|
||||
.sortSeq(1)
|
||||
.site(site)
|
||||
.build());
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
Menu childMenu = Menu.builder()
|
||||
.menuKorName("child_" + i)
|
||||
.site(site)
|
||||
.parent(parentMenu)
|
||||
.sortSeq(i + 1)
|
||||
.build();
|
||||
.menuKorName("child_" + i)
|
||||
.site(site)
|
||||
.parent(parentMenu)
|
||||
.sortSeq(i + 1)
|
||||
.build();
|
||||
childMenu.setParentMenu(parentMenu);
|
||||
menuRepository.save(childMenu);
|
||||
}
|
||||
@@ -87,7 +89,7 @@ class MenuRoleApiControllerTest {
|
||||
Site site = siteRepository.findAll().get(0);
|
||||
//when
|
||||
ResponseEntity<List<MenuRoleResponseDto>> responseEntity =
|
||||
restTemplate.exchange("/api/v1/menu-roles/role/"+site.getId(), HttpMethod.GET, null, new ParameterizedTypeReference<List<MenuRoleResponseDto>>(){});
|
||||
restTemplate.exchange("/api/v1/menu-roles/role/"+site.getId(), HttpMethod.GET, null, new ParameterizedTypeReference<List<MenuRoleResponseDto>>(){});
|
||||
|
||||
//then
|
||||
assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
@@ -118,7 +120,7 @@ class MenuRoleApiControllerTest {
|
||||
Site site = siteRepository.findAll().get(0);
|
||||
//when
|
||||
ResponseEntity<List<MenuRoleResponseDto>> responseEntity =
|
||||
restTemplate.exchange("/api/v1/menu-roles/role/"+site.getId(), HttpMethod.GET, null, new ParameterizedTypeReference<List<MenuRoleResponseDto>>(){});
|
||||
restTemplate.exchange("/api/v1/menu-roles/role/"+site.getId(), HttpMethod.GET, null, new ParameterizedTypeReference<List<MenuRoleResponseDto>>(){});
|
||||
|
||||
|
||||
//then
|
||||
@@ -152,39 +154,39 @@ class MenuRoleApiControllerTest {
|
||||
list.get(0).getChildren().stream().forEach(menuRoleResponseDto -> {
|
||||
if (menuRoleResponseDto.getKorName().equals("child_1")) {
|
||||
children.add(MenuRoleRequestDto.builder()
|
||||
.menuRoleId(menuRoleResponseDto.getMenuRoleId())
|
||||
.isChecked(true)
|
||||
.roleId("ROLE")
|
||||
.id(menuRoleResponseDto.getId())
|
||||
.build());
|
||||
.menuRoleId(menuRoleResponseDto.getMenuRoleId())
|
||||
.isChecked(true)
|
||||
.roleId("ROLE")
|
||||
.id(menuRoleResponseDto.getId())
|
||||
.build());
|
||||
|
||||
}else {
|
||||
children.add(MenuRoleRequestDto.builder()
|
||||
.menuRoleId(menuRoleResponseDto.getMenuRoleId())
|
||||
.isChecked(false)
|
||||
.roleId("ROLE")
|
||||
.id(menuRoleResponseDto.getId())
|
||||
.build());
|
||||
.menuRoleId(menuRoleResponseDto.getMenuRoleId())
|
||||
.isChecked(false)
|
||||
.roleId("ROLE")
|
||||
.id(menuRoleResponseDto.getId())
|
||||
.build());
|
||||
}
|
||||
});
|
||||
|
||||
requestDtoList.add(MenuRoleRequestDto.builder()
|
||||
.menuRoleId(list.get(0).getMenuRoleId())
|
||||
.isChecked(true)
|
||||
.roleId("ROLE")
|
||||
.id(list.get(0).getId())
|
||||
.children(children)
|
||||
.build());
|
||||
.menuRoleId(list.get(0).getMenuRoleId())
|
||||
.isChecked(true)
|
||||
.roleId("ROLE")
|
||||
.id(list.get(0).getId())
|
||||
.children(children)
|
||||
.build());
|
||||
|
||||
HttpEntity<List<MenuRoleRequestDto>> httpEntity = new HttpEntity<>(
|
||||
requestDtoList
|
||||
requestDtoList
|
||||
);
|
||||
|
||||
|
||||
|
||||
//when
|
||||
ResponseEntity<String> responseEntity =
|
||||
restTemplate.exchange("/api/v1/menu-roles", HttpMethod.POST, httpEntity, String.class);
|
||||
restTemplate.exchange("/api/v1/menu-roles", HttpMethod.POST, httpEntity, String.class);
|
||||
|
||||
//then
|
||||
assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
@@ -201,38 +203,38 @@ class MenuRoleApiControllerTest {
|
||||
//given
|
||||
Site site = siteRepository.findAll().get(0);
|
||||
Menu parentMenu = menuRepository.save(Menu.builder()
|
||||
.menuKorName("parent-any")
|
||||
.sortSeq(1)
|
||||
.site(site)
|
||||
.isUse(true)
|
||||
.build());
|
||||
.menuKorName("parent-any")
|
||||
.sortSeq(1)
|
||||
.site(site)
|
||||
.isUse(true)
|
||||
.build());
|
||||
MenuRole parentMenuRole = MenuRole.builder()
|
||||
.roleId(Role.ANONYMOUS.getKey())
|
||||
.menu(parentMenu)
|
||||
.build();
|
||||
.roleId(Role.ANONYMOUS.getKey())
|
||||
.menu(parentMenu)
|
||||
.build();
|
||||
parentMenuRole.setMenu(parentMenu);
|
||||
menuRoleRepository.save(parentMenuRole);
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
Menu childMenu = Menu.builder()
|
||||
.menuKorName("child-any_" + i)
|
||||
.site(site)
|
||||
.parent(parentMenu)
|
||||
.sortSeq(i + 1)
|
||||
.isUse(true)
|
||||
.build();
|
||||
.menuKorName("child-any_" + i)
|
||||
.site(site)
|
||||
.parent(parentMenu)
|
||||
.sortSeq(i + 1)
|
||||
.isUse(true)
|
||||
.build();
|
||||
childMenu.setParentMenu(parentMenu);
|
||||
menuRepository.save(childMenu);
|
||||
MenuRole role_any = MenuRole.builder()
|
||||
.roleId(Role.ANONYMOUS.getKey())
|
||||
.menu(childMenu)
|
||||
.build();
|
||||
.roleId(Role.ANONYMOUS.getKey())
|
||||
.menu(childMenu)
|
||||
.build();
|
||||
role_any.setMenu(childMenu);
|
||||
menuRoleRepository.save(role_any);
|
||||
}
|
||||
//when
|
||||
ResponseEntity<List<MenuSideResponseDto>> responseEntity =
|
||||
restTemplate.exchange("/api/v1/menu-roles/"+site.getId(), HttpMethod.GET, null, new ParameterizedTypeReference<List<MenuSideResponseDto>>(){});
|
||||
restTemplate.exchange("/api/v1/menu-roles/"+site.getId(), HttpMethod.GET, null, new ParameterizedTypeReference<List<MenuSideResponseDto>>(){});
|
||||
|
||||
|
||||
//then
|
||||
|
||||
@@ -59,12 +59,12 @@ class PolicyApiControllerTest {
|
||||
}
|
||||
|
||||
policyRepository.save(Policy.builder()
|
||||
.type(type)
|
||||
.title(title)
|
||||
.isUse(true)
|
||||
.regDate(ZonedDateTime.now())
|
||||
.contents(contents)
|
||||
.build());
|
||||
.type(type)
|
||||
.title(title)
|
||||
.isUse(true)
|
||||
.regDate(ZonedDateTime.now())
|
||||
.contents(contents)
|
||||
.build());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,12 +81,12 @@ class PolicyApiControllerTest {
|
||||
String contents = "test contents";
|
||||
|
||||
PolicySaveRequestDto requestDto = PolicySaveRequestDto.builder()
|
||||
.type(type)
|
||||
.title(title)
|
||||
.isUse(true)
|
||||
.regDate(ZonedDateTime.now())
|
||||
.contents(contents)
|
||||
.build();
|
||||
.type(type)
|
||||
.title(title)
|
||||
.isUse(true)
|
||||
.regDate(ZonedDateTime.now())
|
||||
.contents(contents)
|
||||
.build();
|
||||
|
||||
|
||||
//when
|
||||
@@ -106,7 +106,7 @@ class PolicyApiControllerTest {
|
||||
String url = API_URL+"?size=3%page=0";
|
||||
//when
|
||||
ResponseEntity<RestResponsePage<PolicyResponseDto>> responseEntity =
|
||||
restTemplate.exchange(url, HttpMethod.GET, null, new ParameterizedTypeReference<RestResponsePage<PolicyResponseDto>>() {});
|
||||
restTemplate.exchange(url, HttpMethod.GET, null, new ParameterizedTypeReference<RestResponsePage<PolicyResponseDto>>() {});
|
||||
|
||||
//then
|
||||
assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
@@ -147,17 +147,17 @@ class PolicyApiControllerTest {
|
||||
public void 이용약관_수정_된다() throws Exception {
|
||||
//given
|
||||
Long id = policyRepository.save(Policy.builder()
|
||||
.type("TOS")
|
||||
.title("title")
|
||||
.contents("contents!!!!")
|
||||
.build()
|
||||
.type("TOS")
|
||||
.title("title")
|
||||
.contents("contents!!!!")
|
||||
.build()
|
||||
).getId();
|
||||
String url = API_URL +"/"+id;
|
||||
|
||||
PolicyUpdateRequestDto requestDto = PolicyUpdateRequestDto.builder()
|
||||
.title("update title")
|
||||
.contents("update Details")
|
||||
.build();
|
||||
.title("update title")
|
||||
.contents("update Details")
|
||||
.build();
|
||||
|
||||
//when
|
||||
HttpEntity<PolicyUpdateRequestDto> requestEntity = new HttpEntity<>(requestDto);
|
||||
@@ -177,10 +177,10 @@ class PolicyApiControllerTest {
|
||||
public void 이용약관_삭제_한다() {
|
||||
//given
|
||||
Long id = policyRepository.save(Policy.builder()
|
||||
.type("TOS")
|
||||
.title("title")
|
||||
.contents("contents!!!!")
|
||||
.build()
|
||||
.type("TOS")
|
||||
.title("title")
|
||||
.contents("contents!!!!")
|
||||
.build()
|
||||
).getId();
|
||||
String url = API_URL +"/"+id;
|
||||
|
||||
@@ -196,11 +196,11 @@ class PolicyApiControllerTest {
|
||||
public void 사용여부_수정_한다() throws Exception {
|
||||
//given
|
||||
Long id = policyRepository.save(Policy.builder()
|
||||
.type("TOS")
|
||||
.title("title")
|
||||
.isUse(true)
|
||||
.contents("contents!!!")
|
||||
.build()
|
||||
.type("TOS")
|
||||
.title("title")
|
||||
.isUse(true)
|
||||
.contents("contents!!!")
|
||||
.build()
|
||||
).getId();
|
||||
String url = API_URL +"/"+id+"/"+false;
|
||||
|
||||
|
||||
@@ -5,12 +5,15 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.egovframe.cloud.portalservice.api.statistics.dto.StatisticsResponseDto;
|
||||
import org.egovframe.cloud.portalservice.domain.statistics.Statistics;
|
||||
import org.egovframe.cloud.portalservice.domain.statistics.StatisticsRepository;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.Mock;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
@@ -38,9 +41,9 @@ class StatisticsApiControllerTest {
|
||||
public void setup() {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
statisticsRepository.save(Statistics.builder()
|
||||
.siteId(1L)
|
||||
.remoteIp("testip")
|
||||
.build());
|
||||
.siteId(1L)
|
||||
.remoteIp("testip")
|
||||
.build());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -55,10 +58,10 @@ class StatisticsApiControllerTest {
|
||||
Long siteId = 1L;
|
||||
// when
|
||||
ResponseEntity< List<StatisticsResponseDto>> responseEntity =
|
||||
restTemplate.exchange("/api/v1/statistics/monthly/"+siteId,
|
||||
HttpMethod.GET,
|
||||
null,
|
||||
new ParameterizedTypeReference<List<StatisticsResponseDto>>(){});
|
||||
restTemplate.exchange("/api/v1/statistics/monthly/"+siteId,
|
||||
HttpMethod.GET,
|
||||
null,
|
||||
new ParameterizedTypeReference<List<StatisticsResponseDto>>(){});
|
||||
|
||||
responseEntity.getBody().forEach(System.out::println);
|
||||
assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
@@ -74,10 +77,10 @@ class StatisticsApiControllerTest {
|
||||
|
||||
// when
|
||||
ResponseEntity< List<StatisticsResponseDto>> responseEntity =
|
||||
restTemplate.exchange("/api/v1/statistics/daily/"+siteId+"?year="+now.getYear()+"&month="+now.getMonthValue(),
|
||||
HttpMethod.GET,
|
||||
null,
|
||||
new ParameterizedTypeReference<List<StatisticsResponseDto>>(){});
|
||||
restTemplate.exchange("/api/v1/statistics/daily/"+siteId+"?year="+now.getYear()+"&month="+now.getMonthValue(),
|
||||
HttpMethod.GET,
|
||||
null,
|
||||
new ParameterizedTypeReference<List<StatisticsResponseDto>>(){});
|
||||
|
||||
responseEntity.getBody().forEach(System.out::println);
|
||||
assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
@@ -85,5 +88,4 @@ class StatisticsApiControllerTest {
|
||||
assertThat(responseEntity.getBody().get(0).getY()).isEqualTo(10);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -48,19 +48,18 @@ dependencies {
|
||||
//messaging
|
||||
implementation 'org.springframework.cloud:spring-cloud-stream'
|
||||
implementation 'org.springframework.cloud:spring-cloud-stream-binder-rabbit'
|
||||
// implementation 'net.java.dev.jna:jna:5.9.0' // byte-buddy (No compatible attachment provider is available.)
|
||||
|
||||
implementation 'io.jsonwebtoken:jjwt:0.9.1'
|
||||
|
||||
implementation 'dev.miku:r2dbc-mysql:0.8.2.RELEASE'
|
||||
implementation 'mysql:mysql-connector-java'
|
||||
|
||||
// swagger api docs
|
||||
implementation 'org.springdoc:springdoc-openapi-webflux-ui:1.5.10'
|
||||
// openapi docs
|
||||
implementation 'org.springdoc:springdoc-openapi-webflux-ui:1.5.8'
|
||||
|
||||
// bolcking 호출 감지
|
||||
// implementation 'io.projectreactor:reactor-tools:3.4.9'
|
||||
// implementation 'io.projectreactor.tools:blockhound:1.0.6.RELEASE'
|
||||
implementation 'io.projectreactor:reactor-tools:3.4.9'
|
||||
implementation 'io.projectreactor.tools:blockhound:1.0.6.RELEASE'
|
||||
|
||||
//lombok
|
||||
implementation 'org.projectlombok:lombok'
|
||||
|
||||
@@ -41,26 +41,25 @@ dependencies {
|
||||
implementation 'org.springframework.cloud:spring-cloud-starter-circuitbreaker-reactor-resilience4j'
|
||||
implementation 'com.playtika.reactivefeign:feign-reactor-spring-cloud-starter:3.1.0'
|
||||
|
||||
implementation 'io.jsonwebtoken:jjwt:0.9.1'
|
||||
|
||||
implementation 'org.springframework.cloud:spring-cloud-starter-sleuth'
|
||||
implementation 'org.springframework.cloud:spring-cloud-sleuth-zipkin'
|
||||
implementation 'net.logstash.logback:logstash-logback-encoder:6.6' // logstash logback
|
||||
|
||||
implementation 'io.jsonwebtoken:jjwt:0.9.1'
|
||||
|
||||
implementation 'dev.miku:r2dbc-mysql:0.8.2.RELEASE'
|
||||
implementation 'mysql:mysql-connector-java'
|
||||
|
||||
// swagger api docs
|
||||
implementation 'org.springdoc:springdoc-openapi-webflux-ui:1.5.10'
|
||||
// openapi docs
|
||||
implementation 'org.springdoc:springdoc-openapi-webflux-ui:1.5.8'
|
||||
|
||||
// bolcking 호출 감지
|
||||
// implementation 'io.projectreactor:reactor-tools:3.4.9'
|
||||
// implementation 'io.projectreactor.tools:blockhound:1.0.6.RELEASE'
|
||||
implementation 'io.projectreactor:reactor-tools:3.4.9'
|
||||
implementation 'io.projectreactor.tools:blockhound:1.0.6.RELEASE'
|
||||
|
||||
//messaging
|
||||
implementation 'org.springframework.cloud:spring-cloud-stream'
|
||||
implementation 'org.springframework.cloud:spring-cloud-stream-binder-rabbit'
|
||||
// implementation 'net.java.dev.jna:jna:5.9.0' // byte-buddy (No compatible attachment provider is available.)
|
||||
|
||||
//lombok
|
||||
implementation 'org.projectlombok:lombok'
|
||||
|
||||
@@ -50,7 +50,6 @@ dependencies {
|
||||
implementation 'org.springframework.cloud:spring-cloud-stream'
|
||||
implementation 'org.springframework.cloud:spring-cloud-stream-binder-rabbit'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-amqp'
|
||||
// implementation 'net.java.dev.jna:jna:5.9.0' // byte-buddy (No compatible attachment provider is available.)
|
||||
|
||||
|
||||
implementation 'io.jsonwebtoken:jjwt:0.9.1'
|
||||
@@ -58,12 +57,12 @@ dependencies {
|
||||
implementation 'dev.miku:r2dbc-mysql:0.8.2.RELEASE'
|
||||
implementation 'mysql:mysql-connector-java'
|
||||
|
||||
// swagger api docs
|
||||
implementation 'org.springdoc:springdoc-openapi-webflux-ui:1.5.10'
|
||||
// openapi docs
|
||||
implementation 'org.springdoc:springdoc-openapi-webflux-ui:1.5.8'
|
||||
|
||||
// bolcking 호출 감지
|
||||
// implementation 'io.projectreactor:reactor-tools:3.4.9'
|
||||
// implementation 'io.projectreactor.tools:blockhound:1.0.6.RELEASE'
|
||||
implementation 'io.projectreactor:reactor-tools:3.4.9'
|
||||
implementation 'io.projectreactor.tools:blockhound:1.0.6.RELEASE'
|
||||
|
||||
//lombok
|
||||
implementation 'org.projectlombok:lombok'
|
||||
|
||||
@@ -56,9 +56,8 @@ dependencies {
|
||||
|
||||
implementation 'com.google.api-client:google-api-client:1.32.1'
|
||||
|
||||
// swagger
|
||||
implementation group: 'io.springfox', name: 'springfox-swagger2', version: '2.9.2'
|
||||
implementation group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.9.2'
|
||||
// openapi docs
|
||||
implementation 'org.springdoc:springdoc-openapi-webmvc-core:1.5.8'
|
||||
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
|
||||
|
||||
// lombok
|
||||
|
||||
@@ -14,6 +14,7 @@ services:
|
||||
- --collation-server=utf8mb4_unicode_ci
|
||||
volumes:
|
||||
- "./init/:/docker-entrypoint-initdb.d/"
|
||||
platform: linux/x86_64 #m1에서 플랫폼을 명시해주지 않으면 에러남
|
||||
ports:
|
||||
- "3306:3306"
|
||||
container_name: mysql
|
||||
@@ -21,4 +22,4 @@ services:
|
||||
networks:
|
||||
default:
|
||||
external:
|
||||
name: egov-network
|
||||
name: egov-network
|
||||
|
||||
Reference in New Issue
Block a user