Skip to content

Commit

Permalink
feat: Add attribute has postFile
Browse files Browse the repository at this point in the history
  • Loading branch information
Minuooooo committed Jul 13, 2024
1 parent ca1ab1e commit f0050ea
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public class Post extends AuditEntity {
private String content;
@Column(nullable = false)
private Integer hits;
@Formula("(SELECT COUNT(*) FROM post_like pl WHERE pl.post_id = post_id)")
// 테이블에는 만들어지지 않는 가상 속성. 게시글을 좋아요 순으로 정렬할 때 사용 (api 요청할때 sort=likes,desc)
private boolean hasPostFile;
@Formula("(SELECT COUNT(*) FROM post_like pl WHERE pl.post_id = post_id)") // 테이블에는 만들어지지 않는 가상 속성. 게시글을 좋아요 순으로 정렬할 때 사용 (api 요청할때 sort=likes,desc)
private Integer likes;

public Boolean checkFileExist() {
Expand Down

0 comments on commit f0050ea

Please sign in to comment.