diff --git a/src/main/java/com/dnd/dndtravel/map/controller/MapController.java b/src/main/java/com/dnd/dndtravel/map/controller/MapController.java index 3478588..1cf0083 100644 --- a/src/main/java/com/dnd/dndtravel/map/controller/MapController.java +++ b/src/main/java/com/dnd/dndtravel/map/controller/MapController.java @@ -20,7 +20,6 @@ import com.dnd.dndtravel.map.controller.request.validation.PhotoValidation; import com.dnd.dndtravel.map.controller.swagger.MapControllerSwagger; import com.dnd.dndtravel.map.service.MapService; -import com.dnd.dndtravel.map.service.dto.response.AttractionRecordDetailViewResponse; import com.dnd.dndtravel.map.service.dto.response.AttractionRecordResponse; import com.dnd.dndtravel.map.service.dto.response.RegionResponse; @@ -58,15 +57,6 @@ public List findRecords( return mapService.allRecords(authenticationMember.id(), cursorNo, displayPerPage); } - // 기록 단건 조회 - @GetMapping("/maps/history/{recordId}") - public AttractionRecordDetailViewResponse findRecord( - AuthenticationMember authenticationMember, - @PathVariable long recordId - ) { - return mapService.findOneVisitRecord(authenticationMember.id(), recordId); - } - @PutMapping(value = "/maps/history/{recordId}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) public void updateRecord( AuthenticationMember authenticationMember, diff --git a/src/main/java/com/dnd/dndtravel/map/controller/swagger/MapControllerSwagger.java b/src/main/java/com/dnd/dndtravel/map/controller/swagger/MapControllerSwagger.java index 9c2786a..effc93e 100644 --- a/src/main/java/com/dnd/dndtravel/map/controller/swagger/MapControllerSwagger.java +++ b/src/main/java/com/dnd/dndtravel/map/controller/swagger/MapControllerSwagger.java @@ -8,7 +8,6 @@ import com.dnd.dndtravel.config.AuthenticationMember; import com.dnd.dndtravel.map.controller.request.RecordRequest; import com.dnd.dndtravel.map.controller.request.UpdateRecordRequest; -import com.dnd.dndtravel.map.service.dto.response.AttractionRecordDetailViewResponse; import com.dnd.dndtravel.map.service.dto.response.AttractionRecordResponse; import com.dnd.dndtravel.map.service.dto.response.RegionResponse; @@ -92,27 +91,6 @@ List findRecords( int displayPerPage ); - @Operation( - summary = "인증된 사용자의 방문 기록 단건 조회" - ) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "정상조회, 단일 JSON객체 반환", - content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, - schema = @Schema(implementation = AttractionRecordDetailViewResponse.class))), - @ApiResponse(responseCode = "400", description = "유저정보나 방문기록이 유효하지 않은경우", - content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, - schema = @Schema(example = STATUS_CODE_400_BODY_MESSAGE) - ) - ), - }) - @AuthenticationCommonResponse - AttractionRecordDetailViewResponse findRecord( - @Parameter(hidden = true) - AuthenticationMember authenticationMember, - @Parameter(description = "방문기록 id값", required = true) - long recordId - ); - @Operation( summary = "인증된 사용자의 방문 기록 수정" ) diff --git a/src/main/java/com/dnd/dndtravel/map/service/MapService.java b/src/main/java/com/dnd/dndtravel/map/service/MapService.java index b9f43bd..c582467 100644 --- a/src/main/java/com/dnd/dndtravel/map/service/MapService.java +++ b/src/main/java/com/dnd/dndtravel/map/service/MapService.java @@ -21,7 +21,6 @@ import com.dnd.dndtravel.map.repository.dto.projection.AttractionPhotoProjection; import com.dnd.dndtravel.map.repository.dto.projection.RecordProjection; import com.dnd.dndtravel.map.service.dto.RegionDto; -import com.dnd.dndtravel.map.service.dto.response.AttractionRecordDetailViewResponse; import com.dnd.dndtravel.map.service.dto.response.AttractionRecordResponse; import com.dnd.dndtravel.map.service.dto.response.RegionResponse; import com.dnd.dndtravel.map.repository.AttractionRepository; @@ -114,15 +113,6 @@ public List allRecords(long memberId, long cursorNo, i .toList(); } - //기록 단건 조회 - @Transactional(readOnly = true) - public AttractionRecordDetailViewResponse findOneVisitRecord(long memberId, long memberAttractionId) { - //todo memberAttraction 쿼리한방으로 줄일수도 있을것같다. - Member member = memberRepository.findById(memberId).orElseThrow(() -> new MemberNotFoundException(memberId)); - MemberAttraction memberAttraction = memberAttractionRepository.findById(memberAttractionId).orElseThrow(() -> new MemberAttractionNotFoundException(memberAttractionId)); - return AttractionRecordDetailViewResponse.from(memberAttraction); - } - // 방문기록 수정 @Transactional public void updateVisitRecord(RecordDto dto, long memberId, long memberAttractionId) { diff --git a/src/main/java/com/dnd/dndtravel/map/service/dto/response/AttractionRecordDetailViewResponse.java b/src/main/java/com/dnd/dndtravel/map/service/dto/response/AttractionRecordDetailViewResponse.java deleted file mode 100644 index 3548b80..0000000 --- a/src/main/java/com/dnd/dndtravel/map/service/dto/response/AttractionRecordDetailViewResponse.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.dnd.dndtravel.map.service.dto.response; - -import java.time.LocalDate; - -import com.dnd.dndtravel.map.domain.MemberAttraction; - -import lombok.Builder; - -@Builder -public record AttractionRecordDetailViewResponse( - String region, - String attractionName, - String memo, - LocalDate visitDate -) { - public static AttractionRecordDetailViewResponse from(MemberAttraction memberAttraction) { - return AttractionRecordDetailViewResponse.builder() - .region(memberAttraction.getRegion()) - .attractionName(memberAttraction.getAttraction().getName()) //todo 이 구조가 좋을지, attraction.findById로 가져오는게 좋을지 고민해봐야 한다 - .memo(memberAttraction.getMemo()) - .visitDate(memberAttraction.getLocalDate()) - .build(); - } -}