-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
7 changed files
with
45 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...in/java/com/api/readinglog/domain/likesummary/repository/CustomLikeSummaryRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.api.readinglog.domain.likesummary.repository; | ||
|
||
public interface CustomLikeSummaryRepository { | ||
|
||
long getLikeTotalCountInMonth(Long memberId, int month); | ||
} |
22 changes: 22 additions & 0 deletions
22
...ava/com/api/readinglog/domain/likesummary/repository/CustomLikeSummaryRepositoryImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.api.readinglog.domain.likesummary.repository; | ||
|
||
import static com.api.readinglog.domain.likesummary.entity.QLikeSummary.likeSummary; | ||
|
||
import com.querydsl.jpa.impl.JPAQueryFactory; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@RequiredArgsConstructor | ||
public class CustomLikeSummaryRepositoryImpl implements CustomLikeSummaryRepository { | ||
|
||
private final JPAQueryFactory queryFactory; | ||
|
||
@Override | ||
public long getLikeTotalCountInMonth(Long memberId, int month) { | ||
return queryFactory | ||
.select(likeSummary.count()) | ||
.from(likeSummary) | ||
.where(likeSummary.member.id.eq(memberId).and(likeSummary.createdAt.month().eq(month))) | ||
.fetchFirst(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
insert into member(member_id, member_email, member_nickname, member_password, member_profile_img, member_role, | ||
created_at, modified_at, deleted_at) | ||
values (1, '[email protected]', '동민', '{noop}1234', 'default.png', 'member_normal', now(), now(), null); | ||
insert into member(member_id, member_email, member_nickname, member_password, member_profile_img, member_role, | ||
created_at, modified_at, deleted_at) | ||
values (2, '[email protected]', '동민22', '{noop}1234', 'default.png', 'member_normal', now(), now(), null); | ||
|
||
insert into book (book_id, member_id, book_item_id, book_title, book_author, book_publisher, book_category, book_cover, created_at, modified_at, deleted_at) values (1, 1, null, 'Report, The (Gozaresh)', 'hmival0', 'Anheuser-Busch Inbev SA', 'Oyondu', 'http://dummyimage.com/159x100.png/ff4444/ffffff', '2024-03-13 07:37:09', '2024-03-05 20:23:56', null); | ||
insert into book (book_id, member_id, book_item_id, book_title, book_author, book_publisher, book_category, book_cover, created_at, modified_at, deleted_at) values (2, 1, null, 'Formula, The', 'tcrookshank1', 'Viad Corp', 'Mydeo', 'http://dummyimage.com/116x100.png/dddddd/000000', '2024-03-12 23:27:43', '2024-03-09 00:25:25', null); | ||
|
@@ -63,3 +66,9 @@ insert into summary (summary_id, member_id, book_id, summary_content, created_at | |
insert into summary (summary_id, member_id, book_id, summary_content, created_at, modified_at, deleted_at) values (28, 1, 28, 'Streamlined mobile capacity', '2024-03-24 12:31:10', '2024-03-11 19:23:06', null); | ||
insert into summary (summary_id, member_id, book_id, summary_content, created_at, modified_at, deleted_at) values (29, 1, 29, 'Cross-group intermediate superstructure', '2024-03-19 07:58:29', '2024-03-17 03:57:50', null); | ||
insert into summary (summary_id, member_id, book_id, summary_content, created_at, modified_at, deleted_at) values (30, 1, 30, 'De-engineered demand-driven open architecture', '2024-03-13 14:06:05', '2024-03-02 14:13:32', null); | ||
|
||
insert into like_summary(id, member_id, summary_id, created_at, modified_at, deleted_at) values (1, 1, 1, now(), now(), null); | ||
insert into like_summary(id, member_id, summary_id, created_at, modified_at, deleted_at) values (2, 1, 2, now(), now(), null); | ||
insert into like_summary(id, member_id, summary_id, created_at, modified_at, deleted_at) values (3, 1, 3, now(), now(), null); | ||
insert into like_summary(id, member_id, summary_id, created_at, modified_at, deleted_at) values (4, 1, 4, now(), now(), null); | ||
insert into like_summary(id, member_id, summary_id, created_at, modified_at, deleted_at) values (5, 1, 5, now(), now(), null); |