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:
@@ -32,6 +32,16 @@ func (r *ModelRepository) FindByID(id string) (*model.ModelInfo, error) {
|
||||
return &model, nil
|
||||
}
|
||||
|
||||
// FindByName 根据名称获取模型
|
||||
func (r *ModelRepository) FindByName(name string) (*model.ModelInfo, error) {
|
||||
var model model.ModelInfo
|
||||
err := r.db.Where("name = ?", name).First(&model).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &model, nil
|
||||
}
|
||||
|
||||
// Create 创建模型
|
||||
func (r *ModelRepository) Create(info *model.ModelInfo) error {
|
||||
return r.db.Create(info).Error
|
||||
|
||||
Reference in New Issue
Block a user