feat: 新增创作作品管理模块及相关配置

This commit is contained in:
2026-05-08 11:51:10 +08:00
parent 74ede5bc0f
commit 2aec7fe30f
3 changed files with 18 additions and 14 deletions

View 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"
)

View File

@@ -1,11 +0,0 @@
package consts
// 数据库名称
const (
DbNameBlackDeacon = "black_deacon"
)
// 数据库表名
const (
TableNameCreationInfo = "creation_info"
)

View File

@@ -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
}