feat: 新增创作作品管理模块及相关配置
This commit is contained in:
15
workflow/consts/public/table_name.go
Normal file
15
workflow/consts/public/table_name.go
Normal file
@@ -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"
|
||||
)
|
||||
@@ -1,11 +0,0 @@
|
||||
package consts
|
||||
|
||||
// 数据库名称
|
||||
const (
|
||||
DbNameBlackDeacon = "black_deacon"
|
||||
)
|
||||
|
||||
// 数据库表名
|
||||
const (
|
||||
TableNameCreationInfo = "creation_info"
|
||||
)
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user