Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PageUtil

Hierarchy

  • PageUtil

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

Static Private Readonly MaxLimit

MaxLimit: 100 = 100

最大分页数量

Methods

Static pageToAllList

  • pageToAllList<F>(fn: F, pageParam?: Omit<Parameters<F>[0], "page" | "limit">): Promise<PageResValueType<ReturnType<F>>[]>
  • pageToAllList<K, F>(fn: F, pageParam: { query: string; type?: TypeEnum } & PageParam<NoteProperties> & FieldsParam<K>): Promise<(Pick<NoteProperties, K> & CommonType)[]>
  • 循环获取所有分页的数据 每次都获取最大分页数量,尽可能减少请求次数

    Type parameters

    • F: (pageParam: PageParam<any> & Record<string, any>) => Promise<PageRes<any>>

    Parameters

    • fn: F
    • Optional pageParam: Omit<Parameters<F>[0], "page" | "limit">

    Returns Promise<PageResValueType<ReturnType<F>>[]>

  • Type parameters

    • K: keyof NoteProperties

    • F: (pageParam: { query: string; type?: TypeEnum } & PageParam<NoteProperties> & FieldsParam<K>) => Promise<PageRes<Pick<NoteProperties, K> & CommonType>>

    Parameters

    • fn: F
    • pageParam: { query: string; type?: TypeEnum } & PageParam<NoteProperties> & FieldsParam<K>

    Returns Promise<(Pick<NoteProperties, K> & CommonType)[]>

Generated using TypeDoc