Skip to content

Commit

Permalink
chore: 변경 사항 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
JoosungKwon committed Aug 10, 2023
1 parent 55f2ab9 commit 92060aa
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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());
}
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -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
) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ void getByUserId_success() throws Exception {
.summary("사용자가 참여한 모든 모임 조회 API")
.description(
"사용자가 참여한 모든 모임을 조회합니다. "
+ "현재 모집 중인 모임과 모집종료된 모임 모두 조회하며 모집중인 데이터가 먼저 정렬되고 그후 모집 종료된 데이터가 옵니다.")
+ "현재 모집 중인 모임과 모집종료된 모임 모두 조회하며 모집중인 데이터가 먼저 정렬되고 그후 모집 종료된 데이터가 옵니다.")
.responseSchema(CREW_RESPONSE)
.responseFields(
fieldWithPath("data.responses.[].currentMember").type(NUMBER).description("밥 모임 현재 인원"),
Expand Down

0 comments on commit 92060aa

Please sign in to comment.