diff --git a/api/file/ad_video_delete.go b/api/file/ad_video_delete.go new file mode 100644 index 0000000..eac826c --- /dev/null +++ b/api/file/ad_video_delete.go @@ -0,0 +1,15 @@ +package file + +import ( + "github.com/bububa/kwai-marketing-api/core" + "github.com/bububa/kwai-marketing-api/model/file" +) + +// AdVideoDelete 批量删除视频 +func AdVideoDelete(clt *core.SDKClient, accessToken string, req *file.AdVideoDeleteRequest) ([]string, error) { + var ret file.AdVideoDeleteResponse + if err := clt.Post(accessToken, req, &ret); err != nil { + return nil, err + } + return ret.PhotoIDs, nil +} diff --git a/api/file/ad_video_share_new.go b/api/file/ad_video_share_new.go new file mode 100644 index 0000000..28f03ed --- /dev/null +++ b/api/file/ad_video_share_new.go @@ -0,0 +1,15 @@ +package file + +import ( + "github.com/bububa/kwai-marketing-api/core" + "github.com/bububa/kwai-marketing-api/model/file" +) + +// AdVideoShareNew 视频库-推送视频(新版) +func AdVideoShareNew(clt *core.SDKClient, accessToken string, req *file.AdVideoShareNewRequest) (*file.AdVideoShareNewResponse, error) { + var resp file.AdVideoShareNewResponse + if err := clt.Post(accessToken, req, &resp); err != nil { + return nil, err + } + return &resp, nil +} diff --git a/api/file/ad_video_update.go b/api/file/ad_video_update.go index d3fb2fa..0ed4ab1 100644 --- a/api/file/ad_video_update.go +++ b/api/file/ad_video_update.go @@ -6,6 +6,10 @@ import ( ) // AdVideoUpdate 视频库-批量更新视频功能 -func AdVideoUpdate(clt *core.SDKClient, accessToken string, req *file.AdVideoUpdateRequest) error { - return clt.Post(accessToken, req, nil) +func AdVideoUpdate(clt *core.SDKClient, accessToken string, req *file.AdVideoUpdateRequest) ([]string, error) { + var ret file.AdVideoUpdateResponse + if err := clt.Post(accessToken, req, &ret); err != nil { + return nil, err + } + return ret.PhotoIDs, nil } diff --git a/api/file/pic_share.go b/api/file/pic_share.go new file mode 100644 index 0000000..2511724 --- /dev/null +++ b/api/file/pic_share.go @@ -0,0 +1,15 @@ +package file + +import ( + "github.com/bububa/kwai-marketing-api/core" + "github.com/bububa/kwai-marketing-api/model/file" +) + +// PicShare 图片库推送 +func PicShare(clt *core.SDKClient, accessToken string, req *file.PicShareRequest) ([]file.PicShareResult, error) { + var resp file.PicShareResponse + if err := clt.Post(accessToken, req, &resp); err != nil { + return nil, err + } + return resp.Details, nil +} diff --git a/api/file/upload_atlas_photo.go b/api/file/upload_atlas_photo.go new file mode 100644 index 0000000..d1d713f --- /dev/null +++ b/api/file/upload_atlas_photo.go @@ -0,0 +1,15 @@ +package file + +import ( + "github.com/bububa/kwai-marketing-api/core" + "github.com/bububa/kwai-marketing-api/model/file" +) + +// UploadAtlasPhoto 上传图文视频 +func UploadAtlasPhoto(clt *core.SDKClient, accessToken string, req *file.UploadAtlasPhotoRequest) (string, error) { + var ret file.UploadAtlasPhotoResponse + if err := clt.Post(accessToken, req, &ret); err != nil { + return "", err + } + return ret.PhotoID, nil +} diff --git a/model/file/ad_image_get_request.go b/model/file/ad_image_get.go similarity index 100% rename from model/file/ad_image_get_request.go rename to model/file/ad_image_get.go diff --git a/model/file/ad_image_list_request.go b/model/file/ad_image_list.go similarity index 53% rename from model/file/ad_image_list_request.go rename to model/file/ad_image_list.go index 2275a44..a35ed25 100644 --- a/model/file/ad_image_list_request.go +++ b/model/file/ad_image_list.go @@ -1,7 +1,7 @@ package file import ( - "encoding/json" + "github.com/bububa/kwai-marketing-api/model" ) // AdImageListRequest 查询图片接口list接口API Request @@ -12,6 +12,13 @@ type AdImageListRequest struct { StartDate string `json:"start_date,omitempty"` // EndDate 结束时间 EndDate string `json:"end_date,omitempty"` + // PicTypes 图片类型 + // 0-默认,5-竖版,6-横版,12-开屏。不填,则获取所有类型图片 + PicTypes []int `json:"pic_types,omitempty"` + // ImageToken 图片 token + ImageToken string `json:"image_token,omitempty"` + // ImageTokens 图片 tokens + ImageTokens []string `json:"image_tokens,omitempty"` // Page 请求的页码数 Page int `json:"page,omitempty"` // PageSize 每页行数 @@ -25,6 +32,13 @@ func (r AdImageListRequest) Url() string { // Encode implement GetRequest interface func (r AdImageListRequest) Encode() []byte { - ret, _ := json.Marshal(r) - return ret + return model.JSONMarshal(r) +} + +// AdImageListResponse 查询图片接口list接口 API Response +type AdImageListResponse struct { + // TotalCount 图片总数 + TotalCount int `json:"total_count,omitempty"` + // Details 详情 + Details []Image `json:"details,omitempty"` } diff --git a/model/file/ad_image_list_response.go b/model/file/ad_image_list_response.go deleted file mode 100644 index 41f7de5..0000000 --- a/model/file/ad_image_list_response.go +++ /dev/null @@ -1,9 +0,0 @@ -package file - -// AdImageListResponse 查询图片接口list接口 API Response -type AdImageListResponse struct { - // TotalCount 图片总数 - TotalCount int `json:"total_count,omitempty"` - // Details 详情 - Details []Image `json:"details,omitempty"` -} diff --git a/model/file/ad_image_upload_request_v1.go b/model/file/ad_image_upload_v1.go similarity index 100% rename from model/file/ad_image_upload_request_v1.go rename to model/file/ad_image_upload_v1.go diff --git a/model/file/ad_image_upload_request_v2.go b/model/file/ad_image_upload_v2.go similarity index 100% rename from model/file/ad_image_upload_request_v2.go rename to model/file/ad_image_upload_v2.go diff --git a/model/file/ad_video_delete.go b/model/file/ad_video_delete.go new file mode 100644 index 0000000..1016d45 --- /dev/null +++ b/model/file/ad_video_delete.go @@ -0,0 +1,29 @@ +package file + +import ( + "github.com/bububa/kwai-marketing-api/model" +) + +// AdVideoDeleteRequest 批量删除视频 API Request +type AdVideoDeleteRequest struct { + // AdvertiserID 广告主 id + AdvertiserID uint64 `json:"advertiser_id,omitempty"` + // PhotoIDs 视频 ids,不超过 100 个 + PhotoIDs []string `json:"photo_ids,omitempty"` +} + +// Url implement PostRequest interface +func (r AdVideoDeleteRequest) Url() string { + return "gw/dsp/file/ad/video/delete" +} + +// Encode implement PostRequest interface +func (r AdVideoDeleteRequest) Encode() []byte { + return model.JSONMarshal(r) +} + +// AdVideoDeleteResponse 批量删除视频 API Response +type AdVideoDeleteResponse struct { + // PhotoIDs 视频 ids + PhotoIDs []string `json:"photo_ids,omitempty"` +} diff --git a/model/file/ad_video_get_request.go b/model/file/ad_video_get.go similarity index 84% rename from model/file/ad_video_get_request.go rename to model/file/ad_video_get.go index 850bcb2..00cb3e5 100644 --- a/model/file/ad_video_get_request.go +++ b/model/file/ad_video_get.go @@ -1,6 +1,8 @@ package file -import "encoding/json" +import ( + "github.com/bububa/kwai-marketing-api/model" +) // AdVideoGetRequest 获取视频信息get接口 API Request type AdVideoGetRequest struct { @@ -17,6 +19,5 @@ func (r AdVideoGetRequest) Url() string { // Encode implement PostRequest interface func (r AdVideoGetRequest) Encode() []byte { - ret, _ := json.Marshal(r) - return ret + return model.JSONMarshal(r) } diff --git a/model/file/ad_video_list_request.go b/model/file/ad_video_list.go similarity index 57% rename from model/file/ad_video_list_request.go rename to model/file/ad_video_list.go index ee9976f..5b60dcc 100644 --- a/model/file/ad_video_list_request.go +++ b/model/file/ad_video_list.go @@ -1,6 +1,8 @@ package file -import "encoding/json" +import ( + "github.com/bububa/kwai-marketing-api/model" +) // AdVideoListRequest 查询视频接口list接口API Request type AdVideoListRequest struct { @@ -18,6 +20,10 @@ type AdVideoListRequest struct { Page int `json:"page,omitempty"` // PageSize 每页行数 PageSize int `json:"page_size,omitempty"` + // OuterLoopNative 是否查询原生视频:0=查询非原生视频;1=查询原生视频。 + OuterLoopNative *int `json:"outer_loop_native,omitempty"` + // PhotoUserID 视频所属的userId,仅针对原生视频生效,且查询原生视频时必须传递,且仅当视频来源为“本地上传”与“快手客户端(个人主页)”生效。 + PhotoUserID uint64 `json:"photo_user_id,omitempty"` } // Url implement PostRequest interface @@ -27,6 +33,13 @@ func (r AdVideoListRequest) Url() string { // Encode implement PostRequest interface func (r AdVideoListRequest) Encode() []byte { - ret, _ := json.Marshal(r) - return ret + return model.JSONMarshal(r) +} + +// AdVideoListResponse 查询视频接口list接口 API Response +type AdVideoListResponse struct { + // TotalCount 图片总数 + TotalCount int `json:"total_count,omitempty"` + // Details 详情 + Details []Video `json:"details,omitempty"` } diff --git a/model/file/ad_video_list_response.go b/model/file/ad_video_list_response.go deleted file mode 100644 index 8ff099a..0000000 --- a/model/file/ad_video_list_response.go +++ /dev/null @@ -1,9 +0,0 @@ -package file - -// AdVideoListResponse 查询视频接口list接口 API Response -type AdVideoListResponse struct { - // TotalCount 图片总数 - TotalCount int `json:"total_count,omitempty"` - // Details 详情 - Details []Video `json:"details,omitempty"` -} diff --git a/model/file/ad_video_relate_creatives_response.go b/model/file/ad_video_relate_creatives.go similarity index 52% rename from model/file/ad_video_relate_creatives_response.go rename to model/file/ad_video_relate_creatives.go index 18d2628..450c891 100644 --- a/model/file/ad_video_relate_creatives_response.go +++ b/model/file/ad_video_relate_creatives.go @@ -1,5 +1,26 @@ package file +import "encoding/json" + +// AdVideoRelateCreativesRequest 视频关联创意数查询 +type AdVideoRelateCreativesRequest struct { + // AdvertiserID 广告主ID + AdvertiserID uint64 `json:"advertiser_id,omitempty"` + // PhotoIDs 视频id; 最大20个,可以动态配置 + PhotoIds []string `json:"photo_ids,omitempty"` +} + +// Url implement PostRequest interface +func (r AdVideoRelateCreativesRequest) Url() string { + return "v1/file/ad/video/relate/creatives" +} + +// Encode implement PostRequest interface3 +func (r AdVideoRelateCreativesRequest) Encode() []byte { + ret, _ := json.Marshal(r) + return ret +} + // AdVideoRelateCreativesResponse 视频关联创意数查询 API Response type AdVideoRelateCreativesResponse struct { // RelatedCreatives 与视频相关联的创意的信息; 关联创意数=审核中+投放中的创意,仅包含自定义创意,程序化创意数量暂未计入 @@ -14,6 +35,10 @@ type AdVideoRelatedCreatives struct { Creatives []AdVideoRelatedCreative `json:"creatives,omitempty"` // CreativeCount 与此视频id关联的创意总数 CreativeCount int64 `json:"creative_count,omitempty"` + // AdvancedCreativeIDs 与此视频 id 关联的程序化创意ID + AdvancedCreativeIDs []uint64 `json:"advanced_creative_ids,omitempty"` + // AdvancedCreativeCount 与此视频 id 关联的程序化创意数量 + AdvancedCreativeCount int64 `json:"advanced_creative_count,omitempty"` } // AdVideoRelatedCreative diff --git a/model/file/ad_video_relate_creatives_request.go b/model/file/ad_video_relate_creatives_request.go deleted file mode 100644 index a169548..0000000 --- a/model/file/ad_video_relate_creatives_request.go +++ /dev/null @@ -1,22 +0,0 @@ -package file - -import "encoding/json" - -// AdVideoRelateCreativesRequest 视频关联创意数查询 -type AdVideoRelateCreativesRequest struct { - // AdvertiserID 广告主ID - AdvertiserID uint64 `json:"advertiser_id,omitempty"` - // PhotoIDs 视频id; 最大20个,可以动态配置 - PhotoIds []string `json:"photo_ids,omitempty"` -} - -// Url implement PostRequest interface -func (r AdVideoRelateCreativesRequest) Url() string { - return "v1/file/ad/video/relate/creatives" -} - -// Encode implement PostRequest interface3 -func (r AdVideoRelateCreativesRequest) Encode() []byte { - ret, _ := json.Marshal(r) - return ret -} diff --git a/model/file/ad_video_share_request.go b/model/file/ad_video_share.go similarity index 56% rename from model/file/ad_video_share_request.go rename to model/file/ad_video_share.go index 34e508c..777d94c 100644 --- a/model/file/ad_video_share_request.go +++ b/model/file/ad_video_share.go @@ -1,6 +1,8 @@ package file -import "encoding/json" +import ( + "github.com/bububa/kwai-marketing-api/model" +) // AdVideoShareRequest 视频库-推送视频 API Request type AdVideoShareRequest struct { @@ -19,6 +21,21 @@ func (r AdVideoShareRequest) Url() string { // Encode implement PostRequest interface func (r AdVideoShareRequest) Encode() []byte { - ret, _ := json.Marshal(r) - return ret + return model.JSONMarshal(r) +} + +// AdVideoShareResponse 视频库-推送视频 API Response +type AdVideoShareResponse struct { + // Details Response details + Details []AdVideoShareDetail `json:"details,omitempty"` +} + +// AdVideoShareDetail 视频库-推送视频 API Response Detail +type AdVideoShareDetail struct { + // AdvertiserID 账号ID + AdvertiserID uint64 `json:"advertiser_id,omitempty"` + // PhotoID 分享生成新的photoId + PhotoID string `json:"photo_id,omitempty"` + // OriginalPhotoID 原始photoId + OriginalPhotoID string `json:"original_photo_id,omitempty"` } diff --git a/model/file/ad_video_share_new.go b/model/file/ad_video_share_new.go new file mode 100644 index 0000000..11a9c99 --- /dev/null +++ b/model/file/ad_video_share_new.go @@ -0,0 +1,55 @@ +package file + +import ( + "github.com/bububa/kwai-marketing-api/model" +) + +// AdVideoShareNewRequest 视频库-推送视频(新版) API Request +type AdVideoShareNewRequest struct { + // AdvertiserID 广告主 id + AdvertiserID uint64 `json:"advertiser_id,omitempty"` + // PhotoIDs 视频 ids,不超过 10 个 + PhotoIDs []string `json:"photo_ids,omitempty"` + // AccountIDs 目标推送账户 + AccountIDs []uint64 `json:"account_ids,omitempty"` + // ShareAccountType 分享账户类型:-1:暂未支持的账户类型;1. 同主体同代理商账户;2. 同主体下账户(需加白使用);3. 内部账户;4. 同代理商下账户 + ShareAccountType int `json:"share_account_type,omitempty"` +} + +// Url implement PostRequest interface +func (r AdVideoShareNewRequest) Url() string { + return "gw/dsp/v1/file/ad/video/share/new" +} + +// Encode implement PostRequest interface +func (r AdVideoShareNewRequest) Encode() []byte { + return model.JSONMarshal(r) +} + +// AdVideoShareNewResponse 视频库-推送视频(新版) API Response +type AdVideoShareNewResponse struct { + // ShareStatus 视频推送状态:-1=全部失败,0=表示部分失败,1=全部成功 + ShareStatus int `json:"share_status,omitempty"` + // SharePhotoExists 被推送视频是否已存在于被推送账户的视频库中,true = 已存在;false = 不存在 + SharePhotoExists bool `json:"share_photo_exists,omitempty"` + // NotSupportedInternalPhoto 被推送账户是否是内部账户,true = 是,发;false = 不是 + NotSupportedInternalPhoto bool `json:"not_supported_internal_photo,omitempty"` + // MismatchedAccountList 在“同主体同代理商”的基础上,本次新增“同主体账户”,“内部账户”等两种可推送账户类型,如果被推送账户不满足条件,将于此列表返回 + MismatchedAccountList []uint64 `json:"mismatched_account_list,omitempty"` + // NeedToTryList 因各种原因导致推送失败,需要重试的推送记录 + NeedToTryList []PhotoShareResult `json:"need_to_try_list,omitempty"` + // ShareSuccessList 视频推送成功结果网关参数 + ShareSuccessList []PhotoShareResult `json:"share_success_list,omitempty"` +} + +// PhotoShareResult +type PhotoShareResult struct { + // AccountID 账号ID + AccountID uint64 `json:"account_id,omitempty"` + // PhotoID 分享生成新的photoId + PhotoID string `json:"photo_id,omitempty"` + // OriginalPhotoID 被推送视频ID + OriginalPhotoID string `json:"original_photo_id,omitempty"` + // ShareResult 推送结果 + ShareResult string `json:"share_result,omitempty"` +} diff --git a/model/file/ad_video_share_response.go b/model/file/ad_video_share_response.go deleted file mode 100644 index d0af950..0000000 --- a/model/file/ad_video_share_response.go +++ /dev/null @@ -1,17 +0,0 @@ -package file - -// AdVideoShareResponse 视频库-推送视频 API Response -type AdVideoShareResponse struct { - // Details Response details - Details []AdVideoShareDetail `json:"details,omitempty"` -} - -// AdVideoShareDetail 视频库-推送视频 API Response Detail -type AdVideoShareDetail struct { - // AdvertiserID 账号ID - AdvertiserID uint64 `json:"advertiser_id,omitempty"` - // PhotoID 分享生成新的photoId - PhotoID string `json:"photo_id,omitempty"` - // OriginalPhotoID 原始photoId - OriginalPhotoID string `json:"original_photo_id,omitempty"` -} diff --git a/model/file/ad_video_tag_delete_request.go b/model/file/ad_video_tag_delete.go similarity index 78% rename from model/file/ad_video_tag_delete_request.go rename to model/file/ad_video_tag_delete.go index 235d938..21d9682 100644 --- a/model/file/ad_video_tag_delete_request.go +++ b/model/file/ad_video_tag_delete.go @@ -1,13 +1,13 @@ package file -import "encoding/json" +import ( + "github.com/bububa/kwai-marketing-api/model" +) // AdVideoTagDeleteRequest 视频库-删除视频标签 API Request type AdVideoTagDeleteRequest struct { // AdvertiserID 广告主 id AdvertiserID uint64 `json:"advertiser_id,omitempty"` - // PhotoIDs 视频 ids,不超过 10 个 - PhotoIDs []string `json:"photo_ids,omitempty"` // PhotoTag 视频标签 单个标签长度不能超过 10,只支持一个标签 PhotoTag []string `json:"photo_tag,omitempty"` } @@ -19,6 +19,5 @@ func (r AdVideoTagDeleteRequest) Url() string { // Encode implement PostRequest interface func (r AdVideoTagDeleteRequest) Encode() []byte { - ret, _ := json.Marshal(r) - return ret + return model.JSONMarshal(r) } diff --git a/model/file/ad_video_update_request.go b/model/file/ad_video_update.go similarity index 82% rename from model/file/ad_video_update_request.go rename to model/file/ad_video_update.go index c9dc2b0..980f000 100644 --- a/model/file/ad_video_update_request.go +++ b/model/file/ad_video_update.go @@ -24,3 +24,9 @@ func (r AdVideoUpdateRequest) Encode() []byte { ret, _ := json.Marshal(r) return ret } + +// AdVideoUpdateResponse 视频库-批量更新视频功能 API Response +type AdVideoUpdateResponse struct { + // PhotoIDs 视频 ids + PhotoIDs []string `json:"photo_ids,omitempty"` +} diff --git a/model/file/ad_video_upload_request_v1.go b/model/file/ad_video_upload_v1.go similarity index 75% rename from model/file/ad_video_upload_request_v1.go rename to model/file/ad_video_upload_v1.go index 23ad264..f16886d 100644 --- a/model/file/ad_video_upload_request_v1.go +++ b/model/file/ad_video_upload_v1.go @@ -16,6 +16,9 @@ type AdVideoUploadRequestV1 struct { Type int `json:"type"` // ShieldBackwardSwitch 上传视频后是否自动同步至快手个人主页; false表示后端屏蔽,视频不可profile页可见, true表示不屏蔽。 ShieldBackwardSwitch bool `json:"shield_backward_switch,omitempty"` + // NativePicSwitch 原生投放时视频挂载plc组件(建议设置为true,有机会获得更多流量曝光) + // false 表示不挂载plc true表示挂载,非白名单用户必须挂载plc,设置为true,平台将把根据推广目标生成的PLC组件挂载至该次本地上传的视频上。 + NativePicSwitch bool `json:"native_pic_switch,omitempty"` } // Url implement UploadRequest interface @@ -33,6 +36,10 @@ func (r AdVideoUploadRequestV1) Encode() []model.UploadField { if r.ShieldBackwardSwitch { shieldBackwardSwitch = "true" } + nativePicSwitch := "false" + if r.NativePicSwitch { + nativePicSwitch = "true" + } return []model.UploadField{ { Key: "advertiser_id", @@ -46,6 +53,10 @@ func (r AdVideoUploadRequestV1) Encode() []model.UploadField { Key: "shield_backward_switch", Value: shieldBackwardSwitch, }, + { + Key: "native_pic_switch", + Value: nativePicSwitch, + }, { Key: "file", Value: fileName, diff --git a/model/file/ad_video_upload_request_v2.go b/model/file/ad_video_upload_v2.go similarity index 83% rename from model/file/ad_video_upload_request_v2.go rename to model/file/ad_video_upload_v2.go index 51d6463..4cbac41 100644 --- a/model/file/ad_video_upload_request_v2.go +++ b/model/file/ad_video_upload_v2.go @@ -24,6 +24,9 @@ type AdVideoUploadRequestV2 struct { Sync int `json:"sync,omitempty"` // ShieldBackwardSwitch 上传视频后是否自动同步至快手个人主页; false表示后端屏蔽,视频不可profile页可见, true表示不屏蔽。 ShieldBackwardSwitch bool `json:"shield_backward_switch,omitempty"` + // NativePicSwitch 原生投放时视频挂载plc组件(建议设置为true,有机会获得更多流量曝光) + // false 表示不挂载plc true表示挂载,非白名单用户必须挂载plc,设置为true,平台将把根据推广目标生成的PLC组件挂载至该次本地上传的视频上。 + NativePicSwitch bool `json:"native_pic_switch,omitempty"` } // Url implement UploadRequest interface @@ -41,6 +44,10 @@ func (r AdVideoUploadRequestV2) Encode() []model.UploadField { if r.ShieldBackwardSwitch { shieldBackwardSwitch = "true" } + nativePicSwitch := "false" + if r.NativePicSwitch { + nativePicSwitch = "true" + } fields := []model.UploadField{ { Key: "advertiser_id", @@ -58,6 +65,10 @@ func (r AdVideoUploadRequestV2) Encode() []model.UploadField { Key: "shield_backward_switch", Value: shieldBackwardSwitch, }, + { + Key: "native_pic_switch", + Value: nativePicSwitch, + }, { Key: "signature", Value: r.Signature, diff --git a/model/file/image.go b/model/file/image.go index 4fc9734..6eea682 100644 --- a/model/file/image.go +++ b/model/file/image.go @@ -16,6 +16,9 @@ type Image struct { Signature string `json:"signature,omitempty"` // ImageToken 图片token 创建创意时使用 ImageToken string `json:"image_token,omitempty"` - // PicId 图片库图片ID - PicId string `json:"pic_id,omitempty"` + // PicType 图片类型 + // 0-默认,5-竖版,6-横版,12-开屏,16-图集 + PicType int `json:"pic_type,omitempty"` + // PicID 图片库图片ID + PicID string `json:"pic_id,omitempty"` } diff --git a/model/file/pic_share.go b/model/file/pic_share.go new file mode 100644 index 0000000..c71f141 --- /dev/null +++ b/model/file/pic_share.go @@ -0,0 +1,45 @@ +package file + +import "github.com/bububa/kwai-marketing-api/model" + +// PicShareRequest 图片库推送 API Request +type PicShareRequest struct { + // AdvertiserID 广告主id + AdvertiserID uint64 `json:"advertiser_id,omitempty"` + // PicIDs 分享图片的ids + // 分享图片的ids和tokens只能二选一 + PicIDs []string `json:"pic_ids,omitempty"` + // ImageTokens 分享图片的tokens + ImageTokens []string `json:"image_tokens,omitempty"` + // ShareAdvertiserIDs 推送账户 + ShareAdvertiserIDs []uint64 `json:"share_advertiser_ids,omitempty"` + // ShareAccountType 分享账户类型 + // 1:同主体同代理商账户;2:同主体下账户(需加白使用); 3:内部代理商账户(需要加白使用) + ShareAccountType int `json:"share_account_type,omitempty"` +} + +// Url implement PostRequest interface +func (r PicShareRequest) Url() string { + return "gw/dsp/v1/pic/share" +} + +// Encode implement PostRequest interface +func (r PicShareRequest) Encode() []byte { + return model.JSONMarshal(r) +} + +// PicShareResponse 图片库推送 API Response +type PicShareResponse struct { + // Details 详细信息 + Details []PicShareResult `json:"details,omitempty"` +} + +// PicShareResult +type PicShareResult struct { + // AdvertiserID 广告主id + AdvertiserID uint64 `json:"advertiser_id,omitempty"` + // ImageToken 图片 token + ImageToken string `json:"image_token,omitempty"` + // PicID 图片id + PicID string `json:"pic_id,omitempty"` +} diff --git a/model/file/upload_atlas_photo.go b/model/file/upload_atlas_photo.go new file mode 100644 index 0000000..2924239 --- /dev/null +++ b/model/file/upload_atlas_photo.go @@ -0,0 +1,33 @@ +package file + +import "github.com/bububa/kwai-marketing-api/model" + +// UploadAtlasPhotoRequest 上传图文视频 API Request +type UploadAtlasPhotoRequest struct { + // AdvertiserID 广告主ID + AdvertiserID uint64 `json:"advertiser_id,omitempty"` + // 图片ID + PicIDs []string `json:"pic_ids,omitempty"` + // AudioBsKey 音频bs_key + AudioBsKey string `json:"audio_bs_key,omitempty"` + // ShieldBackwordSwitch 上传视频后是否自动同步至快手个人主页, 默认false + ShieldBackwordSwitch bool `json:"shield_backword_switch,omitempty"` + // WaitForTranscode 用同步/异步方式上传视频,默认false + WaitForTranscode bool `json:"wait_for_transcode,omitempty"` +} + +// Url implement PostRequest interface +func (r UploadAtlasPhotoRequest) Url() string { + return "gw/dsp/upload/atlasPhoto" +} + +// Encode implement PostRequest interface +func (r UploadAtlasPhotoRequest) Encode() []byte { + return model.JSONMarshal(r) +} + +// UploadAtlasPhotoResponse 上传图文视频 API Response +type UploadAtlasPhotoResponse struct { + // PhotoID 图文视频ID + PhotoID string `json:"photo_id,omitempty"` +} diff --git a/model/file/video.go b/model/file/video.go index 45f27ef..9a7cc00 100644 --- a/model/file/video.go +++ b/model/file/video.go @@ -19,16 +19,39 @@ type Video struct { // PhotoName 视频名称 PhotoName string `json:"photo_name,omitempty"` // PhotoTag 视频标签 - PhotoTag string `json:"photo_tag,omitempty"` + PhotoTag []string `json:"photo_tag,omitempty"` // NewStatus 视频状态; 0:逻辑删除,1:正常 NewStatus int `json:"new_status,omitempty"` // Duration 视频时长; 单位毫秒 Duration int64 `json:"duration,omitempty"` // Source 视频来源; 0:自上传,1:开眼,2:素造,7:聚星视频 - Source int `json:"source,omitempty"` - AdPhotoValuateInfo AdPhotoValuateInfoItem `json:"adPhotoValuateInfo"` + Source int `json:"source,omitempty"` + // PhotoValuateInfo 视频素材评价信息 + PhotoValuateInfo *PhotoValuateInfo `json:"photo_valuate_info,omitempty"` + // PhotoTagIdentifyItems 视频标签内容 + PhotoTagIdentifyItems []any `json:"photo_tag_identify_items,omitempty"` + // OuterLoopNative 是否是原生视频 + OuterLoopNative int `json:"outer_loop_native,omitempty"` + // PhotoUserID 视频所属的userId + PhotoUserID uint64 `json:"photo_user_id,omitempty"` + // AtlasPicIDs 图集关联的图片ID + AtlasPicIDs []string `json:"atlas_pic_ids,omitempty"` + // AtlasAudioBsKey 图集关联音频的bs_key + AtlasAudioBsKey string `json:"atlas_audio_bs_key,omitempty"` + // AtlasAudioURL 图集音频播放链接 + AtlasAudioURL string `json:"atlas_audio_url,omitempty"` + // ShieldStatus 视频是否已同步个人主页 1否 0是 + ShieldStatus int `json:"shield_status,omitempty"` + // PhotoDupStatus 素材创新度 + // 0-不重复,1-重复 + PhotoDupStatus int `json:"photo_dup_status,omitempty"` + // NativeGoodInfo 素材质量 + // 0-默认,1-良好,2-优质,3-非原生 + NativeGoodInfo int `json:"native_good_info,omitempty"` } -type AdPhotoValuateInfoItem struct { + +// PhotoValuateInfo 视频素材评价信息 +type PhotoValuateInfo struct { SimLabel string `json:"simLabel"` QualityLabel string `json:"qualityLabel"` QuotaMsg string `json:"quotaMsg"`