Skip to content

Commit

Permalink
Merge pull request #145 from 9oormthon-univ/fix/store
Browse files Browse the repository at this point in the history
feat : updatedAt ์ถ”๊ฐ€
  • Loading branch information
HyunWoo9930 authored Nov 23, 2024
2 parents d9c1277 + e483b78 commit 462a66c
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions src/main/java/com/jangburich/domain/store/service/StoreService.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.jangburich.domain.store.service;

import com.jangburich.domain.store.dto.response.StoreSearchDetailsResponse;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
Expand Down Expand Up @@ -32,16 +31,14 @@
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,12 +219,13 @@ public List<StoreTeamResponse> getPaymentGroup(String userId) {
Store store = storeRepository.findByOwner(owner)
.orElseThrow(() -> new DefaultNullPointerException(ErrorCode.INVALID_AUTHENTICATION));

List<StoreTeamResponse> list = storeTeamRepository.findAllByStore(store).stream().map(storeTeamResponseDTO -> {
return 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 @@ -238,7 +236,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 @@ -401,13 +400,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 462a66c

Please sign in to comment.