Skip to content

Commit ce8733d

Browse files
authored
Merge pull request #395 from wafflestudio/develop
Release
2 parents 47cecbc + b1d6d5c commit ce8733d

File tree

160 files changed

+3126
-1177
lines changed

Some content is hidden

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

160 files changed

+3126
-1177
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,23 @@ on:
88

99
jobs:
1010
build:
11-
runs-on: ubuntu-latest
11+
runs-on: ubuntu-24.04-arm
1212

1313
steps:
1414
- name: Checkout
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@v4
1616

1717
- name: Configure AWS credentials
18-
uses: aws-actions/configure-aws-credentials@v2
18+
uses: aws-actions/configure-aws-credentials@v4
1919
with:
2020
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
2121
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
2222
aws-region: ap-northeast-2
2323

24-
- name: Set up JDK 17
25-
uses: actions/setup-java@v3
24+
- name: Set up JDK 21
25+
uses: actions/setup-java@v4
2626
with:
27-
java-version: '17'
27+
java-version: '21'
2828
distribution: 'temurin'
2929

3030
- name: Run Tests

.github/workflows/deploy-dev.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
jobs:
88
deploy:
99
name: Deploy-dev
10-
runs-on: ubuntu-latest
10+
runs-on: ubuntu-24.04-arm
1111
env:
1212
IMAGE_TAG: ${{ github.run_number }}
1313
BUILD_NUMBER: ${{ github.run_number }}
@@ -17,18 +17,18 @@ jobs:
1717

1818
steps:
1919
- name: Checkout
20-
uses: actions/checkout@v2
20+
uses: actions/checkout@v4
2121

2222
- name: Configure AWS credentials
23-
uses: aws-actions/configure-aws-credentials@v2
23+
uses: aws-actions/configure-aws-credentials@v4
2424
with:
2525
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
2626
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
2727
aws-region: ap-northeast-2
2828

2929
- name: Login to ECR
3030
id: login-ecr
31-
uses: aws-actions/amazon-ecr-login@v1
31+
uses: aws-actions/amazon-ecr-login@v2
3232

3333
- name: Get and save Auth Token for CodeArtifact
3434
id: get-save-codeartifact-auth-token

.github/workflows/deploy-prod.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
jobs:
88
deploy:
99
name: Deploy-prod
10-
runs-on: ubuntu-latest
10+
runs-on: ubuntu-24.04-arm
1111
env:
1212
IMAGE_TAG: ${{ github.run_number }}
1313
BUILD_NUMBER: ${{ github.run_number }}
@@ -17,18 +17,18 @@ jobs:
1717

1818
steps:
1919
- name: Checkout
20-
uses: actions/checkout@v2
20+
uses: actions/checkout@v4
2121

2222
- name: Configure AWS credentials
23-
uses: aws-actions/configure-aws-credentials@v2
23+
uses: aws-actions/configure-aws-credentials@v4
2424
with:
2525
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
2626
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
2727
aws-region: ap-northeast-2
2828

2929
- name: Login to ECR
3030
id: login-ecr
31-
uses: aws-actions/amazon-ecr-login@v1
31+
uses: aws-actions/amazon-ecr-login@v2
3232

3333
- name: Get and save Auth Token for CodeArtifact
3434
id: get-save-codeartifact-auth-token
@@ -45,7 +45,7 @@ jobs:
4545
echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
4646
4747
- name: Slack Notify
48-
uses: rtCamp/action-slack-notify@v2.1.2
48+
uses: rtCamp/action-slack-notify@v2.3.3
4949
env:
5050
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
5151
SLACK_CHANNEL: team-snutt-deploy

.github/workflows/lint.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ on:
88

99
jobs:
1010
build:
11-
runs-on: ubuntu-latest
11+
runs-on: ubuntu-24.04-arm
1212

1313
steps:
1414
- name: Checkout
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@v4
1616

17-
- name: Set up JDK 17
18-
uses: actions/setup-java@v3
17+
- name: Set up JDK 21
18+
uses: actions/setup-java@v4
1919
with:
20-
java-version: '17'
20+
java-version: '21'
2121
distribution: 'temurin'
2222

2323
- name: Run Lint

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM openjdk:17-jdk-slim
1+
FROM eclipse-temurin:21-alpine
22
WORKDIR /app
33
ARG CODEARTIFACT_AUTH_TOKEN
44
COPY . /app

Dockerfile-batch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM openjdk:17-jdk-slim
1+
FROM eclipse-temurin:21-alpine
22
WORKDIR /app
33
ARG CODEARTIFACT_AUTH_TOKEN
44
COPY . /app

api/build.gradle.kts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
plugins {
22
id("org.springframework.boot")
3-
id("org.unbroken-dome.test-sets") version "4.0.0"
3+
id("org.unbroken-dome.test-sets") version "4.1.0"
44
}
55

66
dependencies {
77
implementation(project(":core"))
88

99
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
1010

11-
implementation("io.jsonwebtoken:jjwt:0.9.1")
12-
runtimeOnly("javax.xml.bind:jaxb-api:2.1")
11+
implementation("io.jsonwebtoken:jjwt-api:0.12.6")
12+
implementation("io.jsonwebtoken:jjwt-impl:0.12.6")
13+
implementation("io.jsonwebtoken:jjwt-jackson:0.12.6")
14+
runtimeOnly("jakarta.xml.bind:jakarta.xml.bind-api:4.0.2")
1315

1416
testImplementation(testFixtures(project(":core")))
1517
testImplementation("org.springframework.boot:spring-boot-testcontainers")
16-
testImplementation("org.testcontainers:mongodb:1.19.0")
17-
testImplementation("io.kotest.extensions:kotest-extensions-spring:1.1.2")
18+
testImplementation("org.testcontainers:mongodb:1.21.3")
19+
testImplementation("io.kotest.extensions:kotest-extensions-spring:1.3.0")
1820
}
1921

2022
tasks.bootJar {

api/src/main/kotlin/filter/ErrorWebFilter.kt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ class ErrorWebFilter(
2626
override fun filter(
2727
exchange: ServerWebExchange,
2828
chain: WebFilterChain,
29-
): Mono<Void> {
30-
return chain.filter(exchange)
29+
): Mono<Void> =
30+
chain
31+
.filter(exchange)
3132
.onErrorResume { throwable ->
3233
val errorBody: ErrorBody
3334
val httpStatusCode: HttpStatusCode
@@ -38,6 +39,7 @@ class ErrorWebFilter(
3839
throwable.errorResponse.let {
3940
ErrorBody(
4041
it.error.code,
42+
"",
4143
it.error.message,
4244
it.error.message,
4345
)
@@ -79,15 +81,14 @@ class ErrorWebFilter(
7981
Mono.empty()
8082
}
8183
}
82-
}
8384

84-
private fun makeErrorBody(exception: SnuttException): ErrorBody {
85-
return ErrorBody(exception.error.errorCode, exception.errorMessage, exception.displayMessage, exception.ext)
86-
}
85+
private fun makeErrorBody(exception: SnuttException): ErrorBody =
86+
ErrorBody(exception.error.errorCode, exception.title, exception.errorMessage, exception.displayMessage, exception.ext)
8787
}
8888

8989
private data class ErrorBody(
9090
val errcode: Long,
91+
val title: String,
9192
val message: String,
9293
val displayMessage: String,
9394
// TODO: 구버전 대응용 ext 필드. 추후 삭제

api/src/main/kotlin/handler/AdminHandler.kt

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import com.wafflestudio.snutt.clientconfig.service.ClientConfigService
77
import com.wafflestudio.snutt.common.dto.OkResponse
88
import com.wafflestudio.snutt.common.storage.StorageService
99
import com.wafflestudio.snutt.common.storage.StorageSource
10+
import com.wafflestudio.snutt.diary.dto.request.DiaryAddQuestionRequestDto
11+
import com.wafflestudio.snutt.diary.service.DiaryService
1012
import com.wafflestudio.snutt.middleware.SnuttRestAdminApiMiddleware
1113
import com.wafflestudio.snutt.notification.service.NotificationAdminService
1214
import com.wafflestudio.snutt.popup.dto.PopupResponse
@@ -24,6 +26,7 @@ class AdminHandler(
2426
private val configService: ClientConfigService,
2527
private val storageService: StorageService,
2628
private val popupService: PopupService,
29+
private val diaryService: DiaryService,
2730
snuttRestAdminApiMiddleware: SnuttRestAdminApiMiddleware,
2831
) : ServiceHandler(snuttRestAdminApiMiddleware) {
2932
suspend fun insertNotification(req: ServerRequest) =
@@ -90,4 +93,46 @@ class AdminHandler(
9093

9194
popupService.deletePopup(popupId)
9295
}
96+
97+
suspend fun getDiaryQuestions(req: ServerRequest) =
98+
handle(req) {
99+
diaryService.getActiveQuestions()
100+
}
101+
102+
suspend fun insertDiaryQuestion(req: ServerRequest) =
103+
handle(req) {
104+
val body = req.awaitBody<DiaryAddQuestionRequestDto>()
105+
106+
diaryService.addQuestion(body)
107+
OkResponse()
108+
}
109+
110+
suspend fun removeDiaryQuestion(req: ServerRequest) =
111+
handle(req) {
112+
val questionId = req.pathVariable("id")
113+
114+
diaryService.removeQuestion(questionId)
115+
OkResponse()
116+
}
117+
118+
suspend fun getAllDiaryActivities(req: ServerRequest) =
119+
handle(req) {
120+
diaryService.getAllActivities()
121+
}
122+
123+
suspend fun insertDiaryActivity(req: ServerRequest) =
124+
handle(req) {
125+
val name = req.parseRequiredQueryParam<String>("name")
126+
127+
diaryService.addOrEnableActivity(name)
128+
OkResponse()
129+
}
130+
131+
suspend fun removeDiaryActivity(req: ServerRequest) =
132+
handle(req) {
133+
val name = req.parseRequiredQueryParam<String>("name")
134+
135+
diaryService.disableActivity(name)
136+
OkResponse()
137+
}
93138
}

api/src/main/kotlin/handler/BuildingHandler.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ class BuildingHandler(
1818
suspend fun searchBuildings(req: ServerRequest): ServerResponse =
1919
handle(req) {
2020
val placesQuery =
21-
req.parseRequiredQueryParam<String>("places")
21+
req
22+
.parseRequiredQueryParam<String>("places")
2223
.split(",")
2324
.flatMap { PlaceInfo.getValuesOf(it) }
2425
.distinct()

0 commit comments

Comments
 (0)