feat: 更新后端服务

- agent_handler.go: 新增agent管理接口
- agent_service.go: 扩展agent服务逻辑
- skill_handler.go: 更新skill接口
- chat_service.go: 更新chat服务
- model相关: 新增model仓库和服务
- main.go: 更新路由配置

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-12 23:18:46 +08:00
parent 5b50d6ff9a
commit 5dc2e403e9
11 changed files with 335 additions and 109 deletions

View File

@@ -166,14 +166,11 @@ func (s *ChatService) ListAgents(userID string) ([]model.Agent, error) {
// CreateAgent 创建新的 Agent
func (s *ChatService) CreateAgent(userID string, name, description string) (*model.Agent, error) {
agent := &model.Agent{
ID: uuid.New().String(),
Name: name,
Description: description,
OwnerID: userID,
SecurityLevel: model.SecurityLevelSafe,
IsActive: true,
Timeout: 60,
MemoryLimit: 134217728, // 128MB
ID: uuid.New().String(),
Name: name,
Description: description,
OwnerID: userID,
IsActive: true,
}
if err := s.agentRepo.Create(agent); err != nil {