-
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.
Browse files
Browse the repository at this point in the history
* feat: selectWorkBook 메서드 구현 * test: selectWorkBook 테스트 구현 * feat: selectWriters 메서드 구현 * test: selectWriters 테스트 구현 * feat: selectWorkbookMappedArticleRecords 메서드 구현 * test: selectWorkbookMappedArticleRecords 테스트 구현 * feat: WorkbookArticleService#browseWorkbookArticles 구현 * feat: WorkbookMemberService#browseWriterRecords 구현 * feat: ReadWorkbookUseCase 구현 * refactor: ReadWorkbookUseCase 컨트럴러에 적용 * refactor: readWorkBook 컨트롤러에 테스트 유스케이스 목 처리 * refactor: URL을 String으로 가져오고 있던 것 수정 * refactor: 조회시 deleted_at null 확인 하지 않은 것 수정 * refactor: article info left join -> join 수정 * refactor: MemberType 적용
- Loading branch information
1 parent
3029e57
commit 16fcaac
Showing
23 changed files
with
471 additions
and
45 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
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.