完善 MCP 工具

This commit is contained in:
2026-06-11 08:21:09 +08:00
parent c0f15050d0
commit 1415d3b43b
20 changed files with 3722 additions and 61 deletions
+6 -2
View File
@@ -219,11 +219,15 @@ type SSEEvent struct {
}
// TemplateService — prompt_templates CRUD。
//
// 鉴权语义:user 模板仅 owner 可改/删;system 模板仅 admin 可改/删
// (isAdmin 由调用方解析后传入;Create 的 system-scope admin 校验
// 仍在 HTTP handler / MCP 工具层,与既有行为一致)。
type TemplateService interface {
List(ctx context.Context, userID uuid.UUID) ([]PromptTemplate, error)
Create(ctx context.Context, userID uuid.UUID, name, content string, scope TemplateScope) (*PromptTemplate, error)
Update(ctx context.Context, userID, id uuid.UUID, name, content string) error
Delete(ctx context.Context, userID, id uuid.UUID) error
Update(ctx context.Context, userID uuid.UUID, isAdmin bool, id uuid.UUID, name, content string) error
Delete(ctx context.Context, userID uuid.UUID, isAdmin bool, id uuid.UUID) error
}
// EndpointService — admin LLM endpoints / models CRUD(管理员守卫上层处理)。