From 92060aa6d9c4d10cae46b3c4d9e4efd93040780b Mon Sep 17 00:00:00 2001 From: kwonjoosung Date: Fri, 11 Aug 2023 01:15:06 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=EB=B3=80=EA=B2=BD=20=EC=82=AC?= =?UTF-8?q?=ED=95=AD=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/crew/api/CrewController.java | 2 +- .../domain/crew/service/CrewService.java | 20 ++++++++++--------- .../domain/crew/service/CrewServiceImpl.java | 0 .../review/dto/response/ReviewResponse.java | 14 ++++++------- .../domain/crew/api/CrewControllerTest.java | 2 +- 5 files changed, 20 insertions(+), 18 deletions(-) delete mode 100644 src/main/java/com/prgrms/mukvengers/domain/crew/service/CrewServiceImpl.java diff --git a/src/main/java/com/prgrms/mukvengers/domain/crew/api/CrewController.java b/src/main/java/com/prgrms/mukvengers/domain/crew/api/CrewController.java index 797d448a..b9678048 100644 --- a/src/main/java/com/prgrms/mukvengers/domain/crew/api/CrewController.java +++ b/src/main/java/com/prgrms/mukvengers/domain/crew/api/CrewController.java @@ -6,7 +6,6 @@ import javax.validation.Valid; -import com.prgrms.mukvengers.domain.crew.service.CrewService; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; import org.springframework.data.web.PageableDefault; @@ -30,6 +29,7 @@ import com.prgrms.mukvengers.domain.crew.dto.response.CrewPageResponse; import com.prgrms.mukvengers.domain.crew.dto.response.CrewResponses; import com.prgrms.mukvengers.domain.crew.dto.response.CrewStatusResponse; +import com.prgrms.mukvengers.domain.crew.service.CrewService; import com.prgrms.mukvengers.global.auth.token.dto.jwt.JwtAuthentication; import com.prgrms.mukvengers.global.base.dto.ApiResponse; import com.prgrms.mukvengers.global.base.dto.IdResponse; diff --git a/src/main/java/com/prgrms/mukvengers/domain/crew/service/CrewService.java b/src/main/java/com/prgrms/mukvengers/domain/crew/service/CrewService.java index 3c4489c8..f197520a 100644 --- a/src/main/java/com/prgrms/mukvengers/domain/crew/service/CrewService.java +++ b/src/main/java/com/prgrms/mukvengers/domain/crew/service/CrewService.java @@ -27,6 +27,7 @@ import com.prgrms.mukvengers.domain.crew.model.Crew; import com.prgrms.mukvengers.domain.crew.model.vo.CrewStatus; import com.prgrms.mukvengers.domain.crew.repository.CrewRepository; +import com.prgrms.mukvengers.domain.crew.strategy.CrewStatusUpdater; import com.prgrms.mukvengers.domain.crewmember.dto.response.CrewMemberResponse; import com.prgrms.mukvengers.domain.crewmember.dto.response.MyCrewMemberResponse; import com.prgrms.mukvengers.domain.crewmember.exception.MemberNotFoundException; @@ -41,6 +42,7 @@ import com.prgrms.mukvengers.domain.user.exception.UserNotFoundException; import com.prgrms.mukvengers.domain.user.model.User; import com.prgrms.mukvengers.domain.user.repository.UserRepository; +import com.prgrms.mukvengers.global.base.dto.IdResponse; import com.prgrms.mukvengers.global.utils.GeometryUtils; import lombok.RequiredArgsConstructor; @@ -67,14 +69,14 @@ public IdResponse create(CreateCrewRequest createCrewRequest, Long userId) { Store store = storeMapper.toStore(createCrewRequest.createStoreRequest()); Crew crew = storeRepository.findByPlaceId(createCrewRequest.createStoreRequest().placeId()) - .map(findStore -> { - findStore.updateStore(store); - return crewMapper.toCrew(createCrewRequest, findStore); - }) - .orElseGet(() -> { - storeRepository.save(store); - return crewMapper.toCrew(createCrewRequest, store); - }); + .map(findStore -> { + findStore.updateStore(store); + return crewMapper.toCrew(createCrewRequest, findStore); + }) + .orElseGet(() -> { + storeRepository.save(store); + return crewMapper.toCrew(createCrewRequest, store); + }); CrewMember crewMember = crewMemberMapper.toCrewMember(crew, userId, CrewMemberRole.LEADER); crew.addCrewMember(crewMember); @@ -190,7 +192,7 @@ public CrewStatusResponse updateStatus(Long crewId, Long userId, CrewStatus crew crewMember.isNotLeader(); - crewStatusUpdater.updateStatus(crew,crewMember,crewStatus); + crewStatusUpdater.updateStatus(crew, crewMember, crewStatus); return new CrewStatusResponse(crew.getStatus()); } diff --git a/src/main/java/com/prgrms/mukvengers/domain/crew/service/CrewServiceImpl.java b/src/main/java/com/prgrms/mukvengers/domain/crew/service/CrewServiceImpl.java deleted file mode 100644 index e69de29b..00000000 diff --git a/src/main/java/com/prgrms/mukvengers/domain/review/dto/response/ReviewResponse.java b/src/main/java/com/prgrms/mukvengers/domain/review/dto/response/ReviewResponse.java index 88b29ca1..03c42e09 100644 --- a/src/main/java/com/prgrms/mukvengers/domain/review/dto/response/ReviewResponse.java +++ b/src/main/java/com/prgrms/mukvengers/domain/review/dto/response/ReviewResponse.java @@ -6,11 +6,11 @@ import com.prgrms.mukvengers.domain.user.dto.response.UserProfileResponse; public record ReviewResponse(UserProfileResponse reviewer, - UserProfileResponse reviewee, - CrewResponse crew, - LocalDateTime promiseTime, - String content, - Integer mannerScore, - Integer tasteScore - ) { + UserProfileResponse reviewee, + CrewResponse crew, + LocalDateTime promiseTime, + String content, + Integer mannerScore, + Integer tasteScore +) { } diff --git a/src/test/java/com/prgrms/mukvengers/domain/crew/api/CrewControllerTest.java b/src/test/java/com/prgrms/mukvengers/domain/crew/api/CrewControllerTest.java index 4907fe8f..dbcb4d5b 100644 --- a/src/test/java/com/prgrms/mukvengers/domain/crew/api/CrewControllerTest.java +++ b/src/test/java/com/prgrms/mukvengers/domain/crew/api/CrewControllerTest.java @@ -191,7 +191,7 @@ void getByUserId_success() throws Exception { .summary("사용자가 참여한 모든 모임 조회 API") .description( "사용자가 참여한 모든 모임을 조회합니다. " - + "현재 모집 중인 모임과 모집종료된 모임 모두 조회하며 모집중인 데이터가 먼저 정렬되고 그후 모집 종료된 데이터가 옵니다.") + + "현재 모집 중인 모임과 모집종료된 모임 모두 조회하며 모집중인 데이터가 먼저 정렬되고 그후 모집 종료된 데이터가 옵니다.") .responseSchema(CREW_RESPONSE) .responseFields( fieldWithPath("data.responses.[].currentMember").type(NUMBER).description("밥 모임 현재 인원"),