-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat : 내가 스크랩한 글 조회 * feat : 내가 스크랩한 글 조회 테스트
- Loading branch information
Showing
6 changed files
with
113 additions
and
3 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
src/main/kotlin/com/example/daitssuapi/domain/article/model/repository/ScrapRepository.kt
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,10 +1,13 @@ | ||
package com.example.daitssuapi.domain.article.model.repository | ||
|
||
import com.example.daitssuapi.domain.article.model.entity.Scrap | ||
import com.example.daitssuapi.domain.user.model.entity.User | ||
import org.springframework.data.jpa.repository.JpaRepository | ||
|
||
interface ScrapRepository : JpaRepository<Scrap, Long> { | ||
fun findByArticleIdAndUserId(articleId: Long, userId: Long): Scrap? | ||
|
||
fun findByArticleIdAndIsActiveTrue(articleId: Long): List<Scrap> | ||
|
||
fun findByUserAndIsActiveTrueOrderByCreatedAtDesc(user: User): List<Scrap> | ||
} |
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
12 changes: 12 additions & 0 deletions
12
src/main/kotlin/com/example/daitssuapi/domain/myPage/dto/response/MyScrapResponse.kt
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,12 @@ | ||
package com.example.daitssuapi.domain.myPage.dto.response | ||
|
||
import java.time.LocalDateTime | ||
|
||
data class MyScrapResponse ( | ||
val id: Long, | ||
val topic: String, | ||
val title: String, | ||
val content: String, | ||
val createdAt: LocalDateTime, | ||
val commentSize: Int | ||
) |
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