fix(分组): 防止降级环并校验上下文分组

- 增加降级链路环检测并拦截配置

- 仅复用合法分组上下文并必要时回退查询

- 标注 GetByIDLite 轻量语义并补充测试
This commit is contained in:
yangjianbo
2026-01-10 07:56:50 +08:00
parent 675543240e
commit 2597fe78ba
8 changed files with 210 additions and 14 deletions

View File

@@ -70,6 +70,7 @@ func (r *groupRepository) GetByID(ctx context.Context, id int64) (*service.Group
}
func (r *groupRepository) GetByIDLite(ctx context.Context, id int64) (*service.Group, error) {
// AccountCount is intentionally not loaded here; use GetByID when needed.
m, err := r.client.Group.Query().
Where(group.IDEQ(id)).
Only(ctx)