Skip to content

Commit

Permalink
Merge pull request #20 from AWS-CV-Project-3355/feat/#18-photo-list
Browse files Browse the repository at this point in the history
Photo List Camera
  • Loading branch information
melitina915 authored Nov 27, 2024
2 parents e2d6e49 + 9f7c640 commit d58eb47
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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<Photo> photoList = photoQueryService.getPhotoListNgCamera(photoPosition);

return PhotoConverter.photoListDTO(photoList);

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ public interface PhotoRepository extends JpaRepository<Photo, Long> {

List<Photo> findAllByPhotoNgtypeNot(int photoNgtype);

List<Photo> findAllByPhotoPosition(int photoPosition);

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,12 @@ public List<Photo> getPhotoListNgAll() {

}

public List<Photo> getPhotoListNgCamera(int photoPosition) {

List<Photo> photoList = photoRepository.findAllByPhotoPosition(photoPosition);

return photoList;

}

}

0 comments on commit d58eb47

Please sign in to comment.