Skip to content

Commit

Permalink
feat(#125) : image 조회 로직 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
yeon015 committed Aug 12, 2023
1 parent 88049df commit 00e23cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/main/java/trothly/trothcam/domain/image/Image.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ public class Image extends BaseTimeEntity {
@Enumerated(EnumType.STRING)
private Share share;

@Column(name = "image_content", nullable = true)
private String content;

@Column(name = "image_lens", nullable = true)
private String lens;

Expand Down
8 changes: 8 additions & 0 deletions src/main/java/trothly/trothcam/service/ImageService.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,12 @@ public CheckImgHashResDto checkImgHash(ImgHashReqDto req) throws BaseException {
return new CheckImgHashResDto("인증된 해시값입니다.");
}

//이미지 찾기
public Optional<Image> findImage(Long id) throws BaseException{
Optional<Image> image = imageRepository.findById(id);
if(image.isEmpty()) {
throw new BadRequestException("이미지가 존재하지 않습니다.");
}
return image;
}
}

0 comments on commit 00e23cf

Please sign in to comment.