Skip to content

Commit

Permalink
Merge branch 'release/v1.6.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
bububa committed Mar 19, 2024
2 parents 0fc2439 + 93a40fa commit 306c978
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
- 修改广告组预算 [ 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 ]
- 批量获取监测链接接口 [ GetMonitorURLs(clt *core.SDKClient, accessToken string, req *unit.GetMonitorURLsRequest) ([]unit.UnitMonitorURL, error) ]
- 监测链接批量更新接口 [ BatchUpdateMonitorURLs(clt *core.SDKClient, accessToken string, req *unit.BatchUpdateMonitorURLsRequest) ([]unit.UnitMonitorURL, 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) ]
Expand Down
15 changes: 15 additions & 0 deletions api/dsp/unit/batch_update_monitor_urls.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"
)

// BatchUpdateMonitorURLs 监测链接批量更新接口
func BatchUpdateMonitorURLs(clt *core.SDKClient, accessToken string, req *unit.BatchUpdateMonitorURLsRequest) ([]unit.UnitMonitorURL, error) {
var resp unit.GetMonitorURLsResponse
if err := clt.Post(accessToken, req, &resp); err != nil {
return nil, err
}
return resp.UnitMonitorURLs, nil
}
15 changes: 15 additions & 0 deletions api/dsp/unit/get_monitor_urls.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"
)

// GetMonitorURLs 批量获取监测链接接口
func GetMonitorURLs(clt *core.SDKClient, accessToken string, req *unit.GetMonitorURLsRequest) ([]unit.UnitMonitorURL, error) {
var resp unit.GetMonitorURLsResponse
if err := clt.Post(accessToken, req, &resp); err != nil {
return nil, err
}
return resp.UnitMonitorURLs, nil
}
66 changes: 66 additions & 0 deletions model/dsp/unit/monitor_urls.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package unit

import "github.com/bububa/kwai-marketing-api/model"

// GetMonitorURLsRequest 批量获取监测链接接口 API Request
type GetMonitorURLsRequest struct {
// AdvertiserID 广告主ID
AdvertiserID uint64 `json:"advertiser_id,omitempty"`
// UnitIDs 广告组 ID 集
UnitIDs []uint64 `json:"unit_ids,omitempty"`
}

// Url implement PostRequest interface
func (r GetMonitorURLsRequest) Url() string {
return "gw/dsp/v3/unit/getMonitorUrls"
}

// Encode implement PostRequest interface
func (r GetMonitorURLsRequest) Encode() []byte {
return model.JSONMarshal(r)
}

// GetMonitorURLsResponse 批量获取监测链接接口 API Response
type GetMonitorURLsResponse struct {
UnitMonitorURLs []UnitMonitorURL `json:"unit_monitor_urls,omitempty"`
}

// BatchUpdateMonitorURLsRequest 监测链接批量更新接口 API Request
type BatchUpdateMonitorURLsRequest struct {
// UnitMonitorURLs 监测链接详情
UnitMonitorURLs []UnitMonitorURL `json:"unit_monitor_urls,omitempty"`
}

// Url implement PostRequest interface
func (r BatchUpdateMonitorURLsRequest) Url() string {
return "gw/dsp/v3/unit/batchUpdateMonitorUrls"
}

// Encode implement PostRequest interface
func (r BatchUpdateMonitorURLsRequest) Encode() []byte {
return model.JSONMarshal(r)
}

// UnitMonitorURL 监测链接
type UnitMonitorURL struct {
// UnitID 广告组 ID
UnitID uint64 `json:"unit_id,omitempty"`
// IsDpa 是否是DPA(DPA的监测链接在广告组上)
IsDpa bool `json:"is_dpa,omitempty"`
// ExistValidCreative 是否存在有效创意
ExistValidCreative bool `json:"exist_valid_creative,omitempty"`
// ActionbarClickURL actionBar点击监测,命中有效触点白名单表示有效触点监测链接(限:快手主站/极速版场景)
ActionbarClickURL string `json:"actionbar_click_url,omitempty"`
// ClickURL 点击监测(排除粉丝直播推广)
ClickURL string `json:"click_url,omitempty"`
// ImpressionURL 展示监测
ImpressionURL string `json:"impression_url,omitempty"`
// LiveTrackURL 粉丝直播推广点击监测
LiveTrackURL string `json:"live_track_url,omitempty"`
// AdPhotoPlayedT3sURL 粉丝直播推广曝光监测
AdPhotoPlayedT3sURL string `json:"ad_photo_played_t3s_url,omitempty"`
// Result 修改是否成功
Result bool `json:"result,omitempty"`
// Message 修改成功与否提示信息
Message string `json:"message,omitempty"`
}

0 comments on commit 306c978

Please sign in to comment.