Skip to content

Commit cf293d6

Browse files
authored
feat: 누락 응답값 추가 (#29)
1 parent a49c47b commit cf293d6

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

tuk-api/src/main/kotlin/nexters/tuk/application/gathering/GatheringCommandService.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package nexters.tuk.application.gathering
22

33
import nexters.tuk.application.gathering.dto.request.GatheringCommand
4+
import nexters.tuk.application.gathering.dto.response.GatheringResponse
45
import nexters.tuk.domain.gathering.GatheringRepository
56
import nexters.tuk.domain.gathering.findByIdOrThrow
67
import org.springframework.stereotype.Service
@@ -11,8 +12,14 @@ class GatheringCommandService(
1112
private val gatheringRepository: GatheringRepository,
1213
) {
1314
@Transactional
14-
fun updateGathering(command: GatheringCommand.Update) {
15+
fun updateGathering(command: GatheringCommand.Update): GatheringResponse.Simple {
1516
val gathering = gatheringRepository.findByIdOrThrow(command.gatheringId)
1617
gathering.update(command)
18+
19+
return GatheringResponse.Simple(
20+
gatheringId = gathering.id,
21+
gatheringName = gathering.name,
22+
intervalDays = gathering.intervalDays,
23+
)
1724
}
1825
}

tuk-api/src/main/kotlin/nexters/tuk/application/gathering/dto/response/GatheringResponse.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ class GatheringResponse {
1010
val gatheringId: Long,
1111
)
1212

13+
data class Simple(
14+
val gatheringId: Long,
15+
val gatheringName: String,
16+
val intervalDays: Long,
17+
)
18+
1319
@Schema(name = "GatheringOverviewsResponse")
1420
data class GatheringOverviews(
1521
@Schema(description = "총 데이터 수")

tuk-api/src/main/kotlin/nexters/tuk/ui/gathering/GatheringController.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ class GatheringController(
3636
@Authenticated memberId: Long,
3737
@PathVariable gatheringId: Long,
3838
@RequestBody request: GatheringDto.Request.Update,
39-
) {
40-
gatheringCommandService.updateGathering(request.toCommand(gatheringId))
39+
): ApiResponse<GatheringResponse.Simple> {
40+
val response = gatheringCommandService.updateGathering(request.toCommand(gatheringId))
41+
42+
return ApiResponse.ok(response)
4143
}
4244

4345
@GetMapping

tuk-api/src/main/kotlin/nexters/tuk/ui/gathering/GatheringSpec.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ interface GatheringSpec {
2727
@Parameter(hidden = true) memberId: Long,
2828
gatheringId: Long,
2929
request: GatheringDto.Request.Update,
30-
)
30+
): ApiResponse<GatheringResponse.Simple>
3131

3232
@Operation(
3333
summary = "사용자 모임 조회",

0 commit comments

Comments
 (0)