From 368726f60c7747d2ba7e2f9910af6923108b3561 Mon Sep 17 00:00:00 2001 From: Rogee Date: Thu, 18 Dec 2025 11:00:03 +0800 Subject: [PATCH] update llm.txt --- backend/llm.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/llm.txt b/backend/llm.txt index 9b0f62c..14e1297 100644 --- a/backend/llm.txt +++ b/backend/llm.txt @@ -162,9 +162,9 @@ 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`. + - `XxxItems() []requests.KV`: return the KV list for FE dropdowns (typically `Key=enum string`, `Value=Description()`). Example: `func TenantStatusItems() []requests.KV` and call it via `consts.TenantStatusItems()`. - 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. + - MUST: `Description()` and `XxxItems()` 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`