73 lines
3.6 KiB
Go
73 lines
3.6 KiB
Go
|
|
package tencent
|
|||
|
|
|
|||
|
|
import "github.com/gogf/gf/v2/frame/g"
|
|||
|
|
|
|||
|
|
// SyncImageReq 同步图片素材请求
|
|||
|
|
type SyncImageReq struct {
|
|||
|
|
g.Meta `path:"/syncImage" method:"post" tags:"腾讯广告图片素材" summary:"同步图片素材" dc:"遍历所有账户,自动分页获取图片素材并保存到数据库"`
|
|||
|
|
AccessToken string `json:"access_token" dc:"访问令牌(可选,不传则从配置读取)"`
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// SyncImageRes 同步图片素材响应
|
|||
|
|
type SyncImageRes struct {
|
|||
|
|
TotalAccounts int `json:"total_accounts" dc:"处理的账户数"`
|
|||
|
|
TotalImages int `json:"total_images" dc:"总图片数"`
|
|||
|
|
SyncedCount int `json:"synced_count" dc:"同步成功数量"`
|
|||
|
|
Message string `json:"message" dc:"消息"`
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ListImageReq 获取图片素材列表请求(旧接口,无分页)
|
|||
|
|
type ListImageReq struct {
|
|||
|
|
g.Meta `path:"/listImage" method:"post" tags:"腾讯广告图片素材" summary:"获取图片素材列表" dc:"从本地数据库查询所有图片素材(无分页)"`
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ListImagePageReq 分页查询图片素材请求
|
|||
|
|
type ListImagePageReq struct {
|
|||
|
|
g.Meta `path:"/listImagePage" method:"post" tags:"腾讯广告图片素材" summary:"分页查询图片素材" dc:"支持分页、时间过滤、账户过滤等条件查询"`
|
|||
|
|
Page int `json:"page" dc:"页码" d:"1"`
|
|||
|
|
PageSize int `json:"page_size" dc:"每页数量" d:"20"`
|
|||
|
|
AccountId *int64 `json:"account_id,omitempty" dc:"账户ID(可选)"`
|
|||
|
|
StartTime *int64 `json:"start_time,omitempty" dc:"开始时间戳(秒,可选)"`
|
|||
|
|
EndTime *int64 `json:"end_time,omitempty" dc:"结束时间戳(秒,可选)"`
|
|||
|
|
Status string `json:"status,omitempty" dc:"状态筛选(可选)"`
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ListImageQueryReq 图片素材查询请求(Service层使用)
|
|||
|
|
type ListImageQueryReq struct {
|
|||
|
|
Page int `json:"page" dc:"页码"`
|
|||
|
|
PageSize int `json:"page_size" dc:"每页数量"`
|
|||
|
|
AccountId *int64 `json:"account_id,omitempty" dc:"账户ID(可选)"`
|
|||
|
|
StartTime *int64 `json:"start_time,omitempty" dc:"开始时间戳(秒,可选)"`
|
|||
|
|
EndTime *int64 `json:"end_time,omitempty" dc:"结束时间戳(秒,可选)"`
|
|||
|
|
Status string `json:"status,omitempty" dc:"状态筛选(可选)"`
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ListImageRes 获取图片素材列表响应
|
|||
|
|
type ListImageRes struct {
|
|||
|
|
List []ImageItem `json:"list" dc:"图片素材列表"`
|
|||
|
|
Total int `json:"total" dc:"总记录数"`
|
|||
|
|
Page int `json:"page" dc:"当前页码"`
|
|||
|
|
PageSize int `json:"page_size" dc:"每页数量"`
|
|||
|
|
TotalPages int `json:"total_pages" dc:"总页数"`
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ImageItem 图片素材项
|
|||
|
|
type ImageItem struct {
|
|||
|
|
Id int64 `json:"id" dc:"主键ID"`
|
|||
|
|
ImageId string `json:"image_id" dc:"图片ID"`
|
|||
|
|
AccountId int64 `json:"account_id" dc:"账户ID"`
|
|||
|
|
Width int `json:"width" dc:"宽度"`
|
|||
|
|
Height int `json:"height" dc:"高度"`
|
|||
|
|
FileSize int64 `json:"file_size" dc:"文件大小"`
|
|||
|
|
Type string `json:"type" dc:"图片类型"`
|
|||
|
|
Signature string `json:"signature" dc:"签名"`
|
|||
|
|
Description string `json:"description" dc:"描述"`
|
|||
|
|
PreviewUrl string `json:"preview_url" dc:"预览URL"`
|
|||
|
|
ThumbPreviewUrl string `json:"thumb_preview_url" dc:"缩略图URL"`
|
|||
|
|
Status string `json:"status" dc:"状态"`
|
|||
|
|
CreatedTime int64 `json:"created_time" dc:"创建时间戳"`
|
|||
|
|
LastModifiedTime int64 `json:"last_modified_time" dc:"最后修改时间戳"`
|
|||
|
|
CreatedAt string `json:"created_at" dc:"数据库创建时间"`
|
|||
|
|
UpdatedAt string `json:"updated_at" dc:"数据库更新时间"`
|
|||
|
|
}
|