Skip to content

Commit

Permalink
feat: modify some params of request & vo
Browse files Browse the repository at this point in the history
  • Loading branch information
ShiinaKin committed Sep 24, 2024
1 parent f68cd96 commit e46c4de
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Long>
val roles: List<String>
)

@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<Long>? = null
val roles: List<String>? = null
)
2 changes: 1 addition & 1 deletion app/src/main/kotlin/io/sakurasou/controller/vo/CommonVO.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ data class PageResult<T>(
val page: Long,
val pageSize: Int,
val total: Long,
val list: List<T>
val data: List<T>
)

@Serializable
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/kotlin/io/sakurasou/controller/vo/GroupVO.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>
)

@Serializable
data class GroupPageVO(
val id: Long,
val name: String,
val strategyId: Long,
val strategyId: Long
)
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ interface PaginationDao {
page = page,
pageSize = pageSize,
total = totalRecords,
list = data
data = data
)
return pageResult
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -68,7 +67,7 @@ class StrategyServiceImpl(

override suspend fun pageStrategies(pageRequest: PageRequest): PageResult<StrategyPageVO> {
val strategyPageResult = dbQuery { strategyDao.pagination(pageRequest) }
val pageVOList = strategyPageResult.list.map {
val pageVOList = strategyPageResult.data.map {
StrategyPageVO(
id = it.id,
name = it.name,
Expand All @@ -79,7 +78,7 @@ class StrategyServiceImpl(
page = strategyPageResult.page,
pageSize = strategyPageResult.pageSize,
total = strategyPageResult.total,
list = pageVOList
data = pageVOList
)
}
}

0 comments on commit e46c4de

Please sign in to comment.