Skip to content

Commit

Permalink
🔥 단건조회 API 삭제
Browse files Browse the repository at this point in the history
* 소통 미스로 불필요한 API를 설계했었음
  • Loading branch information
youngreal committed Sep 11, 2024
1 parent 5f1549d commit 75e7a8a
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 66 deletions.
10 changes: 0 additions & 10 deletions src/main/java/com/dnd/dndtravel/map/controller/MapController.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -58,15 +57,6 @@ public List<AttractionRecordResponse> 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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -92,27 +91,6 @@ List<AttractionRecordResponse> 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 = "인증된 사용자의 방문 기록 수정"
)
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/com/dnd/dndtravel/map/service/MapService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -114,15 +113,6 @@ public List<AttractionRecordResponse> 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) {
Expand Down

This file was deleted.

0 comments on commit 75e7a8a

Please sign in to comment.