src/main/kotlin/com/flightfeather/grid/web/BaseResPack.kt
@@ -3,6 +3,7 @@ import com.flightfeather.grid.config.exception.BizException import com.flightfeather.grid.vo.BaseResponse import com.flightfeather.grid.vo.DataHead import com.github.pagehelper.Page /** @@ -24,4 +25,11 @@ } catch (e: BizException) { BaseResponse(false, message = e.message ?: "") } } /** * 包装带有分页的返回结果 */ fun <T> responsePack(p: Page<T>): Pair<DataHead, List<T?>> { return DataHead(p.pageNum, p.pages, p.total) to p.result }