diff --git a/api/src/main/kotlin/com/few/api/domain/admin/document/service/GetUrlService.kt b/api/src/main/kotlin/com/few/api/domain/admin/document/service/GetUrlService.kt index d6f747bd5..85b3b5ccd 100644 --- a/api/src/main/kotlin/com/few/api/domain/admin/document/service/GetUrlService.kt +++ b/api/src/main/kotlin/com/few/api/domain/admin/document/service/GetUrlService.kt @@ -1,6 +1,6 @@ package com.few.api.domain.admin.document.service -import com.few.api.domain.admin.document.service.dto.GetUrlQuery +import com.few.api.domain.admin.document.service.dto.GetUrlInDto import com.few.api.domain.admin.document.service.dto.getPreSignedUrlServiceKey import com.few.api.exception.common.ExternalIntegrationException import com.few.storage.GetPreSignedObjectUrlService @@ -11,7 +11,7 @@ import java.net.URL import java.util.* interface GetUrlService { - fun execute(query: GetUrlQuery): URL + fun execute(query: GetUrlInDto): URL } @Profile("local") @@ -19,7 +19,7 @@ interface GetUrlService { class GetLocalUrlService( private val services: Map ) : GetUrlService { - override fun execute(query: GetUrlQuery): URL { + override fun execute(query: GetUrlInDto): URL { val service = services.keys.stream().filter { key -> key.lowercase(Locale.getDefault()) .contains(query.getPreSignedUrlServiceKey()) @@ -39,7 +39,7 @@ class GetLocalUrlService( class GetCdnUrlService( private val cdnProperty: CdnProperty ) : GetUrlService { - override fun execute(query: GetUrlQuery): URL { + override fun execute(query: GetUrlInDto): URL { return URL(cdnProperty.url + "/" + query.`object`) } } \ No newline at end of file diff --git a/api/src/main/kotlin/com/few/api/domain/admin/document/service/dto/GetUrlQuery.kt b/api/src/main/kotlin/com/few/api/domain/admin/document/service/dto/GetUrlInDto.kt similarity index 76% rename from api/src/main/kotlin/com/few/api/domain/admin/document/service/dto/GetUrlQuery.kt rename to api/src/main/kotlin/com/few/api/domain/admin/document/service/dto/GetUrlInDto.kt index d5076fc69..359376cb7 100644 --- a/api/src/main/kotlin/com/few/api/domain/admin/document/service/dto/GetUrlQuery.kt +++ b/api/src/main/kotlin/com/few/api/domain/admin/document/service/dto/GetUrlInDto.kt @@ -3,9 +3,9 @@ package com.few.api.domain.admin.document.service.dto import java.util.* /** query.object example: images/2024-07-01/14789db.png */ -fun GetUrlQuery.getPreSignedUrlServiceKey(): String { +fun GetUrlInDto.getPreSignedUrlServiceKey(): String { return this.`object`.split("/")[0].lowercase(Locale.getDefault()).replace("s", "") } -data class GetUrlQuery( +data class GetUrlInDto( val `object`: String ) \ No newline at end of file diff --git a/api/src/main/kotlin/com/few/api/domain/admin/document/usecase/AddArticleUseCase.kt b/api/src/main/kotlin/com/few/api/domain/admin/document/usecase/AddArticleUseCase.kt index c63ff77c2..501c35140 100644 --- a/api/src/main/kotlin/com/few/api/domain/admin/document/usecase/AddArticleUseCase.kt +++ b/api/src/main/kotlin/com/few/api/domain/admin/document/usecase/AddArticleUseCase.kt @@ -3,7 +3,7 @@ package com.few.api.domain.admin.document.usecase import com.few.api.domain.admin.document.usecase.dto.AddArticleUseCaseIn import com.few.api.domain.admin.document.usecase.dto.AddArticleUseCaseOut import com.few.api.domain.admin.document.service.GetUrlService -import com.few.api.domain.admin.document.service.dto.GetUrlQuery +import com.few.api.domain.admin.document.service.dto.GetUrlInDto import com.few.api.domain.admin.document.utils.ObjectPathGenerator import com.few.api.exception.common.ExternalIntegrationException import com.few.api.exception.common.NotFoundException @@ -63,7 +63,7 @@ class AddArticleUseCase( putDocumentService.execute(documentName, document)?.let { res -> val source = res.`object` - GetUrlQuery(source).let { query -> + GetUrlInDto(source).let { query -> getUrlService.execute(query) }.let { url -> InsertDocumentIfoCommand( diff --git a/api/src/main/kotlin/com/few/api/domain/admin/document/usecase/ConvertContentUseCase.kt b/api/src/main/kotlin/com/few/api/domain/admin/document/usecase/ConvertContentUseCase.kt index 9c23a3de1..4a965ad0b 100644 --- a/api/src/main/kotlin/com/few/api/domain/admin/document/usecase/ConvertContentUseCase.kt +++ b/api/src/main/kotlin/com/few/api/domain/admin/document/usecase/ConvertContentUseCase.kt @@ -3,7 +3,7 @@ package com.few.api.domain.admin.document.usecase import com.few.api.domain.admin.document.usecase.dto.ConvertContentUseCaseIn import com.few.api.domain.admin.document.usecase.dto.ConvertContentUseCaseOut import com.few.api.domain.admin.document.service.GetUrlService -import com.few.api.domain.admin.document.service.dto.GetUrlQuery +import com.few.api.domain.admin.document.service.dto.GetUrlInDto import com.few.api.domain.admin.document.utils.ObjectPathGenerator import com.few.api.exception.common.ExternalIntegrationException import com.few.api.exception.common.InsertException @@ -37,7 +37,7 @@ class ConvertContentUseCase( val originDownloadUrl = putDocumentService.execute(documentName, document)?.let { res -> val source = res.`object` - GetUrlQuery(source).let { query -> + GetUrlInDto(source).let { query -> getUrlService.execute(query) }.let { url -> InsertDocumentIfoCommand( diff --git a/api/src/main/kotlin/com/few/api/domain/admin/document/usecase/PutImageUseCase.kt b/api/src/main/kotlin/com/few/api/domain/admin/document/usecase/PutImageUseCase.kt index fd292842a..a448b2d09 100644 --- a/api/src/main/kotlin/com/few/api/domain/admin/document/usecase/PutImageUseCase.kt +++ b/api/src/main/kotlin/com/few/api/domain/admin/document/usecase/PutImageUseCase.kt @@ -3,7 +3,7 @@ package com.few.api.domain.admin.document.usecase import com.few.api.domain.admin.document.usecase.dto.PutImageUseCaseIn import com.few.api.domain.admin.document.usecase.dto.PutImageUseCaseOut import com.few.api.domain.admin.document.service.GetUrlService -import com.few.api.domain.admin.document.service.dto.GetUrlQuery +import com.few.api.domain.admin.document.service.dto.GetUrlInDto import com.few.api.domain.admin.document.utils.ObjectPathGenerator import com.few.api.exception.common.ExternalIntegrationException import com.few.api.exception.common.InsertException @@ -35,7 +35,7 @@ class PutImageUseCase( val url = putImageService.execute(imageName, image)?.let { res -> val source = res.`object` - GetUrlQuery(source).let { query -> + GetUrlInDto(source).let { query -> getUrlService.execute(query) }.let { url -> InsertImageIfoCommand(source, url).let { command -> diff --git a/api/src/main/kotlin/com/few/api/domain/article/service/BrowseArticleProblemsService.kt b/api/src/main/kotlin/com/few/api/domain/article/service/BrowseArticleProblemsService.kt index 62bf41b37..3715ee42c 100644 --- a/api/src/main/kotlin/com/few/api/domain/article/service/BrowseArticleProblemsService.kt +++ b/api/src/main/kotlin/com/few/api/domain/article/service/BrowseArticleProblemsService.kt @@ -1,6 +1,6 @@ package com.few.api.domain.article.service -import com.few.api.domain.article.service.dto.BrowseArticleProblemIdsQuery +import com.few.api.domain.article.service.dto.BrowseArticleProblemIdsInDto import com.few.api.exception.common.NotFoundException import com.few.api.repo.dao.problem.ProblemDao import com.few.api.repo.dao.problem.query.SelectProblemsByArticleIdQuery @@ -12,7 +12,7 @@ class BrowseArticleProblemsService( private val problemDao: ProblemDao ) { - fun execute(query: BrowseArticleProblemIdsQuery): ProblemIdsRecord { + fun execute(query: BrowseArticleProblemIdsInDto): ProblemIdsRecord { SelectProblemsByArticleIdQuery(query.articleId).let { query: SelectProblemsByArticleIdQuery -> return problemDao.selectProblemsByArticleId(query) ?: throw NotFoundException("problem.notfound.articleId") } diff --git a/api/src/main/kotlin/com/few/api/domain/article/service/ReadArticleWriterRecordService.kt b/api/src/main/kotlin/com/few/api/domain/article/service/ReadArticleWriterRecordService.kt index 5dd2d9b43..ebdff8aa5 100644 --- a/api/src/main/kotlin/com/few/api/domain/article/service/ReadArticleWriterRecordService.kt +++ b/api/src/main/kotlin/com/few/api/domain/article/service/ReadArticleWriterRecordService.kt @@ -1,6 +1,6 @@ package com.few.api.domain.article.service -import com.few.api.domain.article.service.dto.ReadWriterRecordQuery +import com.few.api.domain.article.service.dto.ReadWriterRecordInDto import com.few.api.repo.dao.member.MemberDao import com.few.api.repo.dao.member.query.SelectWriterQuery import com.few.api.repo.dao.member.record.WriterRecord @@ -13,7 +13,7 @@ class ReadArticleWriterRecordService( ) { @Transactional(readOnly = true) - fun execute(query: ReadWriterRecordQuery): WriterRecord? { + fun execute(query: ReadWriterRecordInDto): WriterRecord? { SelectWriterQuery(query.writerId).let { query: SelectWriterQuery -> return memberDao.selectWriter(query) } diff --git a/api/src/main/kotlin/com/few/api/domain/article/service/dto/BrowseArticleProblemIdsQuery.kt b/api/src/main/kotlin/com/few/api/domain/article/service/dto/BrowseArticleProblemIdsInDto.kt similarity index 64% rename from api/src/main/kotlin/com/few/api/domain/article/service/dto/BrowseArticleProblemIdsQuery.kt rename to api/src/main/kotlin/com/few/api/domain/article/service/dto/BrowseArticleProblemIdsInDto.kt index 95901c1a9..a0523c11b 100644 --- a/api/src/main/kotlin/com/few/api/domain/article/service/dto/BrowseArticleProblemIdsQuery.kt +++ b/api/src/main/kotlin/com/few/api/domain/article/service/dto/BrowseArticleProblemIdsInDto.kt @@ -1,5 +1,5 @@ package com.few.api.domain.article.service.dto -data class BrowseArticleProblemIdsQuery( +data class BrowseArticleProblemIdsInDto( val articleId: Long ) \ No newline at end of file diff --git a/api/src/main/kotlin/com/few/api/domain/article/service/dto/ReadWriterRecordQuery.kt b/api/src/main/kotlin/com/few/api/domain/article/service/dto/ReadWriterRecordInDto.kt similarity index 67% rename from api/src/main/kotlin/com/few/api/domain/article/service/dto/ReadWriterRecordQuery.kt rename to api/src/main/kotlin/com/few/api/domain/article/service/dto/ReadWriterRecordInDto.kt index ea4fff923..aebfec42c 100644 --- a/api/src/main/kotlin/com/few/api/domain/article/service/dto/ReadWriterRecordQuery.kt +++ b/api/src/main/kotlin/com/few/api/domain/article/service/dto/ReadWriterRecordInDto.kt @@ -1,5 +1,5 @@ package com.few.api.domain.article.service.dto -data class ReadWriterRecordQuery( +data class ReadWriterRecordInDto( val writerId: Long ) \ No newline at end of file diff --git a/api/src/main/kotlin/com/few/api/domain/article/usecase/ReadArticleUseCase.kt b/api/src/main/kotlin/com/few/api/domain/article/usecase/ReadArticleUseCase.kt index 1d06e28c7..cdc1ae0ce 100644 --- a/api/src/main/kotlin/com/few/api/domain/article/usecase/ReadArticleUseCase.kt +++ b/api/src/main/kotlin/com/few/api/domain/article/usecase/ReadArticleUseCase.kt @@ -5,8 +5,8 @@ import com.few.api.domain.article.usecase.dto.ReadArticleUseCaseOut import com.few.api.domain.article.usecase.dto.WriterDetail import com.few.api.domain.article.service.BrowseArticleProblemsService import com.few.api.domain.article.service.ReadArticleWriterRecordService -import com.few.api.domain.article.service.dto.BrowseArticleProblemIdsQuery -import com.few.api.domain.article.service.dto.ReadWriterRecordQuery +import com.few.api.domain.article.service.dto.BrowseArticleProblemIdsInDto +import com.few.api.domain.article.service.dto.ReadWriterRecordInDto import com.few.api.exception.common.NotFoundException import com.few.api.repo.dao.article.ArticleDao import com.few.api.repo.dao.article.query.SelectArticleRecordQuery @@ -27,11 +27,11 @@ class ReadArticleUseCase( articleDao.selectArticleRecord(query) } ?: throw NotFoundException("article.notfound.id") - val writerRecord = ReadWriterRecordQuery(articleRecord.writerId).let { query: ReadWriterRecordQuery -> + val writerRecord = ReadWriterRecordInDto(articleRecord.writerId).let { query: ReadWriterRecordInDto -> readArticleWriterRecordService.execute(query) ?: throw NotFoundException("writer.notfound.id") } - val problemIds = BrowseArticleProblemIdsQuery(articleRecord.articleId).let { query: BrowseArticleProblemIdsQuery -> + val problemIds = BrowseArticleProblemIdsInDto(articleRecord.articleId).let { query: BrowseArticleProblemIdsInDto -> browseArticleProblemsService.execute(query) } diff --git a/api/src/main/kotlin/com/few/api/domain/subscription/event/WorkbookSubscriptionEventListener.kt b/api/src/main/kotlin/com/few/api/domain/subscription/event/WorkbookSubscriptionEventListener.kt index cee272f84..48033f4cb 100644 --- a/api/src/main/kotlin/com/few/api/domain/subscription/event/WorkbookSubscriptionEventListener.kt +++ b/api/src/main/kotlin/com/few/api/domain/subscription/event/WorkbookSubscriptionEventListener.kt @@ -4,7 +4,7 @@ import com.few.api.client.subscription.SubscriptionClient import com.few.api.client.subscription.dto.WorkbookSubscriptionArgs import com.few.api.domain.subscription.event.dto.WorkbookSubscriptionEvent import com.few.api.domain.subscription.service.WorkbookService -import com.few.api.domain.subscription.service.dto.ReadWorkbookTitleDto +import com.few.api.domain.subscription.service.dto.ReadWorkbookTitleInDto import com.few.api.exception.common.NotFoundException import com.few.api.repo.dao.subscription.SubscriptionDao import org.springframework.context.event.EventListener @@ -21,7 +21,7 @@ class WorkbookSubscriptionEventListener( @Async @EventListener fun handleWorkbookSubscriptionEvent(event: WorkbookSubscriptionEvent) { - val title = ReadWorkbookTitleDto(event.workbookId).let { dto -> + val title = ReadWorkbookTitleInDto(event.workbookId).let { dto -> workbookService.readWorkbookTitle(dto) ?: throw NotFoundException("workbook.notfound.id") } diff --git a/api/src/main/kotlin/com/few/api/domain/subscription/service/MemberService.kt b/api/src/main/kotlin/com/few/api/domain/subscription/service/MemberService.kt index b57c0b274..9145168f6 100644 --- a/api/src/main/kotlin/com/few/api/domain/subscription/service/MemberService.kt +++ b/api/src/main/kotlin/com/few/api/domain/subscription/service/MemberService.kt @@ -1,7 +1,7 @@ package com.few.api.domain.subscription.service -import com.few.api.domain.subscription.service.dto.InsertMemberDto -import com.few.api.domain.subscription.service.dto.ReadMemberIdDto +import com.few.api.domain.subscription.service.dto.InsertMemberInDto +import com.few.api.domain.subscription.service.dto.ReadMemberIdInDto import com.few.api.exception.common.InsertException import com.few.api.repo.dao.member.MemberDao import com.few.api.repo.dao.member.command.InsertMemberCommand @@ -14,11 +14,11 @@ class MemberService( private val memberDao: MemberDao ) { - fun readMemberId(dto: ReadMemberIdDto): MemberIdRecord? { + fun readMemberId(dto: ReadMemberIdInDto): MemberIdRecord? { return memberDao.selectMemberByEmail(SelectMemberByEmailQuery(dto.email)) } - fun insertMember(dto: InsertMemberDto): Long { + fun insertMember(dto: InsertMemberInDto): Long { return memberDao.insertMember(InsertMemberCommand(dto.email, dto.memberType)) ?: throw InsertException("member.insertfail.record") } } \ No newline at end of file diff --git a/api/src/main/kotlin/com/few/api/domain/subscription/service/WorkbookService.kt b/api/src/main/kotlin/com/few/api/domain/subscription/service/WorkbookService.kt index 26c2e1893..0e1b2ccb5 100644 --- a/api/src/main/kotlin/com/few/api/domain/subscription/service/WorkbookService.kt +++ b/api/src/main/kotlin/com/few/api/domain/subscription/service/WorkbookService.kt @@ -1,6 +1,6 @@ package com.few.api.domain.subscription.service -import com.few.api.domain.subscription.service.dto.ReadWorkbookTitleDto +import com.few.api.domain.subscription.service.dto.ReadWorkbookTitleInDto import com.few.api.repo.dao.workbook.WorkbookDao import com.few.api.repo.dao.workbook.query.SelectWorkBookRecordQuery import org.springframework.stereotype.Service @@ -10,7 +10,7 @@ class WorkbookService( private val workbookDao: WorkbookDao ) { - fun readWorkbookTitle(dto: ReadWorkbookTitleDto): String? { + fun readWorkbookTitle(dto: ReadWorkbookTitleInDto): String? { return SelectWorkBookRecordQuery(dto.workbookId).let { query -> workbookDao.selectWorkBook(query)?.title } diff --git a/api/src/main/kotlin/com/few/api/domain/subscription/service/dto/InsertMemberDto.kt b/api/src/main/kotlin/com/few/api/domain/subscription/service/dto/InsertMemberInDto.kt similarity index 83% rename from api/src/main/kotlin/com/few/api/domain/subscription/service/dto/InsertMemberDto.kt rename to api/src/main/kotlin/com/few/api/domain/subscription/service/dto/InsertMemberInDto.kt index 086add51f..736541d10 100644 --- a/api/src/main/kotlin/com/few/api/domain/subscription/service/dto/InsertMemberDto.kt +++ b/api/src/main/kotlin/com/few/api/domain/subscription/service/dto/InsertMemberInDto.kt @@ -2,7 +2,7 @@ package com.few.api.domain.subscription.service.dto import com.few.data.common.code.MemberType -data class InsertMemberDto( +data class InsertMemberInDto( val email: String, val memberType: MemberType ) \ No newline at end of file diff --git a/api/src/main/kotlin/com/few/api/domain/subscription/service/dto/ReadMemberIdDto.kt b/api/src/main/kotlin/com/few/api/domain/subscription/service/dto/ReadMemberIdInDto.kt similarity index 71% rename from api/src/main/kotlin/com/few/api/domain/subscription/service/dto/ReadMemberIdDto.kt rename to api/src/main/kotlin/com/few/api/domain/subscription/service/dto/ReadMemberIdInDto.kt index 4ce213032..0788cc556 100644 --- a/api/src/main/kotlin/com/few/api/domain/subscription/service/dto/ReadMemberIdDto.kt +++ b/api/src/main/kotlin/com/few/api/domain/subscription/service/dto/ReadMemberIdInDto.kt @@ -1,5 +1,5 @@ package com.few.api.domain.subscription.service.dto -data class ReadMemberIdDto( +data class ReadMemberIdInDto( val email: String ) \ No newline at end of file diff --git a/api/src/main/kotlin/com/few/api/domain/subscription/service/dto/ReadWorkbookTitleDto.kt b/api/src/main/kotlin/com/few/api/domain/subscription/service/dto/ReadWorkbookTitleInDto.kt similarity index 69% rename from api/src/main/kotlin/com/few/api/domain/subscription/service/dto/ReadWorkbookTitleDto.kt rename to api/src/main/kotlin/com/few/api/domain/subscription/service/dto/ReadWorkbookTitleInDto.kt index e5128b4e3..e0a4401f6 100644 --- a/api/src/main/kotlin/com/few/api/domain/subscription/service/dto/ReadWorkbookTitleDto.kt +++ b/api/src/main/kotlin/com/few/api/domain/subscription/service/dto/ReadWorkbookTitleInDto.kt @@ -1,5 +1,5 @@ package com.few.api.domain.subscription.service.dto -data class ReadWorkbookTitleDto( +data class ReadWorkbookTitleInDto( val workbookId: Long ) \ No newline at end of file diff --git a/api/src/main/kotlin/com/few/api/domain/subscription/usecase/SubscribeWorkbookUseCase.kt b/api/src/main/kotlin/com/few/api/domain/subscription/usecase/SubscribeWorkbookUseCase.kt index cf00a3498..83c328749 100644 --- a/api/src/main/kotlin/com/few/api/domain/subscription/usecase/SubscribeWorkbookUseCase.kt +++ b/api/src/main/kotlin/com/few/api/domain/subscription/usecase/SubscribeWorkbookUseCase.kt @@ -2,8 +2,8 @@ package com.few.api.domain.subscription.usecase import com.few.api.domain.subscription.event.dto.WorkbookSubscriptionEvent import com.few.api.domain.subscription.service.MemberService -import com.few.api.domain.subscription.service.dto.InsertMemberDto -import com.few.api.domain.subscription.service.dto.ReadMemberIdDto +import com.few.api.domain.subscription.service.dto.InsertMemberInDto +import com.few.api.domain.subscription.service.dto.ReadMemberIdInDto import com.few.api.repo.dao.subscription.SubscriptionDao import com.few.api.repo.dao.subscription.command.InsertWorkbookSubscriptionCommand import com.few.api.repo.dao.subscription.query.SelectAllWorkbookSubscriptionStatusNotConsiderDeletedAtQuery @@ -27,8 +27,8 @@ class SubscribeWorkbookUseCase( fun execute(useCaseIn: SubscribeWorkbookUseCaseIn) { // TODO: request sending email - val memberId = memberService.readMemberId(ReadMemberIdDto(useCaseIn.email))?.memberId ?: memberService.insertMember( - InsertMemberDto(email = useCaseIn.email, memberType = MemberType.NORMAL) + val memberId = memberService.readMemberId(ReadMemberIdInDto(useCaseIn.email))?.memberId ?: memberService.insertMember( + InsertMemberInDto(email = useCaseIn.email, memberType = MemberType.NORMAL) ) val subTargetWorkbookId = useCaseIn.workbookId diff --git a/api/src/main/kotlin/com/few/api/domain/subscription/usecase/UnsubscribeAllUseCase.kt b/api/src/main/kotlin/com/few/api/domain/subscription/usecase/UnsubscribeAllUseCase.kt index 4fa63264f..9fee2154e 100644 --- a/api/src/main/kotlin/com/few/api/domain/subscription/usecase/UnsubscribeAllUseCase.kt +++ b/api/src/main/kotlin/com/few/api/domain/subscription/usecase/UnsubscribeAllUseCase.kt @@ -1,7 +1,7 @@ package com.few.api.domain.subscription.usecase import com.few.api.domain.subscription.service.MemberService -import com.few.api.domain.subscription.service.dto.ReadMemberIdDto +import com.few.api.domain.subscription.service.dto.ReadMemberIdInDto import com.few.api.domain.subscription.usecase.dto.UnsubscribeAllUseCaseIn import com.few.api.exception.common.NotFoundException import com.few.api.repo.dao.subscription.SubscriptionDao @@ -20,7 +20,7 @@ class UnsubscribeAllUseCase( // TODO: request sending email val memberId = - memberService.readMemberId(ReadMemberIdDto(useCaseIn.email))?.memberId ?: throw NotFoundException("member.notfound.email") + memberService.readMemberId(ReadMemberIdInDto(useCaseIn.email))?.memberId ?: throw NotFoundException("member.notfound.email") subscriptionDao.updateDeletedAtInAllSubscription( UpdateDeletedAtInAllSubscriptionCommand(memberId = memberId, opinion = useCaseIn.opinion) diff --git a/api/src/main/kotlin/com/few/api/domain/subscription/usecase/UnsubscribeWorkbookUseCase.kt b/api/src/main/kotlin/com/few/api/domain/subscription/usecase/UnsubscribeWorkbookUseCase.kt index b1d2e470f..a87950911 100644 --- a/api/src/main/kotlin/com/few/api/domain/subscription/usecase/UnsubscribeWorkbookUseCase.kt +++ b/api/src/main/kotlin/com/few/api/domain/subscription/usecase/UnsubscribeWorkbookUseCase.kt @@ -1,7 +1,7 @@ package com.few.api.domain.subscription.usecase import com.few.api.domain.subscription.service.MemberService -import com.few.api.domain.subscription.service.dto.ReadMemberIdDto +import com.few.api.domain.subscription.service.dto.ReadMemberIdInDto import com.few.api.repo.dao.subscription.SubscriptionDao import com.few.api.repo.dao.subscription.command.UpdateDeletedAtInWorkbookSubscriptionCommand import com.few.api.domain.subscription.usecase.dto.UnsubscribeWorkbookUseCaseIn @@ -20,7 +20,7 @@ class UnsubscribeWorkbookUseCase( // TODO: request sending email val memberId = - memberService.readMemberId(ReadMemberIdDto(useCaseIn.email))?.memberId ?: throw NotFoundException("member.notfound.email") + memberService.readMemberId(ReadMemberIdInDto(useCaseIn.email))?.memberId ?: throw NotFoundException("member.notfound.email") subscriptionDao.updateDeletedAtInWorkbookSubscription( UpdateDeletedAtInWorkbookSubscriptionCommand( diff --git a/api/src/main/kotlin/com/few/api/domain/workbook/article/usecase/ReadWorkBookArticleUseCase.kt b/api/src/main/kotlin/com/few/api/domain/workbook/article/usecase/ReadWorkBookArticleUseCase.kt index 0630347ba..e4591bd75 100644 --- a/api/src/main/kotlin/com/few/api/domain/workbook/article/usecase/ReadWorkBookArticleUseCase.kt +++ b/api/src/main/kotlin/com/few/api/domain/workbook/article/usecase/ReadWorkBookArticleUseCase.kt @@ -2,8 +2,8 @@ package com.few.api.domain.workbook.article.usecase import com.few.api.domain.article.service.BrowseArticleProblemsService import com.few.api.domain.article.service.ReadArticleWriterRecordService -import com.few.api.domain.article.service.dto.BrowseArticleProblemIdsQuery -import com.few.api.domain.article.service.dto.ReadWriterRecordQuery +import com.few.api.domain.article.service.dto.BrowseArticleProblemIdsInDto +import com.few.api.domain.article.service.dto.ReadWriterRecordInDto import com.few.api.domain.workbook.article.dto.ReadWorkBookArticleUseCaseIn import com.few.api.domain.workbook.article.dto.ReadWorkBookArticleOut import com.few.api.domain.workbook.article.dto.WriterDetail @@ -30,12 +30,12 @@ class ReadWorkBookArticleUseCase( } ?: throw NotFoundException("article.notfound.articleidworkbookid") val writerRecord = - ReadWriterRecordQuery(articleRecord.writerId).let { query: ReadWriterRecordQuery -> + ReadWriterRecordInDto(articleRecord.writerId).let { query: ReadWriterRecordInDto -> readArticleWriterRecordService.execute(query) ?: throw NotFoundException("writer.notfound.id") } val problemIds = - BrowseArticleProblemIdsQuery(articleRecord.articleId).let { query: BrowseArticleProblemIdsQuery -> + BrowseArticleProblemIdsInDto(articleRecord.articleId).let { query: BrowseArticleProblemIdsInDto -> browseArticleProblemsService.execute(query) } diff --git a/api/src/main/kotlin/com/few/api/domain/workbook/service/WorkbookArticleService.kt b/api/src/main/kotlin/com/few/api/domain/workbook/service/WorkbookArticleService.kt index 940321534..04c663cba 100644 --- a/api/src/main/kotlin/com/few/api/domain/workbook/service/WorkbookArticleService.kt +++ b/api/src/main/kotlin/com/few/api/domain/workbook/service/WorkbookArticleService.kt @@ -1,7 +1,7 @@ package com.few.api.domain.workbook.service import com.few.api.domain.workbook.usecase.dto.ArticleDetail -import com.few.api.domain.workbook.service.dto.BrowseWorkbookArticlesQuery +import com.few.api.domain.workbook.service.dto.BrowseWorkbookArticlesInDto import com.few.api.repo.dao.article.ArticleDao import com.few.api.repo.dao.article.query.SelectWorkbookMappedArticleRecordsQuery import com.few.api.repo.dao.article.record.SelectWorkBookMappedArticleRecord @@ -19,7 +19,7 @@ fun List.toArticleDetails(): List { + fun browseWorkbookArticles(query: BrowseWorkbookArticlesInDto): List { return SelectWorkbookMappedArticleRecordsQuery(query.workbookId).let { query -> articleDao.selectWorkbookMappedArticleRecords(query) } diff --git a/api/src/main/kotlin/com/few/api/domain/workbook/service/WorkbookMemberService.kt b/api/src/main/kotlin/com/few/api/domain/workbook/service/WorkbookMemberService.kt index aa64a9947..745ef4ec0 100644 --- a/api/src/main/kotlin/com/few/api/domain/workbook/service/WorkbookMemberService.kt +++ b/api/src/main/kotlin/com/few/api/domain/workbook/service/WorkbookMemberService.kt @@ -1,7 +1,7 @@ package com.few.api.domain.workbook.service import com.few.api.domain.workbook.usecase.dto.WriterDetail -import com.few.api.domain.workbook.service.dto.BrowseWriterRecordsQuery +import com.few.api.domain.workbook.service.dto.BrowseWriterRecordsInDto import com.few.api.repo.dao.member.MemberDao import com.few.api.repo.dao.member.query.SelectWritersQuery import com.few.api.repo.dao.member.record.WriterRecord @@ -15,7 +15,7 @@ fun List.toWriterDetails(): List { class WorkbookMemberService( private val memberDao: MemberDao ) { - fun browseWriterRecords(query: BrowseWriterRecordsQuery): List { + fun browseWriterRecords(query: BrowseWriterRecordsInDto): List { return SelectWritersQuery(query.writerIds).let { query -> memberDao.selectWriters(query) } diff --git a/api/src/main/kotlin/com/few/api/domain/workbook/service/dto/BrowseWorkbookArticlesQuery.kt b/api/src/main/kotlin/com/few/api/domain/workbook/service/dto/BrowseWorkbookArticlesInDto.kt similarity index 65% rename from api/src/main/kotlin/com/few/api/domain/workbook/service/dto/BrowseWorkbookArticlesQuery.kt rename to api/src/main/kotlin/com/few/api/domain/workbook/service/dto/BrowseWorkbookArticlesInDto.kt index 45324e343..754c9e9f7 100644 --- a/api/src/main/kotlin/com/few/api/domain/workbook/service/dto/BrowseWorkbookArticlesQuery.kt +++ b/api/src/main/kotlin/com/few/api/domain/workbook/service/dto/BrowseWorkbookArticlesInDto.kt @@ -1,5 +1,5 @@ package com.few.api.domain.workbook.service.dto -data class BrowseWorkbookArticlesQuery( +data class BrowseWorkbookArticlesInDto( val workbookId: Long ) \ No newline at end of file diff --git a/api/src/main/kotlin/com/few/api/domain/workbook/service/dto/BrowseWriterRecordsQuery.kt b/api/src/main/kotlin/com/few/api/domain/workbook/service/dto/BrowseWriterRecordsInDto.kt similarity index 68% rename from api/src/main/kotlin/com/few/api/domain/workbook/service/dto/BrowseWriterRecordsQuery.kt rename to api/src/main/kotlin/com/few/api/domain/workbook/service/dto/BrowseWriterRecordsInDto.kt index d1943a0f7..e288e1a97 100644 --- a/api/src/main/kotlin/com/few/api/domain/workbook/service/dto/BrowseWriterRecordsQuery.kt +++ b/api/src/main/kotlin/com/few/api/domain/workbook/service/dto/BrowseWriterRecordsInDto.kt @@ -1,5 +1,5 @@ package com.few.api.domain.workbook.service.dto -data class BrowseWriterRecordsQuery( +data class BrowseWriterRecordsInDto( val writerIds: List ) \ No newline at end of file diff --git a/api/src/main/kotlin/com/few/api/domain/workbook/usecase/ReadWorkbookUseCase.kt b/api/src/main/kotlin/com/few/api/domain/workbook/usecase/ReadWorkbookUseCase.kt index 2d2fff487..eb78623e7 100644 --- a/api/src/main/kotlin/com/few/api/domain/workbook/usecase/ReadWorkbookUseCase.kt +++ b/api/src/main/kotlin/com/few/api/domain/workbook/usecase/ReadWorkbookUseCase.kt @@ -3,8 +3,8 @@ package com.few.api.domain.workbook.usecase import com.few.api.domain.workbook.usecase.dto.ReadWorkbookUseCaseIn import com.few.api.domain.workbook.usecase.dto.ReadWorkbookUseCaseOut import com.few.api.domain.workbook.service.* -import com.few.api.domain.workbook.service.dto.BrowseWorkbookArticlesQuery -import com.few.api.domain.workbook.service.dto.BrowseWriterRecordsQuery +import com.few.api.domain.workbook.service.dto.BrowseWorkbookArticlesInDto +import com.few.api.domain.workbook.service.dto.BrowseWriterRecordsInDto import com.few.api.exception.common.NotFoundException import com.few.api.repo.dao.workbook.WorkbookDao import com.few.api.repo.dao.workbook.query.SelectWorkBookRecordQuery @@ -25,11 +25,11 @@ class ReadWorkbookUseCase( workbookDao.selectWorkBook(query) ?: throw NotFoundException("workbook.notfound.id") } - val workbookMappedArticles = BrowseWorkbookArticlesQuery(workbookId).let { query -> + val workbookMappedArticles = BrowseWorkbookArticlesInDto(workbookId).let { query -> workbookArticleService.browseWorkbookArticles(query) } - val writerRecords = BrowseWriterRecordsQuery(workbookMappedArticles.writerIds()).let { query -> + val writerRecords = BrowseWriterRecordsInDto(workbookMappedArticles.writerIds()).let { query -> workbookMemberService.browseWriterRecords(query) }