-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
374 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"` | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.