-
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.
시험 목록과 시험 상세 페이지에서 좋아요 수를 확인할 수 있다. (#30)
* feat: 시험 목록, 나의 제출된 시험 조회 시 좋아요 수 포함 * refactor: 내가 제출한 시험에 좋아요 수 는 제거 * feat: 시험 상세 요약 조회 시 로그인 여부에 따라 좋아요 여부 조회 * refactor: ExamDetail과 ExamDetailSummary로 응답 분리 * feat: client like, unlike api 요청 구현 * refactor: 사용하지 않는 interface 제거 * feat: like, unlike mutation 구현 * feat: useExamLikeManager를 통한 좋아요 토글 hook 구현 * refactor: remove select updatedAt * feat: add pagination query index * refactor: ddl 컬럼 이름 변경 및 인덱스 수정 * refactor: 전체 시험 목록과 내 시험 목록 interface 분리 * refactor: exam querydsl leftjoin이 필요한 곳 수정 * refactor: exam querydsl submission 부분 join으로 변경 * fix: submitted exam ids group by exam id! * refactor: 문항 수 아이콘으로 변경 * feat: useExamLikeeManager 낙관적 업데이트 * feat: 좋아요 invalidate queries에 디바운스 300ms * feat: exam intro의 좋아요 버튼 * refactor: LikeService 코드 구조 변경
- Loading branch information
Showing
37 changed files
with
3,215 additions
and
898 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
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: 3 additions & 3 deletions
6
server/src/main/java/com/fluffy/exam/application/ExamLikeService.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
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
18 changes: 18 additions & 0 deletions
18
server/src/main/java/com/fluffy/exam/application/response/ExamDetailSummaryResponse.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,18 @@ | ||
package com.fluffy.exam.application.response; | ||
|
||
import com.fluffy.exam.domain.dto.AuthorDto; | ||
import java.time.LocalDateTime; | ||
|
||
public record ExamDetailSummaryResponse( | ||
Long id, | ||
String title, | ||
String description, | ||
String status, | ||
AuthorDto author, | ||
Long questionCount, | ||
Long likeCount, | ||
boolean isLiked, | ||
LocalDateTime createdAt, | ||
LocalDateTime updatedAt | ||
) { | ||
} |
7 changes: 6 additions & 1 deletion
7
server/src/main/java/com/fluffy/exam/domain/ExamRepositoryCustom.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 |
---|---|---|
@@ -1,15 +1,20 @@ | ||
package com.fluffy.exam.domain; | ||
|
||
import com.fluffy.exam.domain.dto.ExamDetailSummaryDto; | ||
import com.fluffy.exam.domain.dto.ExamSummaryDto; | ||
import com.fluffy.exam.domain.dto.MyExamSummaryDto; | ||
import com.fluffy.exam.domain.dto.SubmittedExamSummaryDto; | ||
import java.util.Optional; | ||
import org.springframework.data.domain.Page; | ||
import org.springframework.data.domain.Pageable; | ||
|
||
public interface ExamRepositoryCustom { | ||
|
||
Page<ExamSummaryDto> findPublishedExamSummaries(Pageable pageable); | ||
|
||
Page<ExamSummaryDto> findMyExamSummaries(Pageable pageable, ExamStatus status, Long memberId); | ||
Page<MyExamSummaryDto> findMyExamSummaries(Pageable pageable, ExamStatus status, Long memberId); | ||
|
||
Page<SubmittedExamSummaryDto> findSubmittedExamSummaries(Pageable pageable, Long memberId); | ||
|
||
Optional<ExamDetailSummaryDto> findExamDetailSummary(Long examId); | ||
} |
46 changes: 46 additions & 0 deletions
46
server/src/main/java/com/fluffy/exam/domain/dto/ExamDetailSummaryDto.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,46 @@ | ||
package com.fluffy.exam.domain.dto; | ||
|
||
import com.fluffy.exam.domain.ExamStatus; | ||
import com.querydsl.core.annotations.QueryProjection; | ||
import java.time.LocalDateTime; | ||
import lombok.AccessLevel; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class ExamDetailSummaryDto { | ||
|
||
Long id; | ||
String title; | ||
String description; | ||
ExamStatus status; | ||
AuthorDto author; | ||
Long questionCount; | ||
Long likeCount; | ||
LocalDateTime createdAt; | ||
LocalDateTime updatedAt; | ||
|
||
@QueryProjection | ||
public ExamDetailSummaryDto( | ||
Long id, | ||
String title, | ||
String description, | ||
ExamStatus status, | ||
AuthorDto author, | ||
Long questionCount, | ||
Long likeCount, | ||
LocalDateTime createdAt, | ||
LocalDateTime updatedAt | ||
) { | ||
this.id = id; | ||
this.title = title; | ||
this.description = description; | ||
this.status = status; | ||
this.author = author; | ||
this.questionCount = questionCount; | ||
this.likeCount = likeCount; | ||
this.createdAt = createdAt; | ||
this.updatedAt = updatedAt; | ||
} | ||
} |
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
44 changes: 44 additions & 0 deletions
44
server/src/main/java/com/fluffy/exam/domain/dto/MyExamSummaryDto.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,44 @@ | ||
package com.fluffy.exam.domain.dto; | ||
|
||
import com.fluffy.exam.domain.ExamStatus; | ||
import com.querydsl.core.annotations.QueryProjection; | ||
import java.time.LocalDateTime; | ||
import lombok.AccessLevel; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class MyExamSummaryDto { | ||
|
||
private Long id; | ||
private String title; | ||
private String description; | ||
private ExamStatus status; | ||
private AuthorDto author; | ||
private Long questionCount; | ||
private LocalDateTime createdAt; | ||
private LocalDateTime updatedAt; | ||
|
||
@QueryProjection | ||
public MyExamSummaryDto( | ||
Long id, | ||
String title, | ||
String description, | ||
ExamStatus status, | ||
AuthorDto author, | ||
Long questionCount, | ||
LocalDateTime createdAt, | ||
LocalDateTime updatedAt | ||
) { | ||
this.id = id; | ||
this.title = title; | ||
this.description = description; | ||
this.status = status; | ||
this.author = author; | ||
this.questionCount = questionCount; | ||
this.createdAt = createdAt; | ||
this.updatedAt = updatedAt; | ||
} | ||
} | ||
|
Oops, something went wrong.