Files
cozsweet-frontend-nextjs/src/data/schemas/index.ts
T
admin 75e685d418 refactor(data): split models into separate dto and schema modules
Reorganize the data layer by separating DTOs (Data Transfer Objects) from
Zod validation schemas into distinct directory structures. Previously,
all model types were imported from a single `@/data/models` barrel
file, mixing request/response classes with validation schemas.

Changes:
- Update API files (auth, chat, metrics, user) to import DTOs from
  specific paths under `@/data/dto/*` instead of the models barrel
- Move user schema to `@/data/schemas/user/user` for type-only imports
- Create dedicated Zod schema files under `@/data/schemas/*` for
  auth and chat domain models (e.g., AppleLoginRequestSchema,
  SendMessageRequestSchema, SyncMessageSchema, SttDataSchema)
- Improve discoverability and tree-shaking by co-locating schemas
  with their respective domain areas

This is a non-functional refactor that lays the groundwork for
clearer separation between transport-layer types and runtime
validation.
2026-06-08 19:14:40 +08:00

43 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* Schemas - 集中导出
*
* Zod schema + 类型(Source of Truth
* 原始 Dart: lib/data/models/
*/
export * from "./auth/apple_login_request";
export * from "./auth/facebook_login_request";
export * from "./auth/fb_id_login_request";
export * from "./auth/google_login_request";
export * from "./auth/guest_login_request";
export * from "./auth/guest_login_response";
export * from "./auth/login_request";
export * from "./auth/login_response";
export * from "./auth/logout_response";
export * from "./auth/refresh_token_request";
export * from "./auth/refresh_token_response";
export * from "./auth/register_request";
export * from "./auth/send_code_request";
export * from "./chat/chat_history_response";
export * from "./chat/chat_message";
export * from "./chat/chat_send_response";
export * from "./chat/chat_sync_data";
export * from "./chat/chat_sync_request";
export * from "./chat/guest_chat_quota";
export * from "./chat/image_upload_response";
export * from "./chat/send_message_request";
export * from "./chat/stt_data";
export * from "./chat/sync_message";
export * from "./metrics/app_event";
export * from "./metrics/pwa_event";
export * from "./user/avatar_data";
export * from "./user/credits_data";
export * from "./user/credits_history_data";
export * from "./user/personality_traits";
export * from "./user/recent_memory";
export * from "./user/update_profile_request";
export * from "./user/user";
export * from "./user/user_stats_response";