Skip to content

Commit

Permalink
[remove] 로그인 사용자에 따른 도시 보관 여부 조회 API 및 서비스 로직 삭제
Browse files Browse the repository at this point in the history
related to: #144
  • Loading branch information
jo0oy committed Feb 3, 2024
1 parent 5794445 commit 62ecd03
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.haejwo.tripcometrue.domain.store.dto.request.CityStoreRequestDto;
import com.haejwo.tripcometrue.domain.store.dto.request.PlaceStoreRequestDto;
import com.haejwo.tripcometrue.domain.store.dto.request.TripRecordStoreRequestDto;
import com.haejwo.tripcometrue.domain.store.dto.response.CheckCityStoredResponseDto;
import com.haejwo.tripcometrue.domain.store.dto.response.CityStoreResponseDto;
import com.haejwo.tripcometrue.domain.store.dto.response.PlaceStoreResponseDto;
import com.haejwo.tripcometrue.domain.store.dto.response.TripRecordStoreResponseDto;
Expand Down Expand Up @@ -118,18 +117,4 @@ public ResponseEntity<ResponseDTO<Long>> getStoredCountForTripRecord(@PathVariab
return ResponseEntity.ok(ResponseDTO.okWithData(count));
}

@GetMapping("/v1/cities/{cityId}/stores")
public ResponseEntity<ResponseDTO<CheckCityStoredResponseDto>> checkCityStoredByLoginMember(
@PathVariable("cityId") Long cityId,
@AuthenticationPrincipal PrincipalDetails principalDetails
) {

return ResponseEntity
.ok()
.body(
ResponseDTO.okWithData(
storeService.checkCityStoredByLoginMember(principalDetails, cityId)
)
);
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import com.haejwo.tripcometrue.domain.store.dto.request.CityStoreRequestDto;
import com.haejwo.tripcometrue.domain.store.dto.request.PlaceStoreRequestDto;
import com.haejwo.tripcometrue.domain.store.dto.request.TripRecordStoreRequestDto;
import com.haejwo.tripcometrue.domain.store.dto.response.CheckCityStoredResponseDto;
import com.haejwo.tripcometrue.domain.store.dto.response.CityStoreResponseDto;
import com.haejwo.tripcometrue.domain.store.dto.response.PlaceStoreResponseDto;
import com.haejwo.tripcometrue.domain.store.dto.response.TripRecordStoreResponseDto;
Expand All @@ -30,7 +29,6 @@
import com.haejwo.tripcometrue.global.exception.ErrorCode;
import com.haejwo.tripcometrue.global.springsecurity.PrincipalDetails;
import java.util.List;
import java.util.Objects;

import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
Expand Down Expand Up @@ -146,26 +144,6 @@ public void unstoreTripRecord(PrincipalDetails principalDetails, Long tripRecord
tripRecordStoreRepository.delete(tripRecordStore);
}

@Transactional(readOnly = true)
public CheckCityStoredResponseDto checkCityStoredByLoginMember(PrincipalDetails principalDetails, Long cityId) {

if (Objects.isNull(principalDetails)) {
return CheckCityStoredResponseDto.builder()
.isStored(false)
.build();
}

Long memberId = principalDetails.getMember().getId();

return CheckCityStoredResponseDto.builder()
.isStored(
cityStoreRepository
.findByMemberIdAndCityId(memberId, cityId)
.isPresent()
)
.build();
}

public Page<CityStoreResponseDto> getStoredCities(PrincipalDetails principalDetails, Pageable pageable) {
Page<CityStore> storedCities = cityStoreRepository.findByMember(principalDetails.getMember(), pageable);
return storedCities.map(CityStoreResponseDto::fromEntity);
Expand Down

0 comments on commit 62ecd03

Please sign in to comment.