diff --git a/backend/llm.txt b/backend/llm.txt index a17a156..9b0f62c 100644 --- a/backend/llm.txt +++ b/backend/llm.txt @@ -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/`)