From 619f7a69a7eb2cd85d1392697fc11ba7c073a882 Mon Sep 17 00:00:00 2001 From: Rogee Date: Tue, 30 Dec 2025 22:18:52 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BC=BA=E5=88=B6=E5=9C=A8=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E5=99=A8=E5=B1=82=E6=8F=90=E5=8F=96context.Context?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E6=95=B0=E6=8D=AE=EF=BC=8C=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E9=9C=80=E6=8E=A5=E5=8F=97=E6=98=BE=E5=BC=8F?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/llm.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/llm.txt b/backend/llm.txt index 6a57964..45da07f 100644 --- a/backend/llm.txt +++ b/backend/llm.txt @@ -46,6 +46,7 @@ This file condenses `backend/docs/dev/http_api.md` + `backend/docs/dev/model.md` - MUST: when creating/generating Go `struct` definitions (DTOs/requests/responses/etc.), add detailed per-field comments describing meaning, usage scenario, and validation/usage rules (do not rely on “self-explanatory” names). - MUST: business code comments MUST be written in Chinese (中文注释), to keep review/maintenance consistent across the team. - MUST: in `backend/app/services`, add Chinese comments at key steps to explain business intent and invariants (e.g., 事务边界、幂等语义、余额冻结/扣减/回滚、权限/前置条件校验点), avoid “what the code does” boilerplate. +- MUST: Data extraction from `context.Context` (e.g., `userID`, `tenantID`) MUST be done in the **Controller** layer. Services MUST NOT extract data from `ctx`. Service methods MUST accept explicit parameters (e.g., `func (s *Service) DoSomething(ctx context.Context, userID int64, ...) error`). ---