From cc035f7971ce36f1cc39b2e83a9dfbddc9fce44d Mon Sep 17 00:00:00 2001 From: Sujung Shin <113707388+chock-cho@users.noreply.github.com> Date: Sun, 14 Dec 2025 18:11:00 +0900 Subject: [PATCH] =?UTF-8?q?[YS-589]=20feature:=20=EA=B3=B5=EA=B3=A0=20?= =?UTF-8?q?=EB=AA=A9=EB=A1=9D=20=EC=A1=B0=ED=9A=8C=20=EC=8B=9C=20=EC=9D=91?= =?UTF-8?q?=EB=8B=B5=EA=B0=92=EC=97=90=20timeRequired(=EC=86=8C=EC=9A=94?= =?UTF-8?q?=EC=8B=9C=EA=B0=84),=20count(=ED=9A=9F=EC=88=98)=20=EC=BB=AC?= =?UTF-8?q?=EB=9F=BC=20=EC=B6=94=EA=B0=80=20(#174)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feature: add timeRequired, count field to ExperimentPost responses * fix: add fixture to non-import classes * fix: fix compile errors --- .../dobby/usecase/experiment/CreateExperimentPostUseCase.kt | 4 ++++ .../dobby/usecase/experiment/GetExperimentPostsUseCase.kt | 5 +++++ .../dobby/usecase/experiment/UpdateExperimentPostUseCase.kt | 4 ++++ .../usecase/experiment/GetExperimentPostsUseCaseTest.kt | 2 ++ .../com/dobby/api/dto/response/experiment/PostInfo.kt | 4 +++- .../kotlin/com/dobby/api/mapper/ExperimentPostMapper.kt | 6 ++++++ 6 files changed, 24 insertions(+), 1 deletion(-) diff --git a/application/src/main/kotlin/com/dobby/usecase/experiment/CreateExperimentPostUseCase.kt b/application/src/main/kotlin/com/dobby/usecase/experiment/CreateExperimentPostUseCase.kt index d89dac7e..225d26d9 100644 --- a/application/src/main/kotlin/com/dobby/usecase/experiment/CreateExperimentPostUseCase.kt +++ b/application/src/main/kotlin/com/dobby/usecase/experiment/CreateExperimentPostUseCase.kt @@ -74,6 +74,8 @@ class CreateExperimentPostUseCase( val postId: String, val title: String, val views: Int, + val timeRequired: TimeSlot?, + val count: Int?, val isOnCampus: Boolean, val place: String?, val reward: String?, @@ -143,6 +145,8 @@ class CreateExperimentPostUseCase( postId = savedExperimentPost.id, title = savedExperimentPost.title, views = savedExperimentPost.views, + timeRequired = savedExperimentPost.timeRequired, + count = savedExperimentPost.count, isOnCampus = savedExperimentPost.isOnCampus, place = savedExperimentPost.place, durationInfo = DurationInfo( diff --git a/application/src/main/kotlin/com/dobby/usecase/experiment/GetExperimentPostsUseCase.kt b/application/src/main/kotlin/com/dobby/usecase/experiment/GetExperimentPostsUseCase.kt index b64cf3cd..01e6c7f8 100644 --- a/application/src/main/kotlin/com/dobby/usecase/experiment/GetExperimentPostsUseCase.kt +++ b/application/src/main/kotlin/com/dobby/usecase/experiment/GetExperimentPostsUseCase.kt @@ -4,6 +4,7 @@ import com.dobby.enums.MatchType import com.dobby.enums.areaInfo.Area import com.dobby.enums.areaInfo.Region import com.dobby.enums.experiment.RecruitStatus +import com.dobby.enums.experiment.TimeSlot import com.dobby.enums.member.GenderType import com.dobby.gateway.experiment.ExperimentPostGateway import com.dobby.model.experiment.CustomFilter @@ -51,6 +52,8 @@ class GetExperimentPostsUseCase( val experimentPostId: String, val title: String, val views: Int, + val count: Int?, + val timeRequired: TimeSlot?, val isOnCampus: Boolean, val place: String?, val reward: String, @@ -83,6 +86,8 @@ class GetExperimentPostsUseCase( experimentPostId = post.id, title = post.title, views = post.views, + count = post.count, + timeRequired = post.timeRequired, isOnCampus = post.isOnCampus, place = post.place, reward = post.reward, diff --git a/application/src/main/kotlin/com/dobby/usecase/experiment/UpdateExperimentPostUseCase.kt b/application/src/main/kotlin/com/dobby/usecase/experiment/UpdateExperimentPostUseCase.kt index 81b32e2d..136e098b 100644 --- a/application/src/main/kotlin/com/dobby/usecase/experiment/UpdateExperimentPostUseCase.kt +++ b/application/src/main/kotlin/com/dobby/usecase/experiment/UpdateExperimentPostUseCase.kt @@ -70,6 +70,8 @@ class UpdateExperimentPostUseCase( val postId: String, val title: String, val views: Int, + val timeRequired: TimeSlot?, + val count: Int?, val isOnCampus: Boolean, val place: String?, val reward: String?, @@ -125,6 +127,8 @@ class UpdateExperimentPostUseCase( postId = updatedPost.id, title = updatedPost.title, views = updatedPost.views, + timeRequired = updatedPost.timeRequired, + count = updatedPost.count, isOnCampus = updatedPost.isOnCampus, place = updatedPost.place, reward = updatedPost.reward, diff --git a/application/src/test/kotlin/com/dobby/usecase/experiment/GetExperimentPostsUseCaseTest.kt b/application/src/test/kotlin/com/dobby/usecase/experiment/GetExperimentPostsUseCaseTest.kt index 02f3267a..222766f1 100644 --- a/application/src/test/kotlin/com/dobby/usecase/experiment/GetExperimentPostsUseCaseTest.kt +++ b/application/src/test/kotlin/com/dobby/usecase/experiment/GetExperimentPostsUseCaseTest.kt @@ -114,6 +114,8 @@ class GetExperimentPostsUseCaseTest : BehaviorSpec({ result.first().postInfo.title shouldBe "야뿌 피자 먹방 테스트" result.first().postInfo.place shouldBe "야뿌 대학교" result.first().postInfo.reward shouldBe "스타벅스 1만원권 쿠폰" + result.first().postInfo.timeRequired shouldBe TimeSlot.ABOUT_1H + result.first().postInfo.count shouldBe 10 result.first().postInfo.recruitStatus shouldBe false } } diff --git a/presentation/src/main/kotlin/com/dobby/api/dto/response/experiment/PostInfo.kt b/presentation/src/main/kotlin/com/dobby/api/dto/response/experiment/PostInfo.kt index 43a112cd..181bf84e 100644 --- a/presentation/src/main/kotlin/com/dobby/api/dto/response/experiment/PostInfo.kt +++ b/presentation/src/main/kotlin/com/dobby/api/dto/response/experiment/PostInfo.kt @@ -1,10 +1,12 @@ package com.dobby.api.dto.response.experiment - +import com.dobby.enums.experiment.TimeSlot import java.time.LocalDate data class PostInfo( val experimentPostId: String, val title: String, val views: Int, + val timeRequired: TimeSlot?, + val count: Int?, val isOnCampus: Boolean, val place: String?, val reward: String?, diff --git a/presentation/src/main/kotlin/com/dobby/api/mapper/ExperimentPostMapper.kt b/presentation/src/main/kotlin/com/dobby/api/mapper/ExperimentPostMapper.kt index de734092..5a906cb0 100644 --- a/presentation/src/main/kotlin/com/dobby/api/mapper/ExperimentPostMapper.kt +++ b/presentation/src/main/kotlin/com/dobby/api/mapper/ExperimentPostMapper.kt @@ -104,6 +104,8 @@ object ExperimentPostMapper { experimentPostId = input.postId, title = input.title, views = input.views, + timeRequired = input.timeRequired, + count = input.count, isOnCampus = input.isOnCampus, durationInfo = DurationInfo( startDate = input.durationInfo?.startDate, @@ -142,6 +144,8 @@ object ExperimentPostMapper { experimentPostId = input.postId, title = input.title, views = input.views, + timeRequired = input.timeRequired, + count = input.count, durationInfo = DurationInfo( startDate = input.durationInfo?.startDate, endDate = input.durationInfo?.endDate @@ -405,6 +409,8 @@ object ExperimentPostMapper { experimentPostId = post.postInfo.experimentPostId, title = post.postInfo.title, views = post.postInfo.views, + count = post.postInfo.count, + timeRequired = post.postInfo.timeRequired, isOnCampus = post.postInfo.isOnCampus, place = post.postInfo.place, reward = post.postInfo.reward,