Skip to content

Commit

Permalink
[Feat] Photo Details
Browse files Browse the repository at this point in the history
Diecast List only NG
  • Loading branch information
melitina915 committed Nov 27, 2024
1 parent 108321c commit 942b3e8
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ public DiecastResponseDTO.DiecastListDTO getDiecastList() {

}

@GetMapping(value = "/list/ng")
@Operation(summary = "객체(오브젝트) 리스트 NG만 보기 API", description = "좌측 객체 오브젝트 리스트 NG만 보기 조회")
public DiecastResponseDTO.DiecastListDTO getDiecastListNg() {

List<Diecast> diecastList = diecastQueryService.getDiecastListNg();

return DiecastConverter.diecastListDTO(diecastList);

}

@GetMapping(value = "/graph/okng")
@Operation(summary = "전체 양불판정 그래프 조회", description = "좌측 양불판정 통계 그래프에 NG OK 개수 보여주기")
public DiecastResponseDTO.DiecastGraphDTO getDiecastGraphOkng() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import aws.teamthreefive.diecast.entity.Diecast;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

Expand All @@ -11,4 +10,6 @@ public interface DiecastRepository extends JpaRepository<Diecast, Long> {
// @Query("SELECT d.diecastOkng, COUNT(d) FROM Diecast d GROUP BY d.diecastOkng")
// List<Object[]> countByDiecastOkng();

List<Diecast> findAllByDiecastOkngNot(int diecastOkng);

}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ public List<Diecast> getDiecastList() {

}

public List<Diecast> getDiecastListNg() {

List<Diecast> diecastList = diecastRepository.findAllByDiecastOkngNot(0);

return diecastList;

}

public DiecastResponseDTO.DiecastGraphDTO getDiecastGraphOkng() {

List<Diecast> diecastList = diecastRepository.findAll();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,16 @@ public PhotoResponseDTO.PhotoGraphDTO getPhotoGraphNgTypePhotoPosition(

}

@GetMapping(value = "/{photoUuid}")
@Operation(summary = "NG 사진 세부 조회", description = "NG 사진 세부 조회")
public PhotoResponseDTO.PhotoDTO getPhoto(
@PathVariable(name = "photoUuid") Long photoUuid
) {

Photo photo = photoQueryService.getPhoto(photoUuid);

return PhotoConverter.photoDTO(photo);

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,12 @@ public PhotoResponseDTO.PhotoGraphDTO getPhotoGraphNgTypePhotoPosition(int photo

}

public Photo getPhoto(Long photoUuid) {

Photo photo = photoRepository.findById(photoUuid).get();

return photo;

}

}

0 comments on commit 942b3e8

Please sign in to comment.