同步音频和图片
This commit is contained in:
48
model/dto/tencent/account_relation_dto.go
Normal file
48
model/dto/tencent/account_relation_dto.go
Normal 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"`
|
||||
}
|
||||
22
model/dto/tencent/audio_dto.go
Normal file
22
model/dto/tencent/audio_dto.go
Normal 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:"消息"`
|
||||
}
|
||||
72
model/dto/tencent/image_dto.go
Normal file
72
model/dto/tencent/image_dto.go
Normal 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:"数据库更新时间"`
|
||||
}
|
||||
19
model/dto/tencent/oauth_dto.go
Normal file
19
model/dto/tencent/oauth_dto.go
Normal 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:"刷新令牌过期时间(秒)"`
|
||||
}
|
||||
56
model/entity/tencent/account_relation.go
Normal file
56
model/entity/tencent/account_relation.go
Normal file
@@ -0,0 +1,56 @@
|
||||
package tencent
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// AccountRelation 腾讯广告账户关系实体
|
||||
type AccountRelation struct {
|
||||
Id int64 `orm:"id" json:"id" description:"主键ID"`
|
||||
TenantId int64 `orm:"tenant_id" json:"tenantId" description:"租户ID"`
|
||||
Creator string `orm:"creator" json:"creator" description:"创建人"`
|
||||
CreatedAt *time.Time `orm:"created_at" json:"createdAt" description:"创建时间"`
|
||||
Updater string `orm:"updater" json:"updater" description:"更新人"`
|
||||
UpdatedAt *time.Time `orm:"updated_at" json:"updatedAt" description:"更新时间"`
|
||||
DeletedAt *time.Time `orm:"deleted_at" json:"deletedAt" description:"软删除时间"`
|
||||
AccountID int64 `orm:"account_id" json:"accountId" description:"账户ID"`
|
||||
CorporationName string `orm:"corporation_name" json:"corporationName" description:"公司名称"`
|
||||
CommentDataList string `orm:"comment_data_list" json:"commentDataList" description:"备注数据列表JSON"`
|
||||
IsAdx bool `orm:"is_adx" json:"isAdx" description:"是否ADX"`
|
||||
IsBid bool `orm:"is_bid" json:"isBid" description:"是否BID"`
|
||||
IsMp bool `orm:"is_mp" json:"isMp" description:"是否MP"`
|
||||
}
|
||||
|
||||
// AccountRelationCol 账户关系表字段定义
|
||||
type AccountRelationCol struct {
|
||||
ID string
|
||||
TenantID string
|
||||
Creator string
|
||||
CreatedAt string
|
||||
Updater string
|
||||
UpdatedAt string
|
||||
DeletedAt string
|
||||
AccountID string
|
||||
CorporationName string
|
||||
CommentDataList string
|
||||
IsAdx string
|
||||
IsBid string
|
||||
IsMp string
|
||||
}
|
||||
|
||||
// AccountRelationCols 账户关系表字段常量
|
||||
var AccountRelationCols = AccountRelationCol{
|
||||
ID: "id",
|
||||
TenantID: "tenant_id",
|
||||
Creator: "creator",
|
||||
CreatedAt: "created_at",
|
||||
Updater: "updater",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
AccountID: "account_id",
|
||||
CorporationName: "corporation_name",
|
||||
CommentDataList: "comment_data_list",
|
||||
IsAdx: "is_adx",
|
||||
IsBid: "is_bid",
|
||||
IsMp: "is_mp",
|
||||
}
|
||||
62
model/entity/tencent/audio.go
Normal file
62
model/entity/tencent/audio.go
Normal file
@@ -0,0 +1,62 @@
|
||||
package tencent
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// Audio 腾讯广告音乐素材实体
|
||||
type Audio struct {
|
||||
Id int64 `orm:"id" json:"id" description:"主键ID"`
|
||||
TenantId int64 `orm:"tenant_id" json:"tenantId" description:"租户ID"`
|
||||
Creator string `orm:"creator" json:"creator" description:"创建人"`
|
||||
CreatedAt *time.Time `orm:"created_at" json:"createdAt" description:"创建时间"`
|
||||
Updater string `orm:"updater" json:"updater" description:"更新人"`
|
||||
UpdatedAt *time.Time `orm:"updated_at" json:"updatedAt" description:"更新时间"`
|
||||
DeletedAt *time.Time `orm:"deleted_at" json:"deletedAt" description:"软删除时间"`
|
||||
AudioId string `orm:"audio_id" json:"audioId" description:"音乐ID"`
|
||||
CoverImageUrl string `orm:"cover_image_url" json:"coverImageUrl" description:"封面图片URL"`
|
||||
AudioName string `orm:"audio_name" json:"audioName" description:"音乐名称"`
|
||||
Author string `orm:"author" json:"author" description:"作者"`
|
||||
Duration float64 `orm:"duration" json:"duration" description:"时长(秒)"`
|
||||
ExpireTime int64 `orm:"expire_time" json:"expireTime" description:"过期时间戳"`
|
||||
FeelTags string `orm:"feel_tags" json:"feelTags" description:"情感标签数组JSON"`
|
||||
GenreTags string `orm:"genre_tags" json:"genreTags" description:"风格标签数组JSON"`
|
||||
}
|
||||
|
||||
// AudioCol 音乐素材表字段定义
|
||||
type AudioCol struct {
|
||||
Id string
|
||||
TenantId string
|
||||
Creator string
|
||||
CreatedAt string
|
||||
Updater string
|
||||
UpdatedAt string
|
||||
DeletedAt string
|
||||
AudioId string
|
||||
CoverImageUrl string
|
||||
AudioName string
|
||||
Author string
|
||||
Duration string
|
||||
ExpireTime string
|
||||
FeelTags string
|
||||
GenreTags string
|
||||
}
|
||||
|
||||
// AudioCols 音乐素材表字段常量
|
||||
var AudioCols = AudioCol{
|
||||
Id: "id",
|
||||
TenantId: "tenant_id",
|
||||
Creator: "creator",
|
||||
CreatedAt: "created_at",
|
||||
Updater: "updater",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
AudioId: "audio_id",
|
||||
CoverImageUrl: "cover_image_url",
|
||||
AudioName: "audio_name",
|
||||
Author: "author",
|
||||
Duration: "duration",
|
||||
ExpireTime: "expire_time",
|
||||
FeelTags: "feel_tags",
|
||||
GenreTags: "genre_tags",
|
||||
}
|
||||
117
model/entity/tencent/image.go
Normal file
117
model/entity/tencent/image.go
Normal file
@@ -0,0 +1,117 @@
|
||||
package tencent
|
||||
|
||||
import (
|
||||
"gitea.com/red-future/common/beans"
|
||||
)
|
||||
|
||||
// Image 腾讯广告图片素材实体
|
||||
type Image struct {
|
||||
beans.SQLBaseDO `orm:",inherit"`
|
||||
|
||||
ImageId string `orm:"image_id" json:"imageId" description:"图片ID"`
|
||||
AccountId int64 `orm:"account_id" json:"accountId" description:"账户ID"`
|
||||
Width int `orm:"width" json:"width" description:"宽度"`
|
||||
Height int `orm:"height" json:"height" description:"高度"`
|
||||
FileSize int64 `orm:"file_size" json:"fileSize" description:"文件大小"`
|
||||
Type string `orm:"type" json:"type" description:"图片类型"`
|
||||
Signature string `orm:"signature" json:"signature" description:"签名"`
|
||||
Description string `orm:"description" json:"description" description:"描述"`
|
||||
SourceSignature string `orm:"source_signature" json:"sourceSignature" description:"源签名"`
|
||||
PreviewUrl string `orm:"preview_url" json:"previewUrl" description:"预览URL"`
|
||||
ThumbPreviewUrl string `orm:"thumb_preview_url" json:"thumbPreviewUrl" description:"缩略图URL"`
|
||||
SourceType string `orm:"source_type" json:"sourceType" description:"来源类型"`
|
||||
ImageUsage string `orm:"image_usage" json:"imageUsage" description:"图片用途"`
|
||||
CreatedTime int64 `orm:"created_time" json:"createdTime" description:"创建时间戳"`
|
||||
LastModifiedTime int64 `orm:"last_modified_time" json:"lastModifiedTime" description:"最后修改时间戳"`
|
||||
ProductCatalogId int64 `orm:"product_catalog_id" json:"productCatalogId" description:"产品目录ID"`
|
||||
ProductOuterId string `orm:"product_outer_id" json:"productOuterId" description:"产品外部ID"`
|
||||
SourceReferenceId string `orm:"source_reference_id" json:"sourceReferenceId" description:"源引用ID"`
|
||||
OwnerAccountId string `orm:"owner_account_id" json:"ownerAccountId" description:"所有者账户ID"`
|
||||
Status string `orm:"status" json:"status" description:"状态"`
|
||||
SampleAspectRatio string `orm:"sample_aspect_ratio" json:"sampleAspectRatio" description:"示例宽高比"`
|
||||
SourceMaterialId string `orm:"source_material_id" json:"sourceMaterialId" description:"源素材ID"`
|
||||
NewSourceType string `orm:"new_source_type" json:"newSourceType" description:"新来源类型"`
|
||||
FirstPublicationStatus string `orm:"first_publication_status" json:"firstPublicationStatus" description:"首次发布状态"`
|
||||
QualityStatus string `orm:"quality_status" json:"qualityStatus" description:"质量状态"`
|
||||
SimilarityStatus string `orm:"similarity_status" json:"similarityStatus" description:"相似度状态"`
|
||||
UserAigcStatus string `orm:"user_aigc_status" json:"userAigcStatus" description:"用户AIGC状态"`
|
||||
SystemAigcStatus string `orm:"system_aigc_status" json:"systemAigcStatus" description:"系统AIGC状态"`
|
||||
AigcSource string `orm:"aigc_source" json:"aigcSource" description:"AIGC来源"`
|
||||
AigcFlag string `orm:"aigc_flag" json:"aigcFlag" description:"AIGC标志"`
|
||||
MuseAigcVersion int `orm:"muse_aigc_version" json:"museAigcVersion" description:"Muse AIGC版本"`
|
||||
AigcType int `orm:"aigc_type" json:"aigcType" description:"AIGC类型"`
|
||||
}
|
||||
|
||||
// ImageCol 图片素材表字段定义
|
||||
type ImageCol struct {
|
||||
beans.SQLBaseCol
|
||||
ImageId string
|
||||
AccountId string
|
||||
Width string
|
||||
Height string
|
||||
FileSize string
|
||||
Type string
|
||||
Signature string
|
||||
Description string
|
||||
SourceSignature string
|
||||
PreviewUrl string
|
||||
ThumbPreviewUrl string
|
||||
SourceType string
|
||||
ImageUsage string
|
||||
CreatedTime string
|
||||
LastModifiedTime string
|
||||
ProductCatalogId string
|
||||
ProductOuterId string
|
||||
SourceReferenceId string
|
||||
OwnerAccountId string
|
||||
Status string
|
||||
SampleAspectRatio string
|
||||
SourceMaterialId string
|
||||
NewSourceType string
|
||||
FirstPublicationStatus string
|
||||
QualityStatus string
|
||||
SimilarityStatus string
|
||||
UserAigcStatus string
|
||||
SystemAigcStatus string
|
||||
AigcSource string
|
||||
AigcFlag string
|
||||
MuseAigcVersion string
|
||||
AigcType string
|
||||
}
|
||||
|
||||
// ImageCols 图片素材表字段常量
|
||||
var ImageCols = ImageCol{
|
||||
SQLBaseCol: beans.DefSQLBaseCol,
|
||||
ImageId: "image_id",
|
||||
AccountId: "account_id",
|
||||
Width: "width",
|
||||
Height: "height",
|
||||
FileSize: "file_size",
|
||||
Type: "type",
|
||||
Signature: "signature",
|
||||
Description: "description",
|
||||
SourceSignature: "source_signature",
|
||||
PreviewUrl: "preview_url",
|
||||
ThumbPreviewUrl: "thumb_preview_url",
|
||||
SourceType: "source_type",
|
||||
ImageUsage: "image_usage",
|
||||
CreatedTime: "created_time",
|
||||
LastModifiedTime: "last_modified_time",
|
||||
ProductCatalogId: "product_catalog_id",
|
||||
ProductOuterId: "product_outer_id",
|
||||
SourceReferenceId: "source_reference_id",
|
||||
OwnerAccountId: "owner_account_id",
|
||||
Status: "status",
|
||||
SampleAspectRatio: "sample_aspect_ratio",
|
||||
SourceMaterialId: "source_material_id",
|
||||
NewSourceType: "new_source_type",
|
||||
FirstPublicationStatus: "first_publication_status",
|
||||
QualityStatus: "quality_status",
|
||||
SimilarityStatus: "similarity_status",
|
||||
UserAigcStatus: "user_aigc_status",
|
||||
SystemAigcStatus: "system_aigc_status",
|
||||
AigcSource: "aigc_source",
|
||||
AigcFlag: "aigc_flag",
|
||||
MuseAigcVersion: "muse_aigc_version",
|
||||
AigcType: "aigc_type",
|
||||
}
|
||||
Reference in New Issue
Block a user