Skip to content
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

[RELEASE] v24.09.12.01 #400

Merged
merged 16 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
48aed88
[Refactor/#372] ๋ฒ”์œ„์ง€์ • ํ•จ์ˆ˜ ๊ตฌํ˜„ ํ†ต์ผ (#373)
belljun3395 Aug 31, 2024
be5d051
[Feat/#331] My ๊ตฌ๋…๊ด€๋ฆฌ API ์ถ”๊ฐ€ (#376)
belljun3395 Sep 6, 2024
c4ad770
[Feat/#362] ๊ตฌ๋… ๊ด€๋ฆฌ ๊ธฐ๋Šฅ ๊ตฌํ˜„ (#377)
belljun3395 Sep 6, 2024
1a796c9
[Fix/#378]: send_day ๊ธฐ๋ณธ๊ฐ’ ๋ณ€๊ฒฝ (#380)
belljun3395 Sep 6, 2024
0366f37
[Refactor/#374] ๊ตฌ๋… ํ•ด์ง€ ์ด์œ  ์˜ต์…˜์œผ๋กœ ์ˆ˜์ • (#379 )
belljun3395 Sep 6, 2024
452cac7
[Feat/#375] ์นดํ…Œ๊ณ ๋ฆฌ์— ์™ธ๊ตญ์–ด ์ถ”๊ฐ€ (#381)
belljun3395 Sep 6, 2024
59ce7fd
[Feat/382] ์›Œํฌ๋ถ ์™ธ๊ตญ์–ด ์นดํ…Œ๊ณ ๋ฆฌ ์ถ”๊ฐ€ (#383)
belljun3395 Sep 7, 2024
e24b096
[Refactor/#385] ์„ค์ • ํŒŒ์ผ ์ •๋ฆฌ (#386)
belljun3395 Sep 9, 2024
9fdce8d
[Feat/#384] ๊ตฌ๋… ์ค‘๋ณต ์‹ ์ฒญ ๋ฐฉ์ง€ ์œ„ํ•œ ๋ฝ ๊ตฌํ˜„ (#387)
belljun3395 Sep 9, 2024
c3645c2
[Refactor/#388] ์ด๋ฉ”์ผ ์ „์†ก ๋ฐฐ์น˜์— ๋ฉค๋ฒ„ ํƒˆํ‡ด ํ™•์ธ ์กฐ๊ฑด ์ถ”๊ฐ€ (#389)
belljun3395 Sep 9, 2024
9fbc7ff
[Refactor/#390] ์ด๋ฉ”์ผ ์ „์†ก ๋ฐฐ์น˜ ์ „์†ก ์„ค์ •์— ๋”ฐ๋ผ ์กฐํšŒํ•˜๋„๋ก ์ˆ˜์ • (#391)
belljun3395 Sep 10, 2024
2188971
[Refactor/#393] ๊ตฌ๋… ์‹œ๊ฐ„ ์ˆ˜์ • ๋ฐ”๋”” ํŒŒ๋ผ๋ฏธํ„ฐ ์ด๋ฆ„ ์ˆ˜์ • (#395)
belljun3395 Sep 11, 2024
6aa3191
[Refactor/#392] HandlerMethodArgumentResolver ์ ์šฉ (#394)
belljun3395 Sep 11, 2024
bff63c3
[Refactor/#396] ๋ฌธ์ œ ํ’€์ด ์‚ฌ์šฉ์ž ์ถ”์  (#397)
belljun3395 Sep 11, 2024
3550d40
[Refactor/#398] ๋ฉค๋ฒ„ ํƒˆํ‡ด์‹œ ๊ตฌ๋… ์ •๋ณด ์‚ญ์ œ๋  ์ˆ˜ ์žˆ๋„๋ก ์ˆ˜์ • (#399)
belljun3395 Sep 11, 2024
f6ab71a
Merge branch 'main' into dev
belljun3395 Sep 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.few.api.repo.dao.subscription.query.*
import com.few.api.repo.dao.subscription.record.WorkbookSubscriptionStatus
import com.few.api.repo.dao.subscription.record.CountAllSubscriptionStatusRecord
import com.few.api.repo.dao.subscription.record.MemberWorkbookSubscriptionStatusRecord
import com.few.api.repo.dao.subscription.record.SubscriptionSendStatusRecord
import jooq.jooq_dsl.Tables.MAPPING_WORKBOOK_ARTICLE
import jooq.jooq_dsl.Tables.SUBSCRIPTION
import jooq.jooq_dsl.tables.MappingWorkbookArticle
Expand All @@ -17,6 +18,21 @@ import java.time.LocalDateTime
class SubscriptionDao(
private val dslContext: DSLContext,
) {
fun getLock(memberId: Long, workbookId: Long, timeout: Int = 5): Boolean {
return dslContext.fetch(
"""
SELECT GET_LOCK(CONCAT('subscription_', $memberId, '_', $workbookId), $timeout);
"""
).into(Int::class.java).first() == 1
}

fun releaseLock(memberId: Long, workbookId: Long): Boolean {
return dslContext.fetch(
"""
SELECT RELEASE_LOCK(CONCAT('subscription_', $memberId, '_', $workbookId));
"""
).into(Int::class.java).first() == 1
}

fun insertWorkbookSubscription(command: InsertWorkbookSubscriptionCommand) {
insertWorkbookSubscriptionCommand(command)
Expand Down Expand Up @@ -70,17 +86,19 @@ class SubscriptionDao(
.orderBy(SUBSCRIPTION.CREATED_AT.desc())
.limit(1)

fun selectAllInActiveWorkbookSubscriptionStatus(query: SelectAllMemberWorkbookInActiveSubscription): List<MemberWorkbookSubscriptionStatusRecord> {
fun selectAllInActiveWorkbookSubscriptionStatus(query: SelectAllMemberWorkbookInActiveSubscriptionQuery): List<MemberWorkbookSubscriptionStatusRecord> {
return selectAllWorkbookInActiveSubscriptionStatusQuery(query)
.fetchInto(MemberWorkbookSubscriptionStatusRecord::class.java)
}

fun selectAllWorkbookInActiveSubscriptionStatusQuery(query: SelectAllMemberWorkbookInActiveSubscription) =
fun selectAllWorkbookInActiveSubscriptionStatusQuery(query: SelectAllMemberWorkbookInActiveSubscriptionQuery) =
dslContext.select(
SUBSCRIPTION.TARGET_WORKBOOK_ID.`as`(MemberWorkbookSubscriptionStatusRecord::workbookId.name),
SUBSCRIPTION.DELETED_AT.isNull.`as`(MemberWorkbookSubscriptionStatusRecord::isActiveSub.name),
DSL.max(SUBSCRIPTION.PROGRESS).add(1).`as`(MemberWorkbookSubscriptionStatusRecord::currentDay.name),
DSL.max(MAPPING_WORKBOOK_ARTICLE.DAY_COL).`as`(MemberWorkbookSubscriptionStatusRecord::totalDay.name)
DSL.max(SUBSCRIPTION.PROGRESS).add(1)
.`as`(MemberWorkbookSubscriptionStatusRecord::currentDay.name),
DSL.max(MAPPING_WORKBOOK_ARTICLE.DAY_COL)
.`as`(MemberWorkbookSubscriptionStatusRecord::totalDay.name)
)
.from(SUBSCRIPTION)
.join(MappingWorkbookArticle.MAPPING_WORKBOOK_ARTICLE)
Expand All @@ -89,14 +107,15 @@ class SubscriptionDao(
.and(SUBSCRIPTION.TARGET_MEMBER_ID.isNull)
.and(SUBSCRIPTION.UNSUBS_OPINION.eq(query.unsubOpinion))
.groupBy(SUBSCRIPTION.TARGET_WORKBOOK_ID, SUBSCRIPTION.DELETED_AT)
.orderBy(SUBSCRIPTION.PROGRESS)
.query

fun selectAllActiveWorkbookSubscriptionStatus(query: SelectAllMemberWorkbookActiveSubscription): List<MemberWorkbookSubscriptionStatusRecord> {
fun selectAllActiveWorkbookSubscriptionStatus(query: SelectAllMemberWorkbookActiveSubscriptionQuery): List<MemberWorkbookSubscriptionStatusRecord> {
return selectAllWorkbookActiveSubscriptionStatusQuery(query)
.fetchInto(MemberWorkbookSubscriptionStatusRecord::class.java)
}

fun selectAllWorkbookActiveSubscriptionStatusQuery(query: SelectAllMemberWorkbookActiveSubscription) =
fun selectAllWorkbookActiveSubscriptionStatusQuery(query: SelectAllMemberWorkbookActiveSubscriptionQuery) =
dslContext.select(
SUBSCRIPTION.TARGET_WORKBOOK_ID.`as`(MemberWorkbookSubscriptionStatusRecord::workbookId.name),
SUBSCRIPTION.DELETED_AT.isNull.`as`(MemberWorkbookSubscriptionStatusRecord::isActiveSub.name),
Expand All @@ -110,6 +129,7 @@ class SubscriptionDao(
.and(SUBSCRIPTION.TARGET_MEMBER_ID.isNull)
.and(SUBSCRIPTION.UNSUBS_OPINION.isNull)
.groupBy(SUBSCRIPTION.TARGET_WORKBOOK_ID, SUBSCRIPTION.DELETED_AT)
.orderBy(SUBSCRIPTION.PROGRESS)
.query

fun updateDeletedAtInAllSubscription(command: UpdateDeletedAtInAllSubscriptionCommand) {
Expand Down Expand Up @@ -148,7 +168,7 @@ class SubscriptionDao(
* key: workbookId
* value: workbook ๊ตฌ๋… ์ „์ฒด ๊ธฐ๋ก ์ˆ˜
*/
fun countAllWorkbookSubscription(query: CountAllWorkbooksSubscription): Map<Long, Int> {
fun countAllWorkbookSubscription(query: CountAllWorkbooksSubscriptionQuery): Map<Long, Int> {
return countAllWorkbookSubscriptionQuery()
.fetch()
.intoMap(SUBSCRIPTION.TARGET_WORKBOOK_ID, DSL.count(SUBSCRIPTION.TARGET_WORKBOOK_ID))
Expand Down Expand Up @@ -185,4 +205,57 @@ class SubscriptionDao(
.set(SUBSCRIPTION.UNSUBS_OPINION, command.opinion)
.where(SUBSCRIPTION.MEMBER_ID.eq(command.memberId))
.and(SUBSCRIPTION.TARGET_WORKBOOK_ID.eq(command.workbookId))

fun selectAllSubscriptionSendStatus(query: SelectAllSubscriptionSendStatusQuery): List<SubscriptionSendStatusRecord> {
return selectAllSubscriptionSendStatusQuery(query)
.fetchInto(
SubscriptionSendStatusRecord::class.java
)
}

fun selectAllSubscriptionSendStatusQuery(query: SelectAllSubscriptionSendStatusQuery) =
dslContext.select(
SUBSCRIPTION.TARGET_WORKBOOK_ID.`as`(SubscriptionSendStatusRecord::workbookId.name),
SUBSCRIPTION.SEND_TIME.`as`(SubscriptionSendStatusRecord::sendTime.name),
SUBSCRIPTION.SEND_DAY.`as`(SubscriptionSendStatusRecord::sendDay.name)
)
.from(SUBSCRIPTION)
.where(SUBSCRIPTION.MEMBER_ID.eq(query.memberId))
.and(SUBSCRIPTION.TARGET_WORKBOOK_ID.`in`(query.workbookIds))

fun selectAllActiveSubscriptionWorkbookIds(query: SelectAllActiveSubscriptionWorkbookIdsQuery): List<Long> {
return dslContext.select(SUBSCRIPTION.TARGET_WORKBOOK_ID)
.from(SUBSCRIPTION)
.where(SUBSCRIPTION.MEMBER_ID.eq(query.memberId))
.and(SUBSCRIPTION.DELETED_AT.isNull)
.fetchInto(Long::class.java)
}

data class SelectAllActiveSubscriptionWorkbookIdsQuery(
val memberId: Long,
)

fun bulkUpdateSubscriptionSendTime(command: BulkUpdateSubscriptionSendTimeCommand) {
bulkUpdateSubscriptionSendTimeCommand(command)
.execute()
}

fun bulkUpdateSubscriptionSendTimeCommand(command: BulkUpdateSubscriptionSendTimeCommand) =
dslContext.update(SUBSCRIPTION)
.set(SUBSCRIPTION.SEND_TIME, command.time)
.set(SUBSCRIPTION.MODIFIED_AT, LocalDateTime.now())
.where(SUBSCRIPTION.MEMBER_ID.eq(command.memberId))
.and(SUBSCRIPTION.TARGET_WORKBOOK_ID.`in`(command.workbookIds))

fun bulkUpdateSubscriptionSendDay(command: BulkUpdateSubscriptionSendDayCommand) {
bulkUpdateSubscriptionSendDayCommand(command)
.execute()
}

fun bulkUpdateSubscriptionSendDayCommand(command: BulkUpdateSubscriptionSendDayCommand) =
dslContext.update(SUBSCRIPTION)
.set(SUBSCRIPTION.SEND_DAY, command.day)
.set(SUBSCRIPTION.MODIFIED_AT, LocalDateTime.now())
.where(SUBSCRIPTION.MEMBER_ID.eq(command.memberId))
.and(SUBSCRIPTION.TARGET_WORKBOOK_ID.`in`(command.workbookIds))
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.few.api.repo.dao.subscription.command

data class BulkUpdateSubscriptionSendDayCommand(
val memberId: Long,
val day: String,
val workbookIds: List<Long>,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.few.api.repo.dao.subscription.command

import java.time.LocalTime

data class BulkUpdateSubscriptionSendTimeCommand(
val memberId: Long,
val time: LocalTime,
val workbookIds: List<Long>,
)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package com.few.api.repo.dao.subscription.query

data class CountAllWorkbooksSubscription(
data class CountAllWorkbooksSubscriptionQuery(
val workbookIds: List<Long>,
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ package com.few.api.repo.dao.subscription.query
/**
* ๋ฉค๋ฒ„์˜ ๊ตฌ๋… ์ค‘์ธ ์›Œํฌ๋ถ ๋ชฉ๋ก์„ ์กฐํšŒํ•ฉ๋‹ˆ๋‹ค.
*/
data class SelectAllMemberWorkbookActiveSubscription(
data class SelectAllMemberWorkbookActiveSubscriptionQuery(
val memberId: Long,
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.few.api.repo.dao.subscription.query
/**
* ๋ฉค๋ฒ„์˜ ๊ตฌ๋… ์™„๋ฃŒ ์›Œํฌ๋ถ ๋ชฉ๋ก์„ ์กฐํšŒํ•ฉ๋‹ˆ๋‹ค.
*/
data class SelectAllMemberWorkbookInActiveSubscription(
data class SelectAllMemberWorkbookInActiveSubscriptionQuery(
val memberId: Long,
val unsubOpinion: String = "receive.all",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.few.api.repo.dao.subscription.query

data class SelectAllSubscriptionSendStatusQuery(
val memberId: Long,
val workbookIds: List<Long>,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.few.api.repo.dao.subscription.record

import java.time.LocalTime

data class SubscriptionSendStatusRecord(
val workbookId: Long,
val sendTime: LocalTime,
val sendDay: String,
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import com.few.api.repo.config.LocalCacheConfig
import com.few.api.repo.config.LocalCacheConfig.Companion.LOCAL_CM
import com.few.api.repo.dao.workbook.command.InsertWorkBookCommand
import com.few.api.repo.dao.workbook.command.MapWorkBookToArticleCommand
import com.few.api.repo.dao.workbook.query.BrowseWorkBookQueryWithSubscriptionCount
import com.few.api.repo.dao.workbook.query.BrowseWorkBookQueryWithSubscriptionCountQuery
import com.few.api.repo.dao.workbook.query.SelectAllWorkbookTitleQuery
import com.few.api.repo.dao.workbook.query.SelectWorkBookLastArticleIdQuery
import com.few.api.repo.dao.workbook.query.SelectWorkBookRecordQuery
import com.few.api.repo.dao.workbook.record.SelectWorkBookRecord
import com.few.api.repo.dao.workbook.record.SelectWorkBookRecordWithSubscriptionCount
import com.few.api.repo.dao.workbook.record.WorkbookTitleRecord
import com.few.data.common.code.CategoryType
import jooq.jooq_dsl.tables.MappingWorkbookArticle
import jooq.jooq_dsl.tables.Subscription
Expand Down Expand Up @@ -71,12 +73,12 @@ class WorkbookDao(
* category์— ๋”ฐ๋ผ์„œ ์กฐํšŒ๋œ ๊ตฌ๋…์ž ์ˆ˜๊ฐ€ ํฌํ•จ๋œ Workbook ๋ชฉ๋ก์„ ๋ฐ˜ํ™˜ํ•œ๋‹ค.
* ์ •๋ ฌ ์ˆœ์„œ๋Š” ๊ตฌ๋…์ž ์ˆ˜๊ฐ€ ๋งŽ์€ ์ˆœ์„œ๋กœ, ๊ตฌ๋…์ž ์ˆ˜๊ฐ€ ๊ฐ™๋‹ค๋ฉด ์ƒ์„ฑ์ผ์ž๊ฐ€ ์ตœ์‹ ์ธ ์ˆœ์„œ๋กœ ๋ฐ˜ํ™˜ํ•œ๋‹ค.
*/
fun browseWorkBookWithSubscriptionCount(query: BrowseWorkBookQueryWithSubscriptionCount): List<SelectWorkBookRecordWithSubscriptionCount> {
fun browseWorkBookWithSubscriptionCount(query: BrowseWorkBookQueryWithSubscriptionCountQuery): List<SelectWorkBookRecordWithSubscriptionCount> {
return browseWorkBookQuery(query)
.fetchInto(SelectWorkBookRecordWithSubscriptionCount::class.java)
}

fun browseWorkBookQuery(query: BrowseWorkBookQueryWithSubscriptionCount) =
fun browseWorkBookQuery(query: BrowseWorkBookQueryWithSubscriptionCountQuery) =
dslContext.select(
Workbook.WORKBOOK.ID.`as`(SelectWorkBookRecordWithSubscriptionCount::id.name),
Workbook.WORKBOOK.TITLE.`as`(SelectWorkBookRecordWithSubscriptionCount::title.name),
Expand Down Expand Up @@ -124,7 +126,7 @@ class WorkbookDao(
/**
* category์— ๋”ฐ๋ผ์„œ ์กฐ๊ฑด์„ ์ƒ์„ฑํ•œ๋‹ค.
*/
private fun browseWorkBookCategoryCondition(query: BrowseWorkBookQueryWithSubscriptionCount): Condition {
private fun browseWorkBookCategoryCondition(query: BrowseWorkBookQueryWithSubscriptionCountQuery): Condition {
return when (query.category) {
(-1).toByte() -> DSL.noCondition()
else -> Workbook.WORKBOOK.CATEGORY_CD.eq(query.category)
Expand All @@ -144,4 +146,17 @@ class WorkbookDao(
.where(MappingWorkbookArticle.MAPPING_WORKBOOK_ARTICLE.WORKBOOK_ID.eq(query.workbookId))
.and(MappingWorkbookArticle.MAPPING_WORKBOOK_ARTICLE.DELETED_AT.isNull)
.groupBy(MappingWorkbookArticle.MAPPING_WORKBOOK_ARTICLE.WORKBOOK_ID)

fun selectAllWorkbookTitle(query: SelectAllWorkbookTitleQuery): List<WorkbookTitleRecord> {
return selectAllWorkbookTitleQuery(query)
.fetchInto(WorkbookTitleRecord::class.java)
}

fun selectAllWorkbookTitleQuery(query: SelectAllWorkbookTitleQuery) =
dslContext.select(
Workbook.WORKBOOK.ID.`as`(WorkbookTitleRecord::workbookId.name),
Workbook.WORKBOOK.TITLE.`as`(WorkbookTitleRecord::title.name)
)
.from(Workbook.WORKBOOK)
.where(Workbook.WORKBOOK.ID.`in`(query.workbookIds))
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.few.api.repo.dao.workbook.query

data class BrowseWorkBookQueryWithSubscriptionCount(
data class BrowseWorkBookQueryWithSubscriptionCountQuery(
/**
* @see com.few.api.web.support.WorkBookCategory
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.few.api.repo.dao.workbook.query

data class SelectAllWorkbookTitleQuery(
val workbookIds: List<Long>,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.few.api.repo.dao.workbook.record

data class WorkbookTitleRecord(
val workbookId: Long,
val title: String,
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ package com.few.api.repo.explain.subscription

import com.few.api.repo.dao.subscription.SubscriptionDao
import com.few.api.repo.dao.subscription.command.*
import com.few.api.repo.dao.subscription.query.CountWorkbookMappedArticlesQuery
import com.few.api.repo.dao.subscription.query.SelectAllMemberWorkbookActiveSubscription
import com.few.api.repo.dao.subscription.query.SelectAllWorkbookSubscriptionStatusNotConsiderDeletedAtQuery
import com.few.api.repo.dao.subscription.query.SelectAllMemberWorkbookInActiveSubscription
import com.few.api.repo.dao.subscription.query.*
import com.few.api.repo.explain.ExplainGenerator
import com.few.api.repo.explain.InsertUpdateExplainGenerator
import com.few.api.repo.explain.ResultGenerator
Expand Down Expand Up @@ -63,7 +60,7 @@ class SubscriptionDaoExplainGenerateTest : JooqTestSpec() {

@Test
fun selectAllWorkbookInActiveSubscriptionStatusQueryExplain() {
val query = SelectAllMemberWorkbookInActiveSubscription(
val query = SelectAllMemberWorkbookInActiveSubscriptionQuery(
memberId = 1L,
unsubOpinion = "receive.all"
).let {
Expand All @@ -77,7 +74,7 @@ class SubscriptionDaoExplainGenerateTest : JooqTestSpec() {

@Test
fun selectAllWorkbookActiveSubscriptionStatusQueryExplain() {
val query = SelectAllMemberWorkbookActiveSubscription(
val query = SelectAllMemberWorkbookActiveSubscriptionQuery(
memberId = 1L
).let {
subscriptionDao.selectAllWorkbookActiveSubscriptionStatusQuery(it)
Expand Down Expand Up @@ -190,4 +187,18 @@ class SubscriptionDaoExplainGenerateTest : JooqTestSpec() {

ResultGenerator.execute(command, explain, "updateLastArticleProgressCommandExplain")
}

@Test
fun selectAllSubscriptionSendStatusQueryExplain() {
val query = subscriptionDao.selectAllSubscriptionSendStatusQuery(
SelectAllSubscriptionSendStatusQuery(
memberId = 1L,
workbookIds = listOf(1L)
)
)

val explain = ExplainGenerator.execute(dslContext, query)

ResultGenerator.execute(query, explain, "selectAllSubscriptionSendStatusQueryExplain")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ package com.few.api.repo.explain.workbook
import com.few.api.repo.dao.workbook.WorkbookDao
import com.few.api.repo.dao.workbook.command.InsertWorkBookCommand
import com.few.api.repo.dao.workbook.command.MapWorkBookToArticleCommand
import com.few.api.repo.dao.workbook.query.BrowseWorkBookQueryWithSubscriptionCount
import com.few.api.repo.dao.workbook.query.BrowseWorkBookQueryWithSubscriptionCountQuery
import com.few.api.repo.dao.workbook.query.SelectAllWorkbookTitleQuery
import com.few.api.repo.dao.workbook.query.SelectWorkBookLastArticleIdQuery
import com.few.api.repo.dao.workbook.query.SelectWorkBookRecordQuery
import com.few.api.repo.explain.ExplainGenerator
Expand Down Expand Up @@ -73,7 +74,7 @@ class WorkbookDaoExplainGenerateTest : JooqTestSpec() {

@Test
fun browseWorkBookQueryNoConditionQueryExplain() {
val query = BrowseWorkBookQueryWithSubscriptionCount(-1).let {
val query = BrowseWorkBookQueryWithSubscriptionCountQuery(-1).let {
workbookDao.browseWorkBookQuery(it)
}

Expand All @@ -84,7 +85,7 @@ class WorkbookDaoExplainGenerateTest : JooqTestSpec() {

@Test
fun browseWorkBookQueryCategoryConditionExplain() {
val query = BrowseWorkBookQueryWithSubscriptionCount(CategoryType.fromCode(0)!!.code).let {
val query = BrowseWorkBookQueryWithSubscriptionCountQuery(CategoryType.fromCode(0)!!.code).let {
workbookDao.browseWorkBookQuery(it)
}

Expand Down Expand Up @@ -118,4 +119,17 @@ class WorkbookDaoExplainGenerateTest : JooqTestSpec() {

ResultGenerator.execute(query, explain, "selectWorkBookLastArticleIdQueryExplain")
}

@Test
fun selectAllWorkbookTitleQueryExplain() {
val query = workbookDao.selectAllWorkbookTitleQuery(
SelectAllWorkbookTitleQuery(
listOf(1L)
)
)

val explain = ExplainGenerator.execute(dslContext, query)

ResultGenerator.execute(query, explain, "selectAllWorkbookTitleQueryExplain")
}
}
Loading
Loading