道路线索应急巡查系统服务后台
feiyu02
2025-09-30 84569abda51ecf6c5549dec4cadee8d043422379
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
}