mirror of
https://github.moeyy.xyz/https://github.com/GeWuYou/forgeboot
synced 2025-10-27 16:24:22 +08:00
feat(dto): Add toString methods for PageQueryReq and PageResult classes - Add toString methods in PageQueryReq class to print the object's property information
- Add toString method to the PageResult class to print attribute information of paging results - The addition of toString method is easy to debug and log, improving the maintainability of the code
This commit is contained in:
parent
0e74483168
commit
37309f5b15
@ -109,4 +109,7 @@ open class PageResult<T> {
|
||||
*/
|
||||
fun <T> empty(): PageResult<T> = PageResult()
|
||||
}
|
||||
override fun toString(): String {
|
||||
return "PageResult(records=$records, totalRecords=$totalRecords, totalPages=$totalPages, currentPage=$currentPage, pageSize=$pageSize, hasPrevious=$hasPrevious, hasNext=$hasNext)"
|
||||
}
|
||||
}
|
||||
@ -85,4 +85,9 @@ open class PageQueryReq<T> {
|
||||
fun isDateRangeValid(): Boolean {
|
||||
return startDate == null || endDate == null || !startDate!!.isAfter(endDate)
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "PageQueryReq(currentPage=$currentPage, pageSize=$pageSize, sortBy='$sortBy', sortDirection=$sortDirection, sortConditions=$sortConditions, keyword=$keyword, filter=$filter, startDate=$startDate, endDate=$endDate, enabled=$enabled, deleted=$deleted)"
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user