Skip to content

Commit

Permalink
Merge branch 'release/v1.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
bububa committed Jan 30, 2024
2 parents c3f474c + f95f871 commit a507b14
Show file tree
Hide file tree
Showing 72 changed files with 2,678 additions and 52 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,33 @@
- 获取广告主信息 [ Info(clt *core.SDKClient, accessToken string, advertiserID int64) (*advertiser.Info, error) ]
- 获取广告账户余额信息 [ FundGet(clt *core.SDKClient, accessToken string, advertiserID int64) (float64, error) ]
- 获取广告主账户流水信息 [ FundDailyFlows(clt *core.SDK, accessToken string, req *advertiser.FundDailyFlowsRequest) (*advertiser.FundDailyFlowsResponse, error) ]
- 账户罗盘(api/adcompass)
- 获取罗盘绑定广告主列 [ Advertisers(clt *core.SDKClient, accessToken string, advertiserID uint64) ([]adcompass.Advertiser, error) ]
- 磁力罗盘对外 quota 腾挪接口 [ QuotaTending(clt *core.SDKClient, accessToken string, req *adcompass.QuotaTendingRequest) (string, error) ]
- 广告投放
- 智能创编 (api/dsp)
- 广告计划 (api/dsp/campaign)
- 创建广告计划 [ Create(clt *core.SDKClient, accessToken string, req *campaign.CreateRequest) (uint64, error) ]
- 修改广告计划 [ Update(clt *core.SDKClient, accessToken string, req *campaign.UpdateRequest) (uint64, error) ]
- 获取广告计划信息 [ List(clt *core.SDKClient, accessToken string, req *campaign.ListRequest) (*campaign.ListResponse, error) ]
- 修改广告计划状态 [ UpdateStatus(clt *core.SDKClient, accessToken string, req *campaign.UpdateStatusRequest) ([]uint64, error) ]
- 广告组 (api/dsp/unit)
- 创建广告组 [ Create(clt *core.SDKClient, accessToken string, req *unit.CreateRequest) (uint64, error) ]
- 修改广告组 [ Update(clt *core.SDKClient, accessToken string, req *unit.UpdateRequest) (uint64, error) ]
- 查询广告组 [ List(clt *core.SDKClient, accessToken string, req *unit.ListRequest) (*unit.ListResponse, error) ]
- 修改广告组预算 [ UpdateDayBudget(clt *core.SDKClient, accessToken string, req *unit.UpdateDayBudgetRequest) error ]
- 修改广告组状态 [ UpdateStatus(clt *core.SDKClient, accessToken string, req *unit.UpdateStatusRequest) ([]int64, error) ]
- 修改广告组出价 [ UpdateBid(clt *core.SDKClient, accessToken string, req *unit.UpdateBidRequest) error ]
- 广告创意 (api/dsp/creative)
- 创建自定义创意 [ Create(clt *core.SDKClient, accessToken string, req *creative.CreateRequest) (uint64, error) ]
- 创建程序化创意 [ AdvancedCreativeCreate(clt *core.SDKClient, accessToken string, req *creative.AdvancedCreativeCreateRequest) (uint64, error) ]
- 修改自定义创意 [ Update(clt *core.SDKClient, accessToken string, req *creative.UpdateRequest) (uint64, error) ]
- 修改程序化创意 [ AdvancedCreativeUpdate(clt *core.SDKClient, accessToken string, req *creative.AdvancedCreativeUpdateRequest) (uint64, error) ]
- 批量修改自定义创意 [ BatchUpdate(clt *core.SDKClient, accessToken string, req *creative.BatchUpdateRequest) (*creative.BatchUpdateResponse, error) ]
- 查询自定义创意 [ List(clt *core.SDKClient, accessToken string, req *creative.ListRequest) (*creative.ListResponse, error) ]
- 查询程序化创意 [ AdvancedCreativeList(clt *core.SDKClient, accessToken string, req *creative.AdvancedCreativeListRequest) (*creative.AdvancedCreativeListResponse, error) ]
- 修改创意状态 [ UpdateStatus(clt *core.SDKClient, accessToken string, req *creative.UpdateStatusRequest) ([]uint64, error) ]
- 创意体验 [ Preview(clt *core.SDKClient, accessToken string, req *creative.PreviewRequest) error ]
- 获取各层级信息
- 获取广告计划信息 [ campaign.List(clt *core.SDKClient, accessToken string, req *campaign.ListRequest) (*campaign.ListResponse, error) ]
- 获取广告组信息 [ unit.List(clt *core.SDKClient, accessToken string, req *unit.ListRequest) (*unit.ListResponse, error) ]
Expand Down Expand Up @@ -128,3 +154,8 @@
- 数据上报管理 (api/track)
- 转化回传 [ Activate(req *track.ActivateRequest) error ]
- 点击检测链接 [ Click(baseUrl string, fields []string) string ]


# Reference
[API文档](https://developers.e.kuaishou.com/docs)

19 changes: 19 additions & 0 deletions api/adcompass/advertisers.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package adcompass

import (
"github.com/bububa/kwai-marketing-api/core"
"github.com/bububa/kwai-marketing-api/model/adcompass"
)

// Advertisers 获取罗盘绑定广告主列
func Advertisers(clt *core.SDKClient, accessToken string, advertiserID uint64) ([]adcompass.Advertiser, error) {
req := &adcompass.AdvertisersRequest{
AdvertiserID: advertiserID,
}
var resp adcompass.AdvertisersResponse
err := clt.Post(accessToken, req, &resp)
if err != nil {
return nil, err
}
return resp.Details, nil
}
2 changes: 2 additions & 0 deletions api/adcompass/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package adcompass 账户罗盘
package adcompass
15 changes: 15 additions & 0 deletions api/adcompass/quota_tending.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package adcompass

import (
"github.com/bububa/kwai-marketing-api/core"
"github.com/bububa/kwai-marketing-api/model/adcompass"
)

// QuotaTending 磁力罗盘对外 quota 腾挪接口
func QuotaTending(clt *core.SDKClient, accessToken string, req *adcompass.QuotaTendingRequest) (string, error) {
var resp adcompass.QuotaTendingResponse
if err := clt.Post(accessToken, req, &resp); err != nil {
return "", err
}
return resp.Describe, nil
}
19 changes: 0 additions & 19 deletions api/advertiser/advertisers.go

This file was deleted.

16 changes: 16 additions & 0 deletions api/dsp/campaign/create.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package campaign

import (
"github.com/bububa/kwai-marketing-api/core"
"github.com/bububa/kwai-marketing-api/model/dsp/campaign"
)

// Create 创建广告计划
// 【注】创建搜索广告计划。每个广告主账号下最多可允许创建500个计划
func Create(clt *core.SDKClient, accessToken string, req *campaign.CreateRequest) (uint64, error) {
var resp campaign.CreateResponse
if err := clt.Post(accessToken, req, &resp); err != nil {
return 0, err
}
return resp.CampaignID, nil
}
2 changes: 2 additions & 0 deletions api/dsp/campaign/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package campaign 广告计划
package campaign
15 changes: 15 additions & 0 deletions api/dsp/campaign/list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package campaign

import (
"github.com/bububa/kwai-marketing-api/core"
"github.com/bububa/kwai-marketing-api/model/dsp/campaign"
)

// List 获取广告计划信息
func List(clt *core.SDKClient, accessToken string, req *campaign.ListRequest) (*campaign.ListResponse, error) {
var resp campaign.ListResponse
if err := clt.Post(accessToken, req, &resp); err != nil {
return nil, err
}
return &resp, nil
}
15 changes: 15 additions & 0 deletions api/dsp/campaign/update.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package campaign

import (
"github.com/bububa/kwai-marketing-api/core"
"github.com/bububa/kwai-marketing-api/model/dsp/campaign"
)

// Update 修改广告计划
func Update(clt *core.SDKClient, accessToken string, req *campaign.UpdateRequest) (uint64, error) {
var resp campaign.UpdateResponse
if err := clt.Post(accessToken, req, &resp); err != nil {
return 0, err
}
return resp.CampaignID, nil
}
15 changes: 15 additions & 0 deletions api/dsp/campaign/update_status.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package campaign

import (
"github.com/bububa/kwai-marketing-api/core"
"github.com/bububa/kwai-marketing-api/model/dsp/campaign"
)

// UpdateStatus 修改广告计划状态
func UpdateStatus(clt *core.SDKClient, accessToken string, req *campaign.UpdateStatusRequest) ([]uint64, error) {
var resp campaign.UpdateStatusResponse
if err := clt.Post(accessToken, req, &resp); err != nil {
return nil, err
}
return resp.CampaignIDs, nil
}
15 changes: 15 additions & 0 deletions api/dsp/creative/advanced_creative_create.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package creative

import (
"github.com/bububa/kwai-marketing-api/core"
"github.com/bububa/kwai-marketing-api/model/dsp/creative"
)

// AdvancedCreativeCreate 创建程序化创意
func AdvancedCreativeCreate(clt *core.SDKClient, accessToken string, req *creative.AdvancedCreativeCreateRequest) (uint64, error) {
var resp creative.AdvancedCreativeCreateResponse
if err := clt.Post(accessToken, req, &resp); err != nil {
return 0, err
}
return resp.UnitID, nil
}
15 changes: 15 additions & 0 deletions api/dsp/creative/advanced_creative_list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package creative

import (
"github.com/bububa/kwai-marketing-api/core"
"github.com/bububa/kwai-marketing-api/model/dsp/creative"
)

// AdvancedCreativeList 查询程序化创意
func AdvancedCreativeList(clt *core.SDKClient, accessToken string, req *creative.AdvancedCreativeListRequest) (*creative.AdvancedCreativeListResponse, error) {
var resp creative.AdvancedCreativeListResponse
if err := clt.Post(accessToken, req, &resp); err != nil {
return nil, err
}
return &resp, nil
}
15 changes: 15 additions & 0 deletions api/dsp/creative/advanced_creative_update.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package creative

import (
"github.com/bububa/kwai-marketing-api/core"
"github.com/bububa/kwai-marketing-api/model/dsp/creative"
)

// AdvancedCreativeUpdate 修改程序化创意
func AdvancedCreativeUpdate(clt *core.SDKClient, accessToken string, req *creative.AdvancedCreativeUpdateRequest) (uint64, error) {
var resp creative.AdvancedCreativeUpdateResponse
if err := clt.Post(accessToken, req, &resp); err != nil {
return 0, err
}
return resp.UnitID, nil
}
15 changes: 15 additions & 0 deletions api/dsp/creative/batch_update.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package creative

import (
"github.com/bububa/kwai-marketing-api/core"
"github.com/bububa/kwai-marketing-api/model/dsp/creative"
)

// BatchUpdate 批量修改自定义创意
func BatchUpdate(clt *core.SDKClient, accessToken string, req *creative.BatchUpdateRequest) (*creative.BatchUpdateResponse, error) {
var resp creative.BatchUpdateResponse
if err := clt.Post(accessToken, req, &resp); err != nil {
return nil, err
}
return &resp, nil
}
15 changes: 15 additions & 0 deletions api/dsp/creative/create.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package creative

import (
"github.com/bububa/kwai-marketing-api/core"
"github.com/bububa/kwai-marketing-api/model/dsp/creative"
)

// Create 创建自定义创意
func Create(clt *core.SDKClient, accessToken string, req *creative.CreateRequest) (uint64, error) {
var resp creative.CreateResponse
if err := clt.Post(accessToken, req, &resp); err != nil {
return 0, err
}
return resp.CreativeID, nil
}
2 changes: 2 additions & 0 deletions api/dsp/creative/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package creative 广告创意
package creative
15 changes: 15 additions & 0 deletions api/dsp/creative/list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package creative

import (
"github.com/bububa/kwai-marketing-api/core"
"github.com/bububa/kwai-marketing-api/model/dsp/creative"
)

// List 查询自定义创意
func List(clt *core.SDKClient, accessToken string, req *creative.ListRequest) (*creative.ListResponse, error) {
var resp creative.ListResponse
if err := clt.Post(accessToken, req, &resp); err != nil {
return nil, err
}
return &resp, nil
}
11 changes: 11 additions & 0 deletions api/dsp/creative/preview.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package creative

import (
"github.com/bububa/kwai-marketing-api/core"
"github.com/bububa/kwai-marketing-api/model/dsp/creative"
)

// Preview 创意体验
func Preview(clt *core.SDKClient, accessToken string, req *creative.PreviewRequest) error {
return clt.Post(accessToken, req, nil)
}
15 changes: 15 additions & 0 deletions api/dsp/creative/update.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package creative

import (
"github.com/bububa/kwai-marketing-api/core"
"github.com/bububa/kwai-marketing-api/model/dsp/creative"
)

// Update 修改自定义创意
func Update(clt *core.SDKClient, accessToken string, req *creative.UpdateRequest) (uint64, error) {
var resp creative.UpdateResponse
if err := clt.Post(accessToken, req, &resp); err != nil {
return 0, err
}
return resp.CreativeID, nil
}
15 changes: 15 additions & 0 deletions api/dsp/creative/update_status.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package creative

import (
"github.com/bububa/kwai-marketing-api/core"
"github.com/bububa/kwai-marketing-api/model/dsp/creative"
)

// UpdateStatus 修改创意状态
func UpdateStatus(clt *core.SDKClient, accessToken string, req *creative.UpdateStatusRequest) ([]uint64, error) {
var resp creative.UpdateStatusResponse
if err := clt.Post(accessToken, req, &resp); err != nil {
return nil, err
}
return resp.CreativeIDs, nil
}
2 changes: 2 additions & 0 deletions api/dsp/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package dsp 智能化创编
package dsp
15 changes: 15 additions & 0 deletions api/dsp/unit/create.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package unit

import (
"github.com/bububa/kwai-marketing-api/core"
"github.com/bububa/kwai-marketing-api/model/dsp/unit"
)

// Create 创建广告组
func Create(clt *core.SDKClient, accessToken string, req *unit.CreateRequest) (uint64, error) {
var resp unit.CreateResponse
if err := clt.Post(accessToken, req, &resp); err != nil {
return 0, err
}
return resp.UnitID, nil
}
2 changes: 2 additions & 0 deletions api/dsp/unit/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package unit 广告组
package unit
15 changes: 15 additions & 0 deletions api/dsp/unit/list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package unit

import (
"github.com/bububa/kwai-marketing-api/core"
"github.com/bububa/kwai-marketing-api/model/dsp/unit"
)

// List 获取广告组信息
func List(clt *core.SDKClient, accessToken string, req *unit.ListRequest) (*unit.ListResponse, error) {
var resp unit.ListResponse
if err := clt.Post(accessToken, req, &resp); err != nil {
return nil, err
}
return &resp, nil
}
15 changes: 15 additions & 0 deletions api/dsp/unit/update.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package unit

import (
"github.com/bububa/kwai-marketing-api/core"
"github.com/bububa/kwai-marketing-api/model/dsp/unit"
)

// Update 修改广告组
func Update(clt *core.SDKClient, accessToken string, req *unit.UpdateRequest) (uint64, error) {
var resp unit.UpdateResponse
if err := clt.Post(accessToken, req, &resp); err != nil {
return 0, err
}
return resp.UnitID, nil
}
11 changes: 11 additions & 0 deletions api/dsp/unit/update_bid.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package unit

import (
"github.com/bububa/kwai-marketing-api/core"
"github.com/bububa/kwai-marketing-api/model/dsp/unit"
)

// UpdateBid 修改广告组出价
func UpdateBid(clt *core.SDKClient, accessToken string, req *unit.UpdateBidRequest) error {
return clt.Post(accessToken, req, nil)
}
11 changes: 11 additions & 0 deletions api/dsp/unit/update_day_budget.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package unit

import (
"github.com/bububa/kwai-marketing-api/core"
"github.com/bububa/kwai-marketing-api/model/dsp/unit"
)

// UpdateDayBudget 修改广告组预算
func UpdateDayBudget(clt *core.SDKClient, accessToken string, req *unit.UpdateDayBudgetRequest) error {
return clt.Post(accessToken, req, nil)
}
Loading

0 comments on commit a507b14

Please sign in to comment.