update llm.txt
This commit is contained in:
@@ -160,6 +160,12 @@ Models live in:
|
||||
type UserStatus string
|
||||
```
|
||||
|
||||
- For every enum `type` defined under `backend/pkg/consts/`, you MUST also define:
|
||||
- `Description() string`: return the Chinese label for the specific enum value (used by API/FE display).
|
||||
- `Items() []requests.KV`: return the KV list for FE dropdowns (typically `Key=enum string`, `Value=Description()`). Prefer defining it as a type method like `func (UserStatus) Items() []requests.KV`.
|
||||
- Prefer `string(t)` as `Key`, and use a stable default label for unknown values (e.g. `未知` / `未知状态`).
|
||||
- MUST: these two methods MUST be placed immediately below the enum `type` definition (same file, directly under `type Xxx string`), to keep the enum self-contained and easy to review.
|
||||
|
||||
- Generate enum code: `atomctl gen enum`
|
||||
|
||||
### 2.3 Supported field types (`gen/types/`)
|
||||
|
||||
Reference in New Issue
Block a user