cherry-studio/src/main/data
fullex 01d8888601 feat: extend UpdateMessageDto with traceId and stats fields
- Added optional fields `traceId` and `stats` to the `UpdateMessageDto` interface for enhanced message tracking and statistics.
- Updated `MessageService` to handle the new fields during message updates, ensuring they are correctly processed in the database.
2026-01-03 18:52:11 +08:00
..
api feat(api): enhance message deletion functionality with activeNodeId management 2025-12-29 13:42:05 +08:00
db docs(data): update README and remove outdated API design guidelines 2025-12-29 17:15:06 +08:00
migration/v2 refactor(migration): improve ChatMigrator's handling of duplicate messages and active node selection 2026-01-01 23:26:28 +08:00
services feat: extend UpdateMessageDto with traceId and stats fields 2026-01-03 18:52:11 +08:00
CacheService.ts feat(cache): enhance shared cache functionality and synchronization in main 2025-12-29 23:56:27 +08:00
DataApiService.ts feat: enhance CacheService and DataApiService documentation and structure 2025-11-01 18:36:28 +08:00
PreferenceService.ts refactor(preferences): rename and update multiple preferences result type 2025-12-02 15:09:32 +08:00
README.md docs(data): update README and remove outdated API design guidelines 2025-12-29 17:15:06 +08:00

Main Data Layer

This directory contains the main process data management implementation.

Documentation

Directory Structure

src/main/data/
├── api/                       # Data API framework
│   ├── core/                  # ApiServer, MiddlewareEngine, adapters
│   └── handlers/              # API endpoint implementations
├── services/                  # Business logic layer
├── repositories/              # Data access layer (selective usage)
├── db/                        # Database layer
│   ├── schemas/               # Drizzle table definitions
│   ├── seeding/               # Database initialization
│   └── DbService.ts           # Database connection management
├── migration/                 # Data migration system
├── CacheService.ts            # Cache management
├── DataApiService.ts          # API coordination
└── PreferenceService.ts       # User preferences

Quick Reference

Adding New API Endpoints

  1. Define schema in @shared/data/api/schemas/
  2. Implement handler in api/handlers/
  3. Create business service in services/
  4. Create repository in repositories/ (if complex domain)

Database Commands

# Generate migrations
yarn db:migrations:generate