update: 更新配置文件中的服务地址,修改模型管理相关代码,调整数据结构和逻辑,优化模型列表查询和会话模型设置,更新数据库表结构和索引,修改模块名称和依赖版本
This commit is contained in:
@@ -3,9 +3,9 @@ package controller
|
||||
import (
|
||||
"context"
|
||||
|
||||
"model-asynch/model/dto"
|
||||
"model-asynch/model/entity"
|
||||
"model-asynch/service"
|
||||
"model-gateway/model/dto"
|
||||
"model-gateway/model/entity"
|
||||
"model-gateway/service"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
)
|
||||
@@ -38,21 +38,15 @@ func (c *model) GetModel(ctx context.Context, req *dto.GetModelReq) (res *dto.Ge
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if model == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return &dto.GetModelRes{Model: model}, nil
|
||||
}
|
||||
|
||||
// ListModel 配置列表
|
||||
func (c *model) ListModel(ctx context.Context, req *dto.ListModelReq) (res *dto.ListModelRes, err error) {
|
||||
pageNum, pageSize := 1, 10 //默认分页参数
|
||||
if req != nil {
|
||||
if req.PageNum > 0 {
|
||||
pageNum = req.PageNum
|
||||
}
|
||||
if req.PageSize > 0 {
|
||||
pageSize = req.PageSize
|
||||
}
|
||||
}
|
||||
list, total, err := service.Model.List(ctx, pageNum, pageSize, req)
|
||||
list, total, err := service.Model.List(ctx, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user