diff --git a/src/main/java/aws/teamthreefive/photo/controller/PhotoController.java b/src/main/java/aws/teamthreefive/photo/controller/PhotoController.java index cd77716..ee1d506 100644 --- a/src/main/java/aws/teamthreefive/photo/controller/PhotoController.java +++ b/src/main/java/aws/teamthreefive/photo/controller/PhotoController.java @@ -6,10 +6,7 @@ import aws.teamthreefive.photo.service.PhotoQueryService; import io.swagger.v3.oas.annotations.Operation; import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.CrossOrigin; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -31,4 +28,16 @@ public PhotoResponseDTO.PhotoListDTO getPhotoListNgAll() { } + @GetMapping("/list/ng/{photoPosition}") + @Operation(summary = "하단 카메라별 NG 사진 리스트", description = "카메라별 NG 사진 리스트 1 2 3 4 5") + public PhotoResponseDTO.PhotoListDTO getPhotoListNgCamera( + @PathVariable(name = "photoPosition") int photoPosition + ) { + + List photoList = photoQueryService.getPhotoListNgCamera(photoPosition); + + return PhotoConverter.photoListDTO(photoList); + + } + } diff --git a/src/main/java/aws/teamthreefive/photo/repository/PhotoRepository.java b/src/main/java/aws/teamthreefive/photo/repository/PhotoRepository.java index 4a8ed55..1c0d0f8 100644 --- a/src/main/java/aws/teamthreefive/photo/repository/PhotoRepository.java +++ b/src/main/java/aws/teamthreefive/photo/repository/PhotoRepository.java @@ -12,4 +12,6 @@ public interface PhotoRepository extends JpaRepository { List findAllByPhotoNgtypeNot(int photoNgtype); + List findAllByPhotoPosition(int photoPosition); + } diff --git a/src/main/java/aws/teamthreefive/photo/service/PhotoQueryService.java b/src/main/java/aws/teamthreefive/photo/service/PhotoQueryService.java index d079010..804584f 100644 --- a/src/main/java/aws/teamthreefive/photo/service/PhotoQueryService.java +++ b/src/main/java/aws/teamthreefive/photo/service/PhotoQueryService.java @@ -23,4 +23,12 @@ public List getPhotoListNgAll() { } + public List getPhotoListNgCamera(int photoPosition) { + + List photoList = photoRepository.findAllByPhotoPosition(photoPosition); + + return photoList; + + } + }