diff --git a/workflow/consts/public/table_name.go b/workflow/consts/public/table_name.go new file mode 100644 index 0000000..ff0229f --- /dev/null +++ b/workflow/consts/public/table_name.go @@ -0,0 +1,15 @@ +package public + +// 数据库名称 +const ( + DbNameBlackDeacon = "black_deacon" +) + +// 数据库表名 +const ( + TableNameCreationInfo = "creation_info" + TableNameFlowExecution = "flow_execution" + TableNameFlowUser = "flow_user" + TableNameSkillTemplate = "skill_template" + TableNameSkillUser = "skill_user" +) diff --git a/workflow/consts/table_name.go b/workflow/consts/table_name.go deleted file mode 100644 index ddffdf2..0000000 --- a/workflow/consts/table_name.go +++ /dev/null @@ -1,11 +0,0 @@ -package consts - -// 数据库名称 -const ( - DbNameBlackDeacon = "black_deacon" -) - -// 数据库表名 -const ( - TableNameCreationInfo = "creation_info" -) diff --git a/workflow/dao/creation_info_dao.go b/workflow/dao/creation_info_dao.go index acba202..0941ea6 100644 --- a/workflow/dao/creation_info_dao.go +++ b/workflow/dao/creation_info_dao.go @@ -1,7 +1,7 @@ package dao import ( - "ai-agent/workflow/consts" + "ai-agent/workflow/consts/public" "ai-agent/workflow/model/dto" "ai-agent/workflow/model/entity" "context" @@ -15,7 +15,7 @@ var CreationInfoDao = &creationInfoDao{} type creationInfoDao struct{} func (d *creationInfoDao) List(ctx context.Context, req *dto.ListCreationInfoReq, fields ...string) (res []*entity.CreationInfo, total int, err error) { - model := gfdb.DB(ctx, consts.DbNameBlackDeacon).Model(ctx, consts.TableNameCreationInfo).Fields(fields).OmitEmpty() + model := gfdb.DB(ctx, public.DbNameBlackDeacon).Model(ctx, public.TableNameCreationInfo).Fields(fields).OmitEmpty() model.Where(entity.CreationInfoCol.Creator, req.Creator) model.OrderDesc(entity.CreationInfoCol.CreatedAt) if req.Page != nil { @@ -35,7 +35,7 @@ func (d *creationInfoDao) Insert(ctx context.Context, req *dto.Create) (id int64 if err = gconv.Struct(req, e); err != nil { return } - r, err := gfdb.DB(ctx, consts.DbNameBlackDeacon).Model(ctx, consts.TableNameCreationInfo).Insert(e) + r, err := gfdb.DB(ctx, public.DbNameBlackDeacon).Model(ctx, public.TableNameCreationInfo).Insert(e) if err != nil { return }