mirror of
https://github.com/labring/FastGPT.git
synced 2025-12-26 04:32:50 +00:00
* chat log soft delete * perf: history api * add history test * Update packages/web/i18n/en/app.json Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * zod parse error * fix: ts --------- Co-authored-by: archer <545436317@qq.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
18 lines
629 B
TypeScript
18 lines
629 B
TypeScript
import { z } from 'zod';
|
|
|
|
export const PaginationSchema = z.object({
|
|
pageSize: z.union([z.number(), z.string()]).optional(),
|
|
offset: z.union([z.number(), z.string()]).optional(),
|
|
pageNum: z.union([z.number(), z.string()]).optional()
|
|
});
|
|
export type PaginationType = z.infer<typeof PaginationSchema>;
|
|
|
|
export const PaginationResponseSchema = <T extends z.ZodTypeAny>(itemSchema: T) =>
|
|
z.object({
|
|
total: z.number().optional().default(0),
|
|
list: z.array(itemSchema).optional().default([])
|
|
});
|
|
export type PaginationResponseType<T extends z.ZodTypeAny> = z.infer<
|
|
ReturnType<typeof PaginationResponseSchema<T>>
|
|
>;
|