forked from mengyxu/noob-components
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2.6 KiB
2.6 KiB
Fill plugs/api spec
Goal
Analyze the plugs/api/ directory and fill the coding spec with real API patterns, request/response types, and anti-patterns.
Context
Project Overview
- Type: Vue 3 Component Library (Element Plus based)
- Framework: Vue 3 + TypeScript + Vite
- Key Patterns: Composables, API Layer, Store Pattern
Architecture
The plugs/api/ directory provides typed API functions that wrap HTTP calls. These are used by composables and components to interact with backend services.
Key API Modules (from GitNexus)
| Module | File | Purpose |
|---|---|---|
| user | plugs/api/user.ts | User CRUD operations |
| role | plugs/api/role.ts | Role management |
| permission | plugs/api/permission.ts | Permission management |
| dictionary | plugs/api/dictionary.ts | Dictionary data |
| config | plugs/api/config.ts | System config |
| log | plugs/api/log.ts | Log operations |
| public | plugs/api/public.ts | Public endpoints |
| buffer | plugs/api/buffer.ts | Buffer operations |
| base | plugs/api/base.ts | Base API utilities |
Execution Flows
Get → Close(read operations)Put → Close(update operations)Post → Close(create operations)Del → Close(delete operations)Upload → Close(file upload)
Tools Available
GitNexus MCP
| Tool | Purpose |
|---|---|
gitnexus_query |
Find execution flows related to API calls |
gitnexus_context |
View API function definitions |
gitnexus_cypher |
Query API-related symbols |
ABCoder MCP
| Tool | Purpose |
|---|---|
get_file_structure |
Get all exports from API files |
Files to Fill
Primary files:
- plugs/api/base.ts - Base API utilities, common patterns
- plugs/api/user.ts - User API with all CRUD operations
- plugs/api/role.ts - Role management API
- plugs/api/permission.ts - Permission API
- plugs/api/dictionary.ts - Dictionary API
- plugs/api/config.ts - Config API
- plugs/api/log.ts - Log API
- plugs/api/public.ts - Public endpoints
- plugs/api/buffer.ts - Buffer API
Document:
- Request/response type patterns
- Error handling conventions
- URL naming conventions
- Common patterns across all API files
Acceptance Criteria
- Real code examples with file paths
- API function signatures documented
- Type definitions captured
- Anti-patterns documented (if any)
- No placeholder text
Technical Notes
- HTTP client: Axios (axios, axios2, axios3 variants in plugs/http/)
- Returns: Typically Promise with typed responses
- Related: plugs/http/* for HTTP client configs