Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/main/java/com/swyp/picke/global/config/SwaggerConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public GroupedOpenApi adApi() {
.group("3. 광고 API")
.pathsToMatch("/api/v1/ads", "/api/v1/ads/**", "/api/v1/admin/ads", "/api/v1/admin/ads/**")
.addOpenApiCustomizer(openApi -> openApi.setServers(
List.of(currentServer(), prodServer(), localServer(), devServer())))
List.of(currentServer(), adServer(), devServer(), localServer(), prodServer())))
.build();
}

Expand All @@ -137,6 +137,16 @@ private Server currentServer() {
.description("현재 접속한 서버");
}

/**
* 광고 전용 도메인. 운영에서 광고 조회·클릭·랜딩을 받는 곳이다.
* 운영 API 서버(picke.store)와 별도 서비스라 광고 그룹에서 따로 고를 수 있어야 한다.
*/
private Server adServer() {
return new Server()
.url("https://ad.picke.store")
.description("Ad Server (운영 광고 도메인)");
}

// 1. 운영 서버 (8080)
private Server prodServer() {
return new Server()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ void adGroup_defaultsToCurrentOrigin() throws Exception {
.andExpect(jsonPath("$.servers[*].url").value(hasItem("https://picke.store")));
}

@Test
@DisplayName("광고 탭에서 운영 광고 도메인을 고를 수 있다. 운영 광고는 별도 서비스라 API 서버로는 조회되지 않는다")
void adGroup_offersAdDomain() throws Exception {
mockMvc.perform(get("/v3/api-docs/" + AD_GROUP))
.andExpect(status().isOk())
.andExpect(jsonPath("$.servers[1].url").value("https://ad.picke.store"));
}

@Test
@DisplayName("다른 탭의 서버 순서는 그대로 둔다")
void otherGroups_keepProdFirst() throws Exception {
Expand Down
Loading