From e46c4de11cd0ac95360c5b490b8b40e444bbc7a6 Mon Sep 17 00:00:00 2001 From: Shiina Kin Date: Tue, 24 Sep 2024 14:11:25 +0800 Subject: [PATCH] feat: modify some params of request & vo --- .../io/sakurasou/controller/request/GroupRequest.kt | 8 ++++---- .../main/kotlin/io/sakurasou/controller/vo/CommonVO.kt | 2 +- app/src/main/kotlin/io/sakurasou/controller/vo/GroupVO.kt | 5 +++-- .../kotlin/io/sakurasou/model/dao/common/PaginationDao.kt | 2 +- .../io/sakurasou/service/strategy/StrategyServiceImpl.kt | 5 ++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/src/main/kotlin/io/sakurasou/controller/request/GroupRequest.kt b/app/src/main/kotlin/io/sakurasou/controller/request/GroupRequest.kt index 752fd6f9..751ccd9f 100644 --- a/app/src/main/kotlin/io/sakurasou/controller/request/GroupRequest.kt +++ b/app/src/main/kotlin/io/sakurasou/controller/request/GroupRequest.kt @@ -10,16 +10,16 @@ import kotlinx.serialization.Serializable data class GroupInsertRequest( val name: String, val description: String? = null, - val strategy: Long, + val strategyId: Long, val maxSize: Double, - val roles: List + val roles: List ) @Serializable data class GroupPatchRequest( val name: String? = null, val description: String? = null, - val strategy: Long? = null, + val strategyId: Long? = null, val maxSize: Double? = null, - val roles: List? = null + val roles: List? = null ) \ No newline at end of file diff --git a/app/src/main/kotlin/io/sakurasou/controller/vo/CommonVO.kt b/app/src/main/kotlin/io/sakurasou/controller/vo/CommonVO.kt index 878efb15..bbc2819b 100644 --- a/app/src/main/kotlin/io/sakurasou/controller/vo/CommonVO.kt +++ b/app/src/main/kotlin/io/sakurasou/controller/vo/CommonVO.kt @@ -11,7 +11,7 @@ data class PageResult( val page: Long, val pageSize: Int, val total: Long, - val list: List + val data: List ) @Serializable diff --git a/app/src/main/kotlin/io/sakurasou/controller/vo/GroupVO.kt b/app/src/main/kotlin/io/sakurasou/controller/vo/GroupVO.kt index daa30482..56f3a515 100644 --- a/app/src/main/kotlin/io/sakurasou/controller/vo/GroupVO.kt +++ b/app/src/main/kotlin/io/sakurasou/controller/vo/GroupVO.kt @@ -12,12 +12,13 @@ data class GroupVO( val name: String, val description: String?, val strategyId: Long, - val maxSize: Double = 5 * 1024 * 1024 * 1024.0 + val maxSize: Double = 5 * 1024 * 1024 * 1024.0, + val roles: List ) @Serializable data class GroupPageVO( val id: Long, val name: String, - val strategyId: Long, + val strategyId: Long ) \ No newline at end of file diff --git a/app/src/main/kotlin/io/sakurasou/model/dao/common/PaginationDao.kt b/app/src/main/kotlin/io/sakurasou/model/dao/common/PaginationDao.kt index 2bdca0ad..bc52c722 100644 --- a/app/src/main/kotlin/io/sakurasou/model/dao/common/PaginationDao.kt +++ b/app/src/main/kotlin/io/sakurasou/model/dao/common/PaginationDao.kt @@ -36,7 +36,7 @@ interface PaginationDao { page = page, pageSize = pageSize, total = totalRecords, - list = data + data = data ) return pageResult } diff --git a/app/src/main/kotlin/io/sakurasou/service/strategy/StrategyServiceImpl.kt b/app/src/main/kotlin/io/sakurasou/service/strategy/StrategyServiceImpl.kt index ec1ef53b..94381a3c 100644 --- a/app/src/main/kotlin/io/sakurasou/service/strategy/StrategyServiceImpl.kt +++ b/app/src/main/kotlin/io/sakurasou/service/strategy/StrategyServiceImpl.kt @@ -14,7 +14,6 @@ import io.sakurasou.model.dto.StrategyUpdateDTO import kotlinx.datetime.Clock import kotlinx.datetime.TimeZone import kotlinx.datetime.toLocalDateTime -import kotlinx.serialization.SerialName /** * @author Shiina Kin @@ -68,7 +67,7 @@ class StrategyServiceImpl( override suspend fun pageStrategies(pageRequest: PageRequest): PageResult { val strategyPageResult = dbQuery { strategyDao.pagination(pageRequest) } - val pageVOList = strategyPageResult.list.map { + val pageVOList = strategyPageResult.data.map { StrategyPageVO( id = it.id, name = it.name, @@ -79,7 +78,7 @@ class StrategyServiceImpl( page = strategyPageResult.page, pageSize = strategyPageResult.pageSize, total = strategyPageResult.total, - list = pageVOList + data = pageVOList ) } } \ No newline at end of file