Skip to content

Commit 9e216b8

Browse files
authored
[refactor] 사용자 피드 인증 개별 날짜 조회 API 수정 (#230)
* #227 [refactor] dto 인증 시간 타입 변경 * #227 [refactor] repository 정렬 기준 변경 * #227 [refactor] response 인증 시간 타입 변환 * #227 [refactor] controller description 수정 * #227 [test] 테스트 코드 오류 수정
1 parent 7a95683 commit 9e216b8

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

src/main/kotlin/com/photi/server/api/controller/user/UserController.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class UserController(
101101
@Operation(
102102
summary = "사용자 피드 인증 개별 날짜 조회",
103103
security = [SecurityRequirement(name = ACCESS_TOKEN_KEY)],
104-
description = "챌린지 인증 시간 빠른순으로 정렬되어 조회됩니다."
104+
description = "피드 인증 시간 빠른순으로 정렬되어 조회됩니다."
105105
)
106106
@ApiResponse(responseCode = "200")
107107
@ApiErrorResponses([TOKEN_UNAUTHENTICATED, TOKEN_UNAUTHORIZED, DATE_FORMAT_INVALID])

src/main/kotlin/com/photi/server/api/controller/user/response/FindUserFeedsByDateResponse.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ data class FindUserFeedsByDateResponse(
2020
@Schema(description = "챌린지 이름", example = "신나게 하는 러닝 챌린지")
2121
val name: String,
2222

23-
@Schema(description = "챌린지 인증 시간", example = "13:00")
23+
@Schema(description = "피드 인증 시간", example = "13:00")
2424
@field:JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "kk:mm")
2525
val proveTime: LocalTime,
2626
) {
@@ -33,7 +33,7 @@ data class FindUserFeedsByDateResponse(
3333
feed.challengeId,
3434
feed.imageUrl,
3535
feed.name,
36-
feed.proveTime,
36+
feed.proveTime.toLocalTime(),
3737
)
3838
}
3939

src/main/kotlin/com/photi/server/domain/user/custom/UserCustomRepositoryImpl.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class UserCustomRepositoryImpl(
125125
feed.challenge.id,
126126
feed.imageUrl,
127127
feed.challenge.name,
128-
feed.challenge.proveTime
128+
feed.createDateTime,
129129
)
130130
)
131131
.from(feed)
@@ -137,7 +137,7 @@ class UserCustomRepositoryImpl(
137137
feed.createDateTime.month().eq(date.monthValue),
138138
feed.createDateTime.dayOfMonth().eq(date.dayOfMonth)
139139
)
140-
.orderBy(feed.challenge.proveTime.asc())
140+
.orderBy(feed.createDateTime.asc())
141141
.fetch()
142142
}
143143

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package com.photi.server.service.user.dto
22

33
import com.querydsl.core.annotations.QueryProjection
4-
import java.time.LocalTime
4+
import java.time.LocalDateTime
55

66
data class FindUserFeedsByDateDto @QueryProjection constructor(
77
val feedId: Long,
88
val challengeId: Long,
99
val imageUrl: String,
1010
val name: String,
11-
val proveTime: LocalTime,
11+
val proveTime: LocalDateTime,
1212
)

src/test/kotlin/com/photi/server/service/user/UserServiceTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ class UserServiceTest {
326326
1L,
327327
"https://url.kr/5MhHhD",
328328
"챌린지 이름",
329-
LocalTime.of(13, 0)
329+
LocalDateTime.of(2025, 6, 3, 13, 0)
330330
)
331331
}
332332

0 commit comments

Comments
 (0)