Skip to content

Commit

Permalink
fix: add comment about paging sort
Browse files Browse the repository at this point in the history
  • Loading branch information
DongGeon0908 committed Aug 26, 2024
1 parent 17ecdef commit 79a0ef3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ data class HeroPageRequest(
return PageRequest.of(page, size, sort)
}

fun toCustom(sort: String): Pageable {
val page = this.page ?: 0
val size = this.size ?: 10
val customSort = sort.parsingSort()

return PageRequest.of(page, size, customSort)
}

fun String?.parsingSort(): Sort {
val sortSpec = (this ?: "createdAt,desc").trim().split(",")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ import java.time.LocalDate
class PoseCountResource(
private val poseCountService: PoseCountService,
) {
/**
* 정렬
* - date,desc
* - date,asc
*/
@Operation(summary = "pose 통계 정보 검색")
@GetMapping("/api/v1/pose-counts")
suspend fun search(
Expand Down

0 comments on commit 79a0ef3

Please sign in to comment.