Skip to content

Commit 8555d14

Browse files
authored
Merge pull request #789 from woowacourse-teams/server-dev
Dev -> Prod
2 parents a7f2549 + de18940 commit 8555d14

54 files changed

Lines changed: 2561 additions & 557 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/blue-green-deploy.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
uses: actions/checkout@v4
4444
with:
4545
ref: ${{ env.WORKING_BRANCH }}
46+
submodules: recursive
4647

4748
- name: JDK 21 설정
4849
uses: actions/setup-java@v4
@@ -80,6 +81,7 @@ jobs:
8081
uses: actions/checkout@v4
8182
with:
8283
ref: ${{ env.WORKING_BRANCH }}
84+
submodules: recursive
8385

8486
- name: JDK 21 설정
8587
uses: actions/setup-java@v4
@@ -114,6 +116,7 @@ jobs:
114116
uses: actions/checkout@v4
115117
with:
116118
ref: ${{ env.WORKING_BRANCH }}
119+
submodules: recursive
117120

118121
- name: JAR 다운로드
119122
uses: actions/download-artifact@v4
@@ -171,6 +174,7 @@ jobs:
171174
uses: actions/checkout@v4
172175
with:
173176
ref: ${{ env.WORKING_BRANCH }}
177+
submodules: recursive
174178

175179
- name: AWS 인증
176180
uses: aws-actions/configure-aws-credentials@v4
@@ -382,6 +386,7 @@ jobs:
382386
uses: actions/checkout@v4
383387
with:
384388
ref: ${{ env.WORKING_BRANCH }}
389+
submodules: recursive
385390

386391
- name: AWS 인증
387392
uses: aws-actions/configure-aws-credentials@v4

.github/workflows/dev-deploy.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
steps:
1616
- name: 코드 체크아웃
1717
uses: actions/checkout@v4
18+
with:
19+
submodules: recursive
1820

1921
- name: JDK 21 설정
2022
uses: actions/setup-java@v4
@@ -75,6 +77,8 @@ jobs:
7577
steps:
7678
- name: 코드 체크아웃
7779
uses: actions/checkout@v4
80+
with:
81+
submodules: recursive
7882

7983
- name: Docker 이미지 Pull
8084
run: |

.github/workflows/dev-pull-request.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
steps:
1616
- name: Github Repository 파일 불러오기
1717
uses: actions/checkout@v4
18+
with:
19+
submodules: recursive
1820

1921
- name: JDK v21 설치
2022
uses: actions/setup-java@v4

.github/workflows/manual-prod-deploy.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
uses: actions/checkout@v4
2424
with:
2525
ref: ${{ env.DEPLOY_BRANCH }}
26+
submodules: recursive
2627

2728
- name: JDK 21 설정
2829
uses: actions/setup-java@v4
@@ -36,7 +37,7 @@ jobs:
3637
run: |
3738
mkdir -p src/main/resources src/test/resources
3839
printf '%s' "${{ secrets.APPLICATION_PROD_PROPERTIES }}" > src/main/resources/application.yml
39-
40+
4041
- name: only 빌드
4142
run: ./gradlew clean assemble --no-daemon --stacktrace --info
4243

@@ -58,6 +59,7 @@ jobs:
5859
uses: actions/checkout@v4
5960
with:
6061
ref: ${{ env.DEPLOY_BRANCH }}
62+
submodules: recursive
6163

6264
- name: JDK 21 설정
6365
uses: actions/setup-java@v4
@@ -90,6 +92,7 @@ jobs:
9092
uses: actions/checkout@v4
9193
with:
9294
ref: ${{ env.DEPLOY_BRANCH }}
95+
submodules: recursive
9396

9497
- name: JAR 다운로드
9598
uses: actions/download-artifact@v4
@@ -123,20 +126,21 @@ jobs:
123126
deploy-server-sub:
124127
name: Production Server sub 배포
125128
needs: docker-image
126-
runs-on: [ self-hosted, prod-sub ]
129+
runs-on: [ self-hosted, prod-sub ]
127130
defaults:
128131
run:
129132
working-directory: ./backend/bom-bom-server
130133

131134
environment:
132135
name: production
133-
url: https://api.bombom.news
136+
url: https://api.bombom.news
134137

135138
steps:
136139
- name: 코드 체크아웃
137140
uses: actions/checkout@v4
138141
with:
139142
ref: ${{ env.DEPLOY_BRANCH }}
143+
submodules: recursive
140144

141145
- name: DockerHub 로그인
142146
uses: docker/login-action@v3
@@ -166,14 +170,14 @@ jobs:
166170
167171
sudo --preserve-env=OAUTH2_APPLE_PRIVATE_KEY docker compose \
168172
-f docker-compose-prod-sub.yml --env-file .env config | rg -n 'OAUTH2_APPLE_PRIVATE_KEY' || true
169-
173+
170174
sudo --preserve-env=OAUTH2_APPLE_PRIVATE_KEY docker compose \
171175
-f docker-compose-prod-sub.yml --env-file .env down || true
172176
173177
sudo --preserve-env=OAUTH2_APPLE_PRIVATE_KEY docker compose \
174178
-f docker-compose-prod-sub.yml --env-file .env \
175179
up -d --remove-orphans --pull=always --force-recreate
176-
180+
177181
- name: Docker 리소스 정리
178182
run: |
179183
sudo docker container prune -f --filter "until=24h"
@@ -182,18 +186,21 @@ jobs:
182186
deploy-server-main:
183187
name: Production Server main 배포
184188
needs: docker-image
185-
runs-on: [ self-hosted, prod-main ]
189+
runs-on: [ self-hosted, prod-main ]
186190
defaults:
187191
run:
188192
working-directory: ./backend/bom-bom-server
189193

190194
environment:
191195
name: production
192-
url: https://api.bombom.news
196+
url: https://api.bombom.news
193197

194198
steps:
195199
- name: 코드 체크아웃
196200
uses: actions/checkout@v4
201+
with:
202+
ref: ${{ env.DEPLOY_BRANCH }}
203+
submodules: recursive
197204

198205
- name: DockerHub 로그인
199206
uses: docker/login-action@v3
@@ -223,14 +230,14 @@ jobs:
223230
224231
sudo --preserve-env=OAUTH2_APPLE_PRIVATE_KEY docker compose \
225232
-f docker-compose-prod-sub.yml --env-file .env config | rg -n 'OAUTH2_APPLE_PRIVATE_KEY' || true
226-
233+
227234
sudo --preserve-env=OAUTH2_APPLE_PRIVATE_KEY docker compose \
228235
-f docker-compose-prod-sub.yml --env-file .env down || true
229236
230237
sudo --preserve-env=OAUTH2_APPLE_PRIVATE_KEY docker compose \
231238
-f docker-compose-prod-sub.yml --env-file .env \
232239
up -d --remove-orphans --pull=always --force-recreate
233-
240+
234241
- name: Docker 리소스 정리
235242
run: |
236243
sudo docker container prune -f --filter "until=24h"

.github/workflows/prod-pull-request.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
steps:
1616
- name: Github Repository 파일 불러오기
1717
uses: actions/checkout@v4
18+
with:
19+
submodules: recursive
1820

1921
- name: JDK v21 설치
2022
uses: actions/setup-java@v4

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "backend/bom-bom-server/openapi-spec"]
2+
path = backend/bom-bom-server/openapi-spec
3+
url = https://github.com/Bombom-Team/bom-bom-api-spec.git

backend/bom-bom-server/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ out/
2626
!**/src/main/**/out/
2727
!**/src/test/**/out/
2828

29+
### OpenAPI Generator ###
30+
/generated/openapi/.openapi-generator/
31+
2932
### NetBeans ###
3033
/nbproject/private/
3134
/nbbuild/

backend/bom-bom-server/build.gradle.kts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ plugins {
22
java
33
id("org.springframework.boot") version "3.5.14"
44
id("io.spring.dependency-management") version "1.1.7"
5+
id("org.openapi.generator") version "7.10.0"
6+
id("com.diffplug.spotless") version "7.2.1"
57
}
68

79
group = "me.bombom"
@@ -31,7 +33,6 @@ dependencyManagement {
3133
}
3234

3335
dependencies {
34-
3536
implementation("org.springframework.boot:spring-boot-starter-web")
3637
implementation("org.springframework.boot:spring-boot-starter-validation")
3738

@@ -103,11 +104,14 @@ dependencies {
103104
implementation("org.springframework:spring-aspects")
104105
}
105106

106-
// Querydsl 생성된 파일 정리
107+
// Querydsl/OpenAPI 생성된 파일 정리
107108
tasks.named<Delete>("clean") {
108-
delete("src/main/generated")
109+
delete(layout.buildDirectory.dir("generated"))
109110
}
110111

111112
tasks.test {
112113
useJUnitPlatform()
113114
}
115+
116+
apply(from = "$projectDir/gradle/openapi-generator.gradle")
117+
apply(from = "$projectDir/gradle/openapi-generated-format.gradle")
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
/**
2+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech)
3+
* (7.10.0). https://openapi-generator.tech Do not edit the class manually.
4+
*/
5+
package me.bombom.openapi.monthlyreport.api;
6+
7+
import io.swagger.v3.oas.annotations.Operation;
8+
import io.swagger.v3.oas.annotations.Parameter;
9+
import io.swagger.v3.oas.annotations.media.ArraySchema;
10+
import io.swagger.v3.oas.annotations.media.Content;
11+
import io.swagger.v3.oas.annotations.media.Schema;
12+
import io.swagger.v3.oas.annotations.responses.ApiResponse;
13+
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
14+
import io.swagger.v3.oas.annotations.tags.Tag;
15+
import jakarta.annotation.Generated;
16+
import jakarta.validation.Valid;
17+
import jakarta.validation.constraints.*;
18+
import java.util.List;
19+
import me.bombom.api.v1.common.resolver.LoginMember;
20+
import me.bombom.api.v1.member.domain.Member;
21+
import me.bombom.openapi.monthlyreport.model.MonthlyReportDashboardRequest;
22+
import me.bombom.openapi.monthlyreport.model.MonthlyReportRequest;
23+
import me.bombom.openapi.monthlyreport.model.ReadingCalendarDayResponse;
24+
import me.bombom.openapi.monthlyreport.model.ReadingDashboardResponse;
25+
import org.springdoc.core.annotations.ParameterObject;
26+
import org.springframework.http.HttpStatus;
27+
import org.springframework.validation.annotation.Validated;
28+
import org.springframework.web.bind.annotation.*;
29+
30+
@Validated
31+
@Tag(name = "MonthlyReport", description = "월간 리포트 관련 API")
32+
@Generated("org.openapitools.codegen.languages.SpringCodegen")
33+
public interface MonthlyReportApi {
34+
35+
/**
36+
* GET /api/v1/members/me/reading/calendar : 월간 읽기 캘린더 조회 로그인한 회원의 해당 연·월 일자별 읽기 현황을 조회합니다.
37+
*
38+
* @return 읽기 캘린더 조회 성공 (status code 200) or 잘못된 연·월 파라미터 요청 (status code 400) or 인증 실패 (status
39+
* code 401)
40+
*/
41+
@Operation(
42+
operationId = "getReadingCalendar",
43+
summary = "월간 읽기 캘린더 조회",
44+
description = "로그인한 회원의 해당 연·월 일자별 읽기 현황을 조회합니다.",
45+
tags = {"MonthlyReport"},
46+
responses = {
47+
@ApiResponse(
48+
responseCode = "200",
49+
description = "읽기 캘린더 조회 성공",
50+
content = {
51+
@Content(
52+
mediaType = "application/json",
53+
array =
54+
@ArraySchema(
55+
schema = @Schema(implementation = ReadingCalendarDayResponse.class)))
56+
}),
57+
@ApiResponse(responseCode = "400", description = "잘못된 연·월 파라미터 요청"),
58+
@ApiResponse(responseCode = "401", description = "인증 실패")
59+
},
60+
security = {@SecurityRequirement(name = "sessionCookie")})
61+
@RequestMapping(
62+
method = RequestMethod.GET,
63+
value = "/api/v1/members/me/reading/calendar",
64+
produces = {"application/json"})
65+
@ResponseStatus(HttpStatus.OK)
66+
List<ReadingCalendarDayResponse> getReadingCalendar(
67+
@Parameter(hidden = true) @LoginMember Member member,
68+
@Valid @ModelAttribute @ParameterObject MonthlyReportRequest request
69+
);
70+
71+
/**
72+
* GET /api/v1/members/me/reading/dashboard : 월간 읽기 대시보드 조회 로그인한 회원의 해당 연·월 읽기 통계를 조회합니다. 읽은 아티클
73+
* 수(지난 달 대비 증감 포함), 북마크 수, 자주 읽은 뉴스레터를 반환합니다.
74+
*
75+
* @return 읽기 대시보드 조회 성공 (status code 200) or 잘못된 연·월 파라미터 요청 (status code 400) or 인증 실패 (status
76+
* code 401)
77+
*/
78+
@Operation(
79+
operationId = "getReadingDashboard",
80+
summary = "월간 읽기 대시보드 조회",
81+
description =
82+
"로그인한 회원의 해당 연·월 읽기 통계를 조회합니다. 읽은 아티클 수(지난 달 대비 증감 포함), 북마크 수, 자주 읽은 뉴스레터를 반환합니다.",
83+
tags = {"MonthlyReport"},
84+
responses = {
85+
@ApiResponse(
86+
responseCode = "200",
87+
description = "읽기 대시보드 조회 성공",
88+
content = {
89+
@Content(
90+
mediaType = "application/json",
91+
schema = @Schema(implementation = ReadingDashboardResponse.class))
92+
}),
93+
@ApiResponse(responseCode = "400", description = "잘못된 연·월 파라미터 요청"),
94+
@ApiResponse(responseCode = "401", description = "인증 실패")
95+
},
96+
security = {@SecurityRequirement(name = "sessionCookie")})
97+
@RequestMapping(
98+
method = RequestMethod.GET,
99+
value = "/api/v1/members/me/reading/dashboard",
100+
produces = {"application/json"})
101+
@ResponseStatus(HttpStatus.OK)
102+
ReadingDashboardResponse getReadingDashboard(
103+
@Parameter(hidden = true) @LoginMember Member member,
104+
@Valid @ModelAttribute @ParameterObject MonthlyReportDashboardRequest request
105+
);
106+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
package me.bombom.openapi.monthlyreport.model;
2+
3+
import com.fasterxml.jackson.annotation.JsonValue;
4+
import jakarta.validation.Valid;
5+
import jakarta.validation.constraints.*;
6+
import io.swagger.v3.oas.annotations.media.Schema;
7+
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;
8+
import jakarta.annotation.Generated;
9+
10+
import com.fasterxml.jackson.annotation.JsonCreator;
11+
12+
/**
13+
* 증감 방향
14+
*/
15+
@Generated("org.openapitools.codegen.languages.SpringCodegen")
16+
public enum ChangeDirection {
17+
18+
UP("UP"),
19+
DOWN("DOWN"),
20+
SAME("SAME");
21+
22+
private final String value;
23+
24+
ChangeDirection(String value) {
25+
this.value = value;
26+
}
27+
28+
@JsonValue
29+
public String getValue() {
30+
return value;
31+
}
32+
33+
@Override
34+
public String toString() {
35+
return String.valueOf(value);
36+
}
37+
38+
@JsonCreator
39+
public static ChangeDirection fromValue(String value) {
40+
for (ChangeDirection b : ChangeDirection.values()) {
41+
if (b.value.equals(value)) {
42+
return b;
43+
}
44+
}
45+
throw new IllegalArgumentException("Unexpected value '" + value + "'");
46+
}
47+
}

0 commit comments

Comments
 (0)