-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
104 additions
and
5 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
src/main/kotlin/com/soon/common/application/commonLog/CommonLogQueryService.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,20 @@ | ||
package com.soon.common.application.commonLog | ||
|
||
import com.soon.common.application.commonLog.model.CommonLogInfoGetSummary | ||
import com.soon.common.domain.commonLog.CommonLogInfoRepository | ||
import org.springframework.data.crossstore.ChangeSetPersister.NotFoundException | ||
import org.springframework.data.repository.findByIdOrNull | ||
import org.springframework.stereotype.Service | ||
|
||
@Service | ||
class CommonLogQueryService | ||
( | ||
private val commonLogInfoRepository: CommonLogInfoRepository, | ||
) { | ||
suspend fun getCommonLogInfo(serviceNo: Int, commonLogInfoNo: Int): CommonLogInfoGetSummary { | ||
|
||
return commonLogInfoRepository.findByIdOrNull(commonLogInfoNo)?.let { | ||
CommonLogInfoGetSummary.of(it) | ||
} ?: throw NotFoundException() | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/main/kotlin/com/soon/common/application/commonLog/model/CommonLogInfoGetSummary.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,32 @@ | ||
package com.soon.common.application.commonLog.model | ||
|
||
import com.soon.common.domain.commonLog.CommonLogInfo | ||
import java.time.LocalDateTime | ||
|
||
data class CommonLogInfoGetSummary( | ||
val commonLogInfoNo: Int, | ||
val logName: String, | ||
val description: String, | ||
val intColumn1Name: String?, | ||
val intColumn2Name: String?, | ||
val doubleColumn1Name: String?, | ||
val doubleColumn2Name: String?, | ||
val dateTimeColumn1Name: String?, | ||
val dateTimeColumn2Name: String?, | ||
val createdAt: LocalDateTime, | ||
) { | ||
companion object { | ||
fun of(entity: CommonLogInfo) = CommonLogInfoGetSummary( | ||
commonLogInfoNo = entity.no, | ||
logName = entity.logName, | ||
description = entity.description, | ||
intColumn1Name = entity.intColumn1Name, | ||
intColumn2Name = entity.intColumn2Name, | ||
doubleColumn1Name = entity.doubleColumn1Name, | ||
doubleColumn2Name = entity.doubleColumn2Name, | ||
dateTimeColumn1Name = entity.dateTimeColumn1Name, | ||
dateTimeColumn2Name = entity.dateTimeColumn2Name, | ||
createdAt = entity.createdAt, | ||
) | ||
} | ||
} |
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
33 changes: 33 additions & 0 deletions
33
...main/kotlin/com/soon/common/presentation/handler/commonLog/model/CommonLogInfoResponse.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,33 @@ | ||
package com.soon.common.presentation.handler.commonLog.model | ||
|
||
import com.soon.common.application.commonLog.model.CommonLogInfoGetSummary | ||
import java.time.LocalDateTime | ||
|
||
data class CommonLogInfoResponse( | ||
val commonLogInfoNo: Int, | ||
val logName: String, | ||
val description: String, | ||
val intColumn1Name: String?, | ||
val intColumn2Name: String?, | ||
val doubleColumn1Name: String?, | ||
val doubleColumn2Name: String?, | ||
val dateTimeColumn1Name: String?, | ||
val dateTimeColumn2Name: String?, | ||
val createdAt: LocalDateTime, | ||
) { | ||
companion object { | ||
fun of(summary: CommonLogInfoGetSummary) = CommonLogInfoResponse( | ||
commonLogInfoNo = summary.commonLogInfoNo, | ||
logName = summary.logName, | ||
description = summary.description, | ||
intColumn1Name = summary.intColumn1Name, | ||
intColumn2Name = summary.intColumn2Name, | ||
doubleColumn1Name = summary.doubleColumn1Name, | ||
doubleColumn2Name = summary.doubleColumn2Name, | ||
dateTimeColumn1Name = summary.dateTimeColumn1Name, | ||
dateTimeColumn2Name = summary.dateTimeColumn2Name, | ||
createdAt = summary.createdAt, | ||
) | ||
} | ||
} | ||
|
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