-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#55 feat: GET /api/v1/workbooks/{workbookId} 구현 #101
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
46821dd
feat: selectWorkBook 메서드 구현
belljun3395 468f813
test: selectWorkBook 테스트 구현
belljun3395 17704e7
feat: selectWriters 메서드 구현
belljun3395 bf5e6de
test: selectWriters 테스트 구현
belljun3395 254c86e
feat: selectWorkbookMappedArticleRecords 메서드 구현
belljun3395 3ed04bd
test: selectWorkbookMappedArticleRecords 테스트 구현
belljun3395 ab57d66
feat: WorkbookArticleService#browseWorkbookArticles 구현
belljun3395 0c404f1
feat: WorkbookMemberService#browseWriterRecords 구현
belljun3395 5baed50
feat: ReadWorkbookUseCase 구현
belljun3395 c2ddaa2
refactor: ReadWorkbookUseCase 컨트럴러에 적용
belljun3395 23a718a
refactor: readWorkBook 컨트롤러에 테스트 유스케이스 목 처리
belljun3395 3bfb675
refactor: URL을 String으로 가져오고 있던 것 수정
belljun3395 d459e16
refactor: 조회시 deleted_at null 확인 하지 않은 것 수정
belljun3395 f1239cb
Merge branch 'main' into feat/#55_belljun3395
belljun3395 67f8620
refactor: article info left join -> join 수정
belljun3395 f307f40
refactor: MemberType 적용
belljun3395 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
5 changes: 5 additions & 0 deletions
5
...main/kotlin/com/few/api/repo/dao/article/query/SelectWorkbookMappedArticleRecordsQuery.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,5 @@ | ||
package com.few.api.repo.dao.article.query | ||
|
||
data class SelectWorkbookMappedArticleRecordsQuery( | ||
val workbookId: Long | ||
) |
3 changes: 2 additions & 1 deletion
3
api-repo/src/main/kotlin/com/few/api/repo/dao/article/record/SelectArticleRecord.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
3 changes: 2 additions & 1 deletion
3
api-repo/src/main/kotlin/com/few/api/repo/dao/article/record/SelectWorkBookArticleRecord.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
14 changes: 14 additions & 0 deletions
14
.../src/main/kotlin/com/few/api/repo/dao/article/record/SelectWorkBookMappedArticleRecord.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,14 @@ | ||
package com.few.api.repo.dao.article.record | ||
|
||
import java.net.URL | ||
import java.time.LocalDateTime | ||
|
||
data class SelectWorkBookMappedArticleRecord( | ||
val articleId: Long, | ||
val writerId: Long, | ||
val mainImageURL: URL, | ||
val title: String, | ||
val category: Byte, | ||
val content: String, | ||
val createdAt: LocalDateTime | ||
) |
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
5 changes: 5 additions & 0 deletions
5
api-repo/src/main/kotlin/com/few/api/repo/dao/member/query/SelectWritersQuery.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,5 @@ | ||
package com.few.api.repo.dao.member.query | ||
|
||
data class SelectWritersQuery( | ||
val writerIds: List<Long> | ||
) |
28 changes: 28 additions & 0 deletions
28
api-repo/src/main/kotlin/com/few/api/repo/dao/workbook/WorkbookDao.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,28 @@ | ||
package com.few.api.repo.dao.workbook | ||
|
||
import com.few.api.repo.dao.workbook.query.SelectWorkBookRecordQuery | ||
import com.few.api.repo.dao.workbook.record.SelectWorkBookRecord | ||
import jooq.jooq_dsl.tables.Workbook | ||
import org.jooq.DSLContext | ||
import org.springframework.stereotype.Repository | ||
|
||
@Repository | ||
class WorkbookDao( | ||
private val dslContext: DSLContext | ||
) { | ||
fun selectWorkBook(query: SelectWorkBookRecordQuery): SelectWorkBookRecord { | ||
return dslContext.select( | ||
Workbook.WORKBOOK.ID.`as`(SelectWorkBookRecord::id.name), | ||
Workbook.WORKBOOK.TITLE.`as`(SelectWorkBookRecord::title.name), | ||
Workbook.WORKBOOK.MAIN_IMAGE_URL.`as`(SelectWorkBookRecord::mainImageUrl.name), | ||
Workbook.WORKBOOK.CATEGORY_CD.`as`(SelectWorkBookRecord::category.name), | ||
Workbook.WORKBOOK.DESCRIPTION.`as`(SelectWorkBookRecord::description.name), | ||
Workbook.WORKBOOK.CREATED_AT.`as`(SelectWorkBookRecord::createdAt.name) | ||
) | ||
.from(Workbook.WORKBOOK) | ||
.where(Workbook.WORKBOOK.ID.eq(query.id)) | ||
.and(Workbook.WORKBOOK.DELETED_AT.isNull) | ||
.fetchOneInto(SelectWorkBookRecord::class.java) | ||
?: throw RuntimeException("WorkBook with ID ${query.id} not found") | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
api-repo/src/main/kotlin/com/few/api/repo/dao/workbook/query/SelectWorkBookRecordQuery.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,5 @@ | ||
package com.few.api.repo.dao.workbook.query | ||
|
||
data class SelectWorkBookRecordQuery( | ||
val id: Long | ||
) |
13 changes: 13 additions & 0 deletions
13
api-repo/src/main/kotlin/com/few/api/repo/dao/workbook/record/SelectWorkBookRecord.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,13 @@ | ||
package com.few.api.repo.dao.workbook.record | ||
|
||
import java.net.URL | ||
import java.time.LocalDateTime | ||
|
||
data class SelectWorkBookRecord( | ||
val id: Long, | ||
val title: String, | ||
val mainImageUrl: URL, | ||
val category: Long, | ||
val description: String, | ||
val createdAt: LocalDateTime | ||
) |
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete_at 필드 체크 필요할듯