import { ApiCall } from "tsrpc";
import { ReqRank, ResRank } from "../../cross/protocols/clsl/PtlRank";
import { Rank } from '../../public/rank/rank';

export default async function (call: ApiCall<ReqRank, ResRank>) {
    let page = call.req.page || 0
    let offset = call.req.offset || -1 // 预防未查询到的调用，按原逻辑查询全部，避免引起未知问题
    let {min, max} = Rank.pageToMin(page, offset)
    call.succ(await Rank.list.clslCross.getRankList(call.req.gud.uid, { min, max }));
}