Files
ai-agent/workflow/model/dto/creation_info_dto.go

116 lines
3.6 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package dto
import (
"gitea.com/red-future/common/beans"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
)
type CreationInput struct {
g.Meta `path:"/creation" method:"post" tags:"创作作品管理" summary:"作品创作" dc:"作品创作"`
Mode string `json:"mode"`
ContentType string `json:"content_type"`
Theme string `json:"theme"`
Title string `json:"title"`
Style string `json:"style"`
Count int `json:"count"`
ImagePerPost int `json:"image_per_post"`
ImageRatio string `json:"image_ratio"`
Desc string `json:"desc"`
Content string `json:"content"`
}
type ImageUploadItem struct {
Title string `json:"title"` // 内容标题
Index int `json:"index"` // 第几条
ImageUrls []string `json:"image_urls"` // 上传成功的图片URL列表
HtmlFileUrl string `json:"html_file_url"` // 上传成功的HTML文件URL如有
Theme string `json:"theme"`
ContentType string `json:"content_type"`
}
// CreationOutput 接口最终返回结构体你原有dto这里补充完整
type CreationOutput struct {
SuccessCount int `json:"success_count"` // 成功条数
Items []ImageUploadItem `json:"items"` // 所有上传成功的详情
}
type Create struct {
HtmlFileUrl string
ImageUrls []string
ContentType string
Theme string
Title string
}
// UploadFileBytesReq 上传文件请求(字节流)
type UploadFileBytesReq struct {
FileName string `json:"fileName" dc:"文件名"`
FileBytes []byte `json:"fileBytes" dc:"文件字节流"`
FileStoreURL string `json:"fileStoreURL" dc:"文件存储URL"`
}
type UploadFileBytesRes struct {
FileURL string `json:"fileURL" dc:"上传地址"`
FileSize int `json:"fileSize" dc:"文件大小"`
FileName string `json:"fileName" dc:"文件名称"`
FileFormat string `json:"fileFormat" dc:"文件格式"`
FileAddressPrefix string `json:"fileAddressPrefix"`
}
type ListCreationInfoReq struct {
g.Meta `path:"/list" method:"get" tags:"创作作品管理" summary:"作品列表" dc:"作品列表"`
Page *beans.Page `json:"page"`
Creator string `json:"creator"`
}
type ListCreationInfoRes struct {
List []*CreationInfoVO `json:"list"`
Total int `json:"total"`
Tree []TimeNode
ImgAddressPrefix string `json:"imgAddressPrefix"`
}
type CreationInfoVO struct {
Id int64 `json:"id,string" dc:"id"`
HtmlFileUrl string `json:"htmlFileUrl"`
ImageUrls []string `json:"imageUrls"`
Theme string `json:"theme"`
Title string `json:"title"`
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"`
}
// 第一层:日期
type TimeNode struct {
CreatedDate string `json:"createdDate"`
ContentTypes []ContentTypeNode `json:"contentTypes"`
}
// 第二层ContentType
type ContentTypeNode struct {
ContentType string `json:"contentType"`
Themes []ThemeNode `json:"themes"`
}
// 第三层Theme
type ThemeNode struct {
Theme string `json:"theme"`
Titles []TitleNode `json:"titles"`
}
// Title 节点Title-1、Title-2...
type TitleNode struct {
Title string `json:"title"` // 标题+编号:如 通勤-1
HtmlFileUrl string `json:"htmlFileUrl"` // html地址
ImageUrls []ImgNode `json:"imageUrls"` // 图片列表
}
// 图片
type ImgNode struct {
Name string `json:"name"` // img+1
Url string `json:"url"`
}