同步音频和图片

This commit is contained in:
2026-05-06 16:19:22 +08:00
parent 3814c95047
commit 162bab15e6
22 changed files with 5970 additions and 2 deletions

View File

@@ -0,0 +1,48 @@
package tencent
import "github.com/gogf/gf/v2/frame/g"
// GetAccountRelationReq 获取账户关系请求
type GetAccountRelationReq struct {
g.Meta `path:"/getAccountRelation" method:"post" tags:"腾讯广告账户关系" summary:"获取账户关系列表" dc:"从腾讯广告API获取账户关系数据"`
AccessToken string `json:"access_token" dc:"访问令牌"`
Timestamp int64 `json:"timestamp" dc:"时间戳"`
Nonce string `json:"nonce" dc:"随机字符串"`
PaginationMode string `json:"pagination_mode" dc:"分页模式" d:"PAGINATION_MODE_NORMAL"`
Page int `json:"page" dc:"页码" d:"1"`
PageSize int `json:"page_size" dc:"每页数量" d:"100"`
}
// SyncAccountRelationReq 同步账户关系请求
type SyncAccountRelationReq struct {
g.Meta `path:"/syncAccountRelation" method:"post" tags:"腾讯广告账户关系" summary:"同步账户关系" dc:"自动分页获取所有账户关系并保存到数据库"`
AccessToken string `json:"access_token" dc:"访问令牌(可选,不传则从配置读取)"`
}
// SyncAccountRelationRes 同步账户关系响应
type SyncAccountRelationRes struct {
TotalNumber int `json:"total_number" dc:"总记录数"`
TotalPage int `json:"total_page" dc:"总页数"`
SyncedCount int `json:"synced_count" dc:"同步成功数量"`
Message string `json:"message" dc:"消息"`
}
// ListAccountRelationReq 获取账户关系列表请求
type ListAccountRelationReq struct {
g.Meta `path:"/listAccountRelation" method:"post" tags:"腾讯广告账户关系" summary:"获取账户关系列表" dc:"从本地数据库查询账户关系列表"`
}
// ListAccountRelationRes 获取账户关系列表响应
type ListAccountRelationRes struct {
List []AccountRelationItem `json:"list" dc:"账户关系列表"`
}
// AccountRelationItem 账户关系项
type AccountRelationItem struct {
ID int64 `json:"id" dc:"主键ID"`
AccountID int64 `json:"account_id" dc:"账户ID"`
CorporationName string `json:"corporation_name" dc:"公司名称"`
IsAdx bool `json:"is_adx" dc:"是否ADX"`
IsBid bool `json:"is_bid" dc:"是否BID"`
IsMp bool `json:"is_mp" dc:"是否MP"`
}

View File

@@ -0,0 +1,22 @@
package tencent
import "github.com/gogf/gf/v2/frame/g"
// SyncAudioReq 同步音乐素材请求
type SyncAudioReq struct {
g.Meta `path:"/syncAudio" method:"post" tags:"腾讯广告音乐素材" summary:"同步音乐素材" dc:"自动分页获取所有音乐素材并保存到数据库"`
AccessToken string `json:"access_token" dc:"访问令牌(可选,不传则从配置读取)"`
}
// ListAudioReq 获取音乐素材列表请求
type ListAudioReq struct {
g.Meta `path:"/listAudio" method:"post" tags:"腾讯广告音乐素材" summary:"获取音乐素材列表" dc:"从本地数据库查询音乐素材列表"`
}
// SyncAudioRes 同步音乐素材响应
type SyncAudioRes struct {
TotalNumber int `json:"total_number" dc:"总记录数"`
TotalPage int `json:"total_page" dc:"总页数"`
SyncedCount int `json:"synced_count" dc:"同步成功数量"`
Message string `json:"message" dc:"消息"`
}

View File

@@ -0,0 +1,72 @@
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:"数据库更新时间"`
}

View File

@@ -0,0 +1,19 @@
package tencent
import "github.com/gogf/gf/v2/frame/g"
// RefreshTokenReq 刷新Token请求
type RefreshTokenReq struct {
g.Meta `path:"/refreshToken" method:"post" tags:"腾讯广告OAuth" summary:"刷新访问令牌" dc:"使用refresh_token获取新的access_token"`
ClientID string `json:"client_id" dc:"客户端ID"`
ClientSecret string `json:"client_secret" dc:"客户端密钥"`
RefreshToken string `json:"refresh_token" dc:"刷新令牌"`
}
// RefreshTokenRes 刷新Token响应
type RefreshTokenRes struct {
AccessToken string `json:"access_token" dc:"访问令牌"`
RefreshToken string `json:"refresh_token" dc:"新的刷新令牌"`
AccessTokenExpiresIn int64 `json:"access_token_expires_in" dc:"访问令牌过期时间(秒)"`
RefreshTokenExpiresIn int64 `json:"refresh_token_expires_in" dc:"刷新令牌过期时间(秒)"`
}