What problem does it solve?
The api-generator skill removes repetitive and error-prone manual work when adding or refactoring backend APIs in the dst-admin-go repository by producing consistent model, service, handler, and router code that follows the project's architectural conventions and naming patterns.
Core Features & Use Cases
- Scaffolds three-layer modules: generates GORM models, service layer with dependency injection, Gin handlers with Swagger annotations, and router registrations.
- Enforces project patterns: ensures gorm.Model embedding, constructor-based dependency injection, snake_case filenames, and Chinese comments for exported methods.
- Handles DST specifics: supports cluster-aware routes, platform-aware service factories, game process and path resolver dependencies when needed, and provides curl test commands and compilation guidance.
- Use Case: quickly add a new CRUD resource (e.g., Announcement or ModInfo) with pagination, validation, and router integration while preserving existing project structure.
Quick Start
Create a full CRUD module for an entity named Announcement with fields Title (string, required), Content (text), IsActive (bool, default true), and update internal/api/router.go with the new service and handler.