新增 GetByIDLite 并在网关与 Gemini 选择流程复用上下文 group,避免 COUNT 触发 更新 API key 中间件注入 group 上下文,减少重复查库 补充 gateway/gemini 中间件与仓库层回归测试 测试: make test
15 lines
572 B
Go
15 lines
572 B
Go
// Package ctxkey 定义用于 context.Value 的类型安全 key
|
||
package ctxkey
|
||
|
||
// Key 定义 context key 的类型,避免使用内置 string 类型(staticcheck SA1029)
|
||
type Key string
|
||
|
||
const (
|
||
// ForcePlatform 强制平台(用于 /antigravity 路由),由 middleware.ForcePlatform 设置
|
||
ForcePlatform Key = "ctx_force_platform"
|
||
// IsClaudeCodeClient 是否为 Claude Code 客户端,由中间件设置
|
||
IsClaudeCodeClient Key = "ctx_is_claude_code_client"
|
||
// Group 认证后的分组信息,由 API Key 认证中间件设置
|
||
Group Key = "ctx_group"
|
||
)
|