Skip to content

Commit

Permalink
Merge branch 'release/v1.7.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
bububa committed Apr 11, 2024
2 parents 074d9e5 + 3117dd3 commit 2838414
Show file tree
Hide file tree
Showing 13 changed files with 116 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@
- 查询定向模板接口 [ target.TemplateList(clt *core.SDKClient, accessToken string, req *target.TemplateListRequest) (*target.TemplateListResponse, error) ]
- 修改定向模板 [ target.TemplateUpdate(clt *core.SDKClient, accessToken string, req *target.TemplateUpdateRequest) (*target.Template, error) ]
- 删除定向模板 [ target.TemplateDelete(clt *core.SDKClient, accessToken string, req *target.TemplateDeleteRequest) error ]
- 直播推广 (api/dsp/jingbell)
- 小铃铛推送 [ jingbel.Share(clt *core.SDKClient, accessToken string, req *jingbell.ShareRequest) error ]
- 原生广告投放工具 (api/dsp/native)
- 开启原生扩量开关接口 [ OpenAccountNative(clt *core.SDKClient, accessToken string, req *native.OpenAccountNativeRequest) error ]
- DMP人群管理(api/dmp)
- 人群包上传接口 [ PopulationUpload(clt *core.SDKClient, accessToken string, req *dmp.PopulationUploadRequest) (*dmp.Population, error) ]
- 人群包更新接口 [ PopulationUpdate(clt *core.SDKClient, accessToken string, req *dmp.PopulationUpdateRequest) (*dmp.Population, error) ]
Expand Down
2 changes: 2 additions & 0 deletions api/dsp/jingbell/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package jingbell 直播推广相关
package jingbell
19 changes: 19 additions & 0 deletions api/dsp/jingbell/share.go
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
}
2 changes: 2 additions & 0 deletions api/dsp/native/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package native 原生广告投放工具
package native
12 changes: 12 additions & 0 deletions api/dsp/native/open_account_native.go
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)
}
3 changes: 3 additions & 0 deletions api/track/click.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ var DEFAULT_CLICK_FIELDS = []string{
"idfa",
"android_id",
"oaid",
"caid",
"os",
"ip",
"ua",
Expand Down Expand Up @@ -54,6 +55,8 @@ func Click(baseUrl string, fields []string) string {
values.Set("android_id", "__ANDROIDID2__")
case "oaid":
values.Set("oaid", "__OAID2__")
case "caid":
values.Set("caid", "__KENYID_CAA__")
case "os":
values.Set("os", "OS")
case "ip":
Expand Down
3 changes: 3 additions & 0 deletions model/dsp/creative/advanced_creative.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,7 @@ type AdvancedCreative struct {
// Recommendation plc自定义文案
// 开启原生时可用
Recommendation string `json:"recommendation,omitempty"`
// OpenAccountNative 是否为原生扩量
// 0:否 1:是
OpenAccountNative int `json:"open_account_native,omitempty"`
}
3 changes: 3 additions & 0 deletions model/dsp/creative/creative.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ type Creative struct {
// CreativeMode 创意生成模式
// 0:默认-普通模式 1:AIGC生成
CreativeMode int `json:"creative_mode,omitempty"`
// OpenAccountNative 是否为原生扩量
// 0:否 1:是
OpenAccountNative int `json:"open_account_native,omitempty"`
}

// DisplayInfo 广告展示信息
Expand Down
2 changes: 2 additions & 0 deletions model/dsp/jingbell/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package jingbell 直播推广相关
package jingbell
33 changes: 33 additions & 0 deletions model/dsp/jingbell/share.go
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"`
}
2 changes: 2 additions & 0 deletions model/dsp/native/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package native 原生广告投放工具
package native
28 changes: 28 additions & 0 deletions model/dsp/native/open_account_native.go
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"`
}
3 changes: 3 additions & 0 deletions model/dsp/unit/unit.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ type Unit struct {
// ULink Universal Link 链接
// 仅在计划 campaignType=7 提升应用活跃时使用,输入后IOS将优先调起该链接,不超过2000字符
ULink string `json:"u_link,omitempty"`
// UnitMaterialType 广告标的物类型
// campaignType = 19(快手小程序/小游戏推广)时(释义同mini_app_type字段)表示:1:快手小程序;2:快手小游戏;campaignType = 32(微信小程序/小游戏推广)时表示:3:微信小程序;4:微信小游戏
UnitMaterialType int `json:"unit_material_type,omitempty"`
}

// DpaUnitParam DPA 相关商品信息
Expand Down

0 comments on commit 2838414

Please sign in to comment.