Skip to content

Commit

Permalink
Merge branch 'develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
LEEJaeHyeok97 authored Nov 23, 2024
2 parents fe9043d + e195802 commit 020016e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;

@Getter
@Setter
@RequiredArgsConstructor
public class StoreTeamResponse {
Long id;
Integer remainPoint;
Expand Down
25 changes: 15 additions & 10 deletions src/main/java/com/jangburich/domain/store/service/StoreService.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,16 @@
import com.jangburich.domain.store.domain.StoreCreateRequestDTO;
import com.jangburich.domain.store.domain.StoreGetResponseDTO;
import com.jangburich.domain.store.domain.StoreTeam;
import com.jangburich.domain.store.domain.StoreTeamResponseDTO;
import com.jangburich.domain.store.domain.StoreUpdateRequestDTO;
import com.jangburich.domain.store.dto.StoreTeamResponse;
import com.jangburich.domain.store.dto.condition.StoreSearchCondition;
import com.jangburich.domain.store.dto.condition.StoreSearchConditionWithType;
import com.jangburich.domain.store.dto.response.OrdersDetailResponse;
import com.jangburich.domain.store.dto.response.OrdersGetResponse;
import com.jangburich.domain.store.dto.response.OrdersTodayResponse;
import com.jangburich.domain.store.dto.response.PaymentGroupDetailResponse;
import com.jangburich.domain.store.dto.response.SearchStoresResponse;
import com.jangburich.domain.store.dto.response.StoreSearchDetailsResponse;
import com.jangburich.domain.store.exception.OrdersNotFoundException;
import com.jangburich.domain.store.repository.StoreRepository;
import com.jangburich.domain.store.repository.StoreTeamRepository;
Expand Down Expand Up @@ -222,10 +223,13 @@ public List<com.jangburich.domain.store.dto.StoreTeamResponse> getPaymentGroup(S
Store store = storeRepository.findByOwner(owner)
.orElseThrow(() -> new DefaultNullPointerException(ErrorCode.INVALID_AUTHENTICATION));

List<com.jangburich.domain.store.dto.StoreTeamResponse> list = storeTeamRepository.findAllByStore(store).stream().map(storeTeamResponseDTO -> new StoreTeamResponse(storeTeamResponseDTO.id(), storeTeamResponseDTO.remainPoint(),
return storeTeamRepository.findAllByStore(store)
.stream()
.map(storeTeamResponseDTO -> new StoreTeamResponse(storeTeamResponseDTO.id(),
storeTeamResponseDTO.remainPoint(),
storeTeamResponseDTO.teamId(), storeTeamResponseDTO.teamName(), storeTeamResponseDTO.teamDescription(),
storeTeamResponseDTO.storeId(), storeTeamResponseDTO.updatedAt(), store.getMaxReservation())).toList();
return list;
storeTeamResponseDTO.storeId(), storeTeamResponseDTO.updatedAt(), store.getMaxReservation()))
.toList();
}

public Page<SearchStoresResponse> searchByCategory(final String authentication, final Integer searchRadius,
Expand All @@ -236,7 +240,8 @@ public Page<SearchStoresResponse> searchByCategory(final String authentication,
pageable);
}

public Page<SearchStoresResponse> searchStores(final String authentication, final String keyword, final Pageable pageable) {
public Page<SearchStoresResponse> searchStores(final String authentication, final String keyword,
final Pageable pageable) {
User user = userRepository.findByProviderId(authentication)
.orElseThrow(() -> new DefaultNullPointerException(ErrorCode.INVALID_AUTHENTICATION));
return storeRepository.findStores(user.getUserId(), keyword, pageable);
Expand Down Expand Up @@ -399,13 +404,13 @@ public OrdersDetailResponse getOrderDetails(String userId, Long orderId) {
return ordersDetailResponse;
}

public StoreSearchDetailsResponse storeSearchDetails(String userId, Long storeId) {
public StoreSearchDetailsResponse storeSearchDetails(String userId, Long storeId) {
User user = userRepository.findByProviderId(userId)
.orElseThrow(() -> new DefaultNullPointerException(ErrorCode.INVALID_AUTHENTICATION));
.orElseThrow(() -> new DefaultNullPointerException(ErrorCode.INVALID_AUTHENTICATION));

StoreSearchDetailsResponse storeSearchDetails = storeRepository.findStoreSearchDetails(user.getUserId(),
storeId);
storeId);

return storeSearchDetails;
}
}
}
}

0 comments on commit 020016e

Please sign in to comment.