Skip to content

Commit

Permalink
Merge branch 'release/v1.8.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
bububa committed Jun 19, 2024
2 parents 132bbde + 5d3d8c9 commit f40f6f5
Show file tree
Hide file tree
Showing 10 changed files with 130 additions and 10 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@
- 视频库-删除视频标签 [ AdVideoTagDelete(clt *core.SDKClient, accessToken string, req *file.AdVideoTagDeleteRequest) error ]
- 视频关联创意数查询 [ AdVideoRelateCreatives(clt *core.SDKClient, accessToken string, req *file.AdVideoRelateCreativesRequest) ([]file.AdVideoRelatedCreatives, error) ]
- 查询账户共享视频库按钮是否开启 [ dsp.video.QueryAutoShareSwitch(clt *core.SDKClient, accessToken string, req *video.QueryAutoShareSwitchRequest) (*video.QueryAutoShareSwitchResponse, error) ]
- 建站管理(api/page)
- 获取魔力建站落地页组信息列表 [ List(clt *core.SDKClient, accessToken string, req *page.ListRequest) (*page.ListResponse, error) ]
- 批量转赠 [ BatchGive(clt *core.SDKClient, accessToken string, req *page.BatchGiveRequest) error ]
- 魔力建站落地页更新CID信息 [ CidInfoUpdate(clt *core.SDKClient, accessToken string, req *page.CidInfoUpdateRequest) (uint64, error) ]
- 工具
- 查询工具
- 获取可选的深度转化目标 [ unit.OcpcConversionInfos(clt *core.SDKClient, accessToken string, req *unit.OcpcConversionInfosRequest) (*unit.OcpcConversionInfosResponse, error) ]
Expand Down
18 changes: 18 additions & 0 deletions api/page/batch_give.go
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
}
15 changes: 15 additions & 0 deletions api/page/cid_info_update.go
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
}
2 changes: 2 additions & 0 deletions api/page/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// package Page 魔力建站落地页相关 API
package page
42 changes: 42 additions & 0 deletions model/page/batch_give.go
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
}
38 changes: 38 additions & 0 deletions model/page/cid_info_update.go
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"`
}
2 changes: 2 additions & 0 deletions model/page/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// package Page 魔力建站落地页相关 API Model
package page
8 changes: 8 additions & 0 deletions model/page/list_request.go → model/page/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,11 @@ func (r ListRequest) Encode() []byte {
ret, _ := json.Marshal(r)
return ret
}

// ListResponse 获取魔力建站落地页信息列表 API Response
type ListResponse struct {
// TotalCount 总共条数
TotalCount int `json:"total_count,omitempty"`
// Details json array
Details []Page `json:"details,omitempty"`
}
9 changes: 0 additions & 9 deletions model/page/list_response.go

This file was deleted.

2 changes: 1 addition & 1 deletion model/report/stat.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type Stat struct {
// MatchType 匹配方式:1:精确匹配,2:短语匹配,3:广泛匹配
MatchType model.MatchType `json:"match_type,omitempty"`
// PhotoID 视频id
PhotoID uint64 `json:"photo_id,omitempty"`
PhotoID model.Uint64 `json:"photo_id,omitempty"`
// PhotoUrl 视频链接
PhotoUrl string `json:"photo_url,omitempty"`
// ImageToken 封面id
Expand Down

0 comments on commit f40f6f5

Please sign in to comment.