refactor(schemas): group network schemas by direction
Move request and response schemas into matching subdirectories, extract the shared chat lock type, and update barrels and imports without changing wire formats.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* 聊天历史响应
|
||||
*
|
||||
*/
|
||||
import { z } from "zod";
|
||||
|
||||
import {
|
||||
arrayOrEmpty,
|
||||
booleanOrFalse,
|
||||
numberOrZero,
|
||||
} from "../../nullable-defaults";
|
||||
import { ChatMessageSchema } from "../chat_message";
|
||||
|
||||
export const ChatHistoryResponseSchema = z.object({
|
||||
messages: arrayOrEmpty(ChatMessageSchema),
|
||||
total: numberOrZero,
|
||||
limit: numberOrZero,
|
||||
offset: numberOrZero,
|
||||
isVip: booleanOrFalse,
|
||||
privateFreeLimit: numberOrZero,
|
||||
privateUsedToday: numberOrZero,
|
||||
privateCanViewFree: booleanOrFalse,
|
||||
});
|
||||
|
||||
export type ChatHistoryResponseInput = z.input<typeof ChatHistoryResponseSchema>;
|
||||
export type ChatHistoryResponseData = z.output<typeof ChatHistoryResponseSchema>;
|
||||
Reference in New Issue
Block a user