-
Notifications
You must be signed in to change notification settings - Fork 22
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
13 changed files
with
116 additions
and
0 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,2 @@ | ||
// Package jingbell 直播推广相关 | ||
package jingbell |
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,19 @@ | ||
package jingbell | ||
|
||
import ( | ||
"github.com/bububa/kwai-marketing-api/core" | ||
"github.com/bububa/kwai-marketing-api/model" | ||
"github.com/bububa/kwai-marketing-api/model/dsp/jingbell" | ||
) | ||
|
||
// Share 小铃铛推送 | ||
func Share(clt *core.SDKClient, accessToken string, req *jingbell.ShareRequest) error { | ||
var resp jingbell.ShareResponse | ||
if err := clt.Post(accessToken, req, &resp); err != nil { | ||
return err | ||
} | ||
if resp.Result != 1 { | ||
return model.BaseResponse{Code: resp.Result, Message: resp.Data} | ||
} | ||
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,2 @@ | ||
// Package native 原生广告投放工具 | ||
package native |
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,12 @@ | ||
package native | ||
|
||
import ( | ||
"github.com/bububa/kwai-marketing-api/core" | ||
"github.com/bububa/kwai-marketing-api/model/dsp/native" | ||
) | ||
|
||
// OpenAccountNative 开启原生扩量开关接口 | ||
func OpenAccountNative(clt *core.SDKClient, accessToken string, req *native.OpenAccountNativeRequest) error { | ||
var resp native.OpenAccountNativeResponse | ||
return clt.Post(accessToken, req, &resp) | ||
} |
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 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,2 @@ | ||
// Package jingbell 直播推广相关 | ||
package jingbell |
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,33 @@ | ||
package jingbell | ||
|
||
import "github.com/bububa/kwai-marketing-api/model" | ||
|
||
// ShareRequest 小铃铛推送 API Request | ||
type ShareRequest struct { | ||
// AdvertiserID 广告主userId | ||
AdvertiserID uint64 `json:"advertiser_id,omitempty"` | ||
// LiveUserID 主播ID | ||
LiveUserID string `json:"live_user_id,omitempty"` | ||
// JingBellUserID 小铃铛ID | ||
JingBellUserID string `json:"jing_bell_user_id,omitempty"` | ||
// TargetAccountIDs 推送目标 accountIds | ||
TargetAccountIDs []string `json:"target_account_ids,omitempty"` | ||
} | ||
|
||
// Url implement PostRequest interface | ||
func (r ShareRequest) Url() string { | ||
return "gw/dsp/jingBell/share" | ||
} | ||
|
||
// Encode implement PostRequest interface | ||
func (r ShareRequest) Encode() []byte { | ||
return model.JSONMarshal(r) | ||
} | ||
|
||
// ShareResponse 小铃铛推送 API Response | ||
type ShareResponse struct { | ||
// Result 1成功 非1失败 | ||
Result int `json:"result,omitempty"` | ||
// Data 如果失败,则是失败信息 | ||
Data string `json:"data,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 native 原生广告投放工具 | ||
package native |
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,28 @@ | ||
package native | ||
|
||
import "github.com/bububa/kwai-marketing-api/model" | ||
|
||
// OpenAccountNativeRequest 开启原生扩量开关 API Request | ||
type OpenAccountNativeRequest struct { | ||
// AdvertiserID 广告主 ID | ||
AdvertiserID uint64 `json:"advertiser_id,omitempty"` | ||
// OpenAccountNative 开启/关闭原生扩量开关 | ||
// 1开启 0关闭 | ||
OpenAccountNative int `json:"open_account_native"` | ||
} | ||
|
||
// Url implement PostRequest interface | ||
func (r OpenAccountNativeRequest) Url() string { | ||
return "gw/dsp/native/openAccountNative" | ||
} | ||
|
||
// Encode implement PostRequest interface | ||
func (r OpenAccountNativeRequest) Encode() []byte { | ||
return model.JSONMarshal(r) | ||
} | ||
|
||
// OpenAccountNativeResponse 开启原生扩量开关 API Response | ||
type OpenAccountNativeResponse struct { | ||
// OpenAccountNative 操作结果 true:成功 false:失败 | ||
OpenAccountNative bool `json:"open_account_native,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