feat: 更新数据库和后端服务
- 新增chat_sessions和chat_groups数据库表 - 更新skill_handler和model相关接口 - 修改main.go注册新路由 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -41,10 +41,10 @@ func (s *ModelService) Create(req model.CreateModelRequest) (*model.ModelInfo, e
|
||||
return nil, fmt.Errorf("model with name '%s' already exists", req.Name)
|
||||
}
|
||||
|
||||
// 如果没有提供状态,默认设置为 inactive
|
||||
// 如果没有提供状态,默认设置为 inactive (0)
|
||||
status := req.Status
|
||||
if status == "" {
|
||||
status = "inactive"
|
||||
if status == 0 {
|
||||
status = 0 // inactive
|
||||
}
|
||||
|
||||
info := &model.ModelInfo{
|
||||
@@ -96,7 +96,9 @@ func (s *ModelService) Update(id string, req model.UpdateModelRequest) (*model.M
|
||||
if req.APIEndpoint != "" {
|
||||
fields["api_endpoint"] = req.APIEndpoint
|
||||
}
|
||||
if req.Status != "" {
|
||||
// Status为int类型,0表示inactive,1表示active
|
||||
// 只在明确传入Status值时才更新(Status > 0 表示传入了值)
|
||||
if req.Status > 0 {
|
||||
fields["status"] = req.Status
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user