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:
2026-03-13 14:33:54 +08:00
parent e19a0ba673
commit e5ea4ff359
5 changed files with 310 additions and 49 deletions

View File

@@ -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表示inactive1表示active
// 只在明确传入Status值时才更新Status > 0 表示传入了值)
if req.Status > 0 {
fields["status"] = req.Status
}