-
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
* refactor: rename controller dto name (body -> request) * refactor: usecase 패키지 위치 통일 (usercase 아래 ) * refactor: DAO DTO 이름 일치 (query, command ,record) * refactor: Service DTO 네이밍 통일 (InDto) * refacotr: 로컬 환경에서 디스코드 웹훅 URL 임시처리 * refactor: 줄바꿈 * refactor: GetUrlOutDto 추가 및 적용 * refactor: article 도메인 서비스 out dto 적용 * refactor: article service에서 transactional 삭제 * refactor: subscription 도메인 서비스 out dto 추가 * refactor: workbook 도메인 서비스 out dto 적용 * test: DTO 적용 관련 변경 사항
- Loading branch information
Showing
78 changed files
with
254 additions
and
177 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
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
7 changes: 7 additions & 0 deletions
7
api/src/main/kotlin/com/few/api/domain/admin/document/service/dto/GetUrlOutDto.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,7 @@ | ||
package com.few.api.domain.admin.document.service.dto | ||
|
||
import java.net.URL | ||
|
||
data class GetUrlOutDto( | ||
val url: URL | ||
) |
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
4 changes: 2 additions & 2 deletions
4
api/src/main/kotlin/com/few/api/domain/admin/document/usecase/AddWorkbookUseCase.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
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
2 changes: 1 addition & 1 deletion
2
api/src/main/kotlin/com/few/api/domain/admin/document/usecase/MapArticleUseCase.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
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
2 changes: 1 addition & 1 deletion
2
...admin/document/dto/AddArticleUseCaseIn.kt → ...cument/usecase/dto/AddArticleUseCaseIn.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
2 changes: 1 addition & 1 deletion
2
...dmin/document/dto/AddArticleUseCaseOut.kt → ...ument/usecase/dto/AddArticleUseCaseOut.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
2 changes: 1 addition & 1 deletion
2
...dmin/document/dto/AddWorkbookUseCaseIn.kt → ...ument/usecase/dto/AddWorkbookUseCaseIn.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
2 changes: 1 addition & 1 deletion
2
...min/document/dto/AddWorkbookUseCaseOut.kt → ...ment/usecase/dto/AddWorkbookUseCaseOut.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
2 changes: 1 addition & 1 deletion
2
...n/document/dto/ConvertContentUseCaseIn.kt → ...nt/usecase/dto/ConvertContentUseCaseIn.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
2 changes: 1 addition & 1 deletion
2
.../document/dto/ConvertContentUseCaseOut.kt → ...t/usecase/dto/ConvertContentUseCaseOut.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
2 changes: 1 addition & 1 deletion
2
...admin/document/dto/MapArticleUseCaseIn.kt → ...cument/usecase/dto/MapArticleUseCaseIn.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
2 changes: 1 addition & 1 deletion
2
...n/admin/document/dto/PutImageUseCaseIn.kt → ...document/usecase/dto/PutImageUseCaseIn.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
2 changes: 1 addition & 1 deletion
2
.../admin/document/dto/PutImageUseCaseOut.kt → ...ocument/usecase/dto/PutImageUseCaseOut.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
9 changes: 5 additions & 4 deletions
9
api/src/main/kotlin/com/few/api/domain/article/service/BrowseArticleProblemsService.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,20 +1,21 @@ | ||
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.domain.article.service.dto.BrowseArticleProblemsOutDto | ||
import com.few.api.exception.common.NotFoundException | ||
import com.few.api.repo.dao.problem.ProblemDao | ||
import com.few.api.repo.dao.problem.query.SelectProblemsByArticleIdQuery | ||
import com.few.api.repo.dao.problem.record.ProblemIdsRecord | ||
import org.springframework.stereotype.Service | ||
|
||
@Service | ||
class BrowseArticleProblemsService( | ||
private val problemDao: ProblemDao | ||
) { | ||
|
||
fun execute(query: BrowseArticleProblemIdsQuery): ProblemIdsRecord { | ||
fun execute(query: BrowseArticleProblemIdsInDto): BrowseArticleProblemsOutDto { | ||
SelectProblemsByArticleIdQuery(query.articleId).let { query: SelectProblemsByArticleIdQuery -> | ||
return problemDao.selectProblemsByArticleId(query) ?: throw NotFoundException("problem.notfound.articleId") | ||
return problemDao.selectProblemsByArticleId(query)?.let { BrowseArticleProblemsOutDto(it.problemIds) } | ||
?: throw NotFoundException("problem.notfound.articleId") | ||
} | ||
} | ||
} |
17 changes: 11 additions & 6 deletions
17
api/src/main/kotlin/com/few/api/domain/article/service/ReadArticleWriterRecordService.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,21 +1,26 @@ | ||
package com.few.api.domain.article.service | ||
|
||
import com.few.api.domain.article.service.dto.ReadWriterRecordQuery | ||
import com.few.api.domain.article.service.dto.ReadWriterOutDto | ||
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 | ||
import org.springframework.stereotype.Service | ||
import org.springframework.transaction.annotation.Transactional | ||
|
||
@Service | ||
class ReadArticleWriterRecordService( | ||
private val memberDao: MemberDao | ||
) { | ||
|
||
@Transactional(readOnly = true) | ||
fun execute(query: ReadWriterRecordQuery): WriterRecord? { | ||
fun execute(query: ReadWriterRecordInDto): ReadWriterOutDto? { | ||
SelectWriterQuery(query.writerId).let { query: SelectWriterQuery -> | ||
return memberDao.selectWriter(query) | ||
val record = memberDao.selectWriter(query) | ||
return record?.let { | ||
ReadWriterOutDto( | ||
writerId = it.writerId, | ||
name = it.name, | ||
url = it.url | ||
) | ||
} | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...rvice/dto/BrowseArticleProblemIdsQuery.kt → ...rvice/dto/BrowseArticleProblemIdsInDto.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,5 +1,5 @@ | ||
package com.few.api.domain.article.service.dto | ||
|
||
data class BrowseArticleProblemIdsQuery( | ||
data class BrowseArticleProblemIdsInDto( | ||
val articleId: Long | ||
) |
5 changes: 5 additions & 0 deletions
5
api/src/main/kotlin/com/few/api/domain/article/service/dto/BrowseArticleProblemsOutDto.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.domain.article.service.dto | ||
|
||
data class BrowseArticleProblemsOutDto( | ||
val problemIds: List<Long> | ||
) |
9 changes: 9 additions & 0 deletions
9
api/src/main/kotlin/com/few/api/domain/article/service/dto/ReadWriterOutDto.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,9 @@ | ||
package com.few.api.domain.article.service.dto | ||
|
||
import java.net.URL | ||
|
||
data class ReadWriterOutDto( | ||
val writerId: Long, | ||
val name: String, | ||
val url: URL | ||
) |
2 changes: 1 addition & 1 deletion
2
...icle/service/dto/ReadWriterRecordQuery.kt → ...icle/service/dto/ReadWriterRecordInDto.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,5 +1,5 @@ | ||
package com.few.api.domain.article.service.dto | ||
|
||
data class ReadWriterRecordQuery( | ||
data class ReadWriterRecordInDto( | ||
val writerId: Long | ||
) |
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.