-
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
10 changed files
with
130 additions
and
10 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
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,18 @@ | ||
package page | ||
|
||
import ( | ||
"github.com/bububa/kwai-marketing-api/core" | ||
"github.com/bububa/kwai-marketing-api/model/page" | ||
) | ||
|
||
// BatchGive 批量转赠 | ||
func BatchGive(clt *core.SDKClient, accessToken string, req *page.BatchGiveRequest) error { | ||
var resp page.BatchGiveResponse | ||
if err := clt.Post(accessToken, req, &resp); err != nil { | ||
return err | ||
} | ||
if resp.IsError() { | ||
return resp | ||
} | ||
return 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 page | ||
|
||
import ( | ||
"github.com/bububa/kwai-marketing-api/core" | ||
"github.com/bububa/kwai-marketing-api/model/page" | ||
) | ||
|
||
// CidInfoUpdate 魔力建站落地页更新CID信息 | ||
func CidInfoUpdate(clt *core.SDKClient, accessToken string, req *page.CidInfoUpdateRequest) (uint64, error) { | ||
var resp page.CidInfoUpdateResponse | ||
if err := clt.Post(accessToken, req, &resp); err != nil { | ||
return 0, err | ||
} | ||
return resp.PageID.Value(), 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,2 @@ | ||
// package Page 魔力建站落地页相关 API | ||
package page |
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,42 @@ | ||
package page | ||
|
||
import "encoding/json" | ||
|
||
// BatchGiveRequest 批量转赠 API Request | ||
type BatchGiveRequest struct { | ||
// AdvertiserID 广告主ID | ||
AdvertiserID uint64 `json:"advertiser_id,omitempty"` | ||
// GiveAccountIDs 赠予的目标账户列表 | ||
GiveAccountIDs []uint64 `json:"give_account_ids,omitempty"` | ||
// PageIDs 赠予的页面list | ||
PageIDs []uint64 `json:"page_ids,omitempty"` | ||
} | ||
|
||
// Url implement PostRequest interface | ||
func (r BatchGiveRequest) Url() string { | ||
return "gw/magicsite/v1/page/batchGive" | ||
} | ||
|
||
// Encode implement PostRequest interface | ||
func (r BatchGiveRequest) Encode() []byte { | ||
ret, _ := json.Marshal(r) | ||
return ret | ||
} | ||
|
||
// BatchGiveResponse 批量转赠 API Response | ||
type BatchGiveResponse struct { | ||
// Code 1-成功 | ||
Code int `json:"code,omitempty"` | ||
// ErrorMsg 错误信息 | ||
ErrorMsg string `json:"error_msg,omitempty"` | ||
} | ||
|
||
// IsError returns true if response is an error | ||
func (r BatchGiveResponse) IsError() bool { | ||
return r.Code != 1 | ||
} | ||
|
||
// Error implements errors.Error interface | ||
func (r BatchGiveResponse) Error() string { | ||
return r.ErrorMsg | ||
} |
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,38 @@ | ||
package page | ||
|
||
import ( | ||
"encoding/json" | ||
|
||
"github.com/bububa/kwai-marketing-api/model" | ||
) | ||
|
||
// CidInfoUpdateRequest 魔力建站落地页更新CID信息 API Request | ||
type CidInfoUpdateRequest struct { | ||
// AdvertiserID 广告主ID | ||
AdvertiserID uint64 `json:"advertiser_id,omitempty"` | ||
// PageID 查询落地页列表接口获取 | ||
PageID string `json:"page_id,omitempty"` | ||
// PlatFormType 更新链接的电商平台类型:PDD:拼多多, WECHAT_MALL:微信商城,TAO_BAO:淘宝,tmall:天猫,JD:京东 | ||
PlatFormType string `json:"plat_form_type,omitempty"` | ||
// DeeplinkURL 更新落地页中按钮组件 — 跳转应用 — 跳转链接如:taobao://huodong.m.taobao.com/act/snipcode.htm | ||
DeeplinkURL string `json:"deeplink_url,omitempty"` | ||
// FallbackH5URL 更新落地页中按钮组件 — 跳转应用 — H5链接如:https://www.taobao.com | ||
FallbackH5URL string `json:"fallback_h5_url,omitempty"` | ||
} | ||
|
||
// Url implement PostRequest interface | ||
func (r CidInfoUpdateRequest) Url() string { | ||
return "gw/magicsite/v1/page/cid/info/update" | ||
} | ||
|
||
// Encode implement PostRequest interface | ||
func (r CidInfoUpdateRequest) Encode() []byte { | ||
ret, _ := json.Marshal(r) | ||
return ret | ||
} | ||
|
||
// CidInfoUpdateResponse 魔力建站落地页更新CID信息 API Response | ||
type CidInfoUpdateResponse struct { | ||
// PageID 更新成功的落地页ID | ||
PageID model.Uint64 `json:"page_id,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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// package Page 魔力建站落地页相关 API Model | ||
package page |
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