File tree Expand file tree Collapse file tree 4 files changed +19
-4
lines changed
tuk-api/src/main/kotlin/nexters/tuk Expand file tree Collapse file tree 4 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 11package nexters.tuk.application.gathering
22
33import nexters.tuk.application.gathering.dto.request.GatheringCommand
4+ import nexters.tuk.application.gathering.dto.response.GatheringResponse
45import nexters.tuk.domain.gathering.GatheringRepository
56import nexters.tuk.domain.gathering.findByIdOrThrow
67import 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}
Original file line number Diff line number Diff 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 = " 총 데이터 수" )
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 = " 사용자 모임 조회" ,
You can’t perform that action at this time.
0 commit comments