-
Notifications
You must be signed in to change notification settings - Fork 23
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
23 changed files
with
579 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 target 定向模板 | ||
package target |
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,15 @@ | ||
package target | ||
|
||
import ( | ||
"github.com/bububa/kwai-marketing-api/core" | ||
"github.com/bububa/kwai-marketing-api/model/dsp/target" | ||
) | ||
|
||
// OptionDistanceList 根据店铺名称查询商圈信息 | ||
func OptionDistanceList(clt *core.SDKClient, accessToken string, req *target.OptionDistanceListRequest) (*target.OptionDistanceListResponse, error) { | ||
var resp target.OptionDistanceListResponse | ||
if err := clt.Post(accessToken, req, &resp); err != nil { | ||
return nil, err | ||
} | ||
return &resp, 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,15 @@ | ||
package target | ||
|
||
import ( | ||
"github.com/bububa/kwai-marketing-api/core" | ||
"github.com/bububa/kwai-marketing-api/model/dsp/target" | ||
) | ||
|
||
// TemplateCreate 创建定向模板 | ||
func TemplateCreate(clt *core.SDKClient, accessToken string, req *target.TemplateCreateRequest) (uint64, error) { | ||
var resp target.TemplateCreateResponse | ||
if err := clt.Post(accessToken, req, &resp); err != nil { | ||
return 0, err | ||
} | ||
return resp.TemplateID, 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,15 @@ | ||
package target | ||
|
||
import ( | ||
"github.com/bububa/kwai-marketing-api/core" | ||
"github.com/bububa/kwai-marketing-api/model/dsp/target" | ||
) | ||
|
||
// TemplateDelete 删除定向模板 | ||
func TemplateDelete(clt *core.SDKClient, accessToken string, req *target.TemplateDeleteRequest) (uint64, error) { | ||
var resp target.TemplateDeleteResponse | ||
if err := clt.Post(accessToken, req, &resp); err != nil { | ||
return 0, err | ||
} | ||
return resp.TemplateID, 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,15 @@ | ||
package target | ||
|
||
import ( | ||
"github.com/bububa/kwai-marketing-api/core" | ||
"github.com/bububa/kwai-marketing-api/model/dsp/target" | ||
) | ||
|
||
// TemplateDetails 查询定向模板 | ||
func TemplateDetails(clt *core.SDKClient, accessToken string, req *target.TemplateDetailsRequest) (*target.TemplateDetailsResponse, error) { | ||
var resp target.TemplateDetailsResponse | ||
if err := clt.Post(accessToken, req, &resp); err != nil { | ||
return nil, err | ||
} | ||
return &resp, 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,15 @@ | ||
package target | ||
|
||
import ( | ||
"github.com/bububa/kwai-marketing-api/core" | ||
"github.com/bububa/kwai-marketing-api/model/dsp/target" | ||
) | ||
|
||
// TemplateRelatedUnitList 查询模板关联的广告列表接口 | ||
func TemplateRelatedUnitList(clt *core.SDKClient, accessToken string, req *target.TemplateRelatedUnitListRequest) (*target.TemplateRelatedUnitListResponse, error) { | ||
var resp target.TemplateRelatedUnitListResponse | ||
if err := clt.Post(accessToken, req, &resp); err != nil { | ||
return nil, err | ||
} | ||
return &resp, 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,15 @@ | ||
package target | ||
|
||
import ( | ||
"github.com/bububa/kwai-marketing-api/core" | ||
"github.com/bububa/kwai-marketing-api/model/dsp/target" | ||
) | ||
|
||
// TemplateSyncHistory 模板同步失败查询 | ||
func TemplateSyncHistory(clt *core.SDKClient, accessToken string, req *target.TemplateSyncHistoryRequest) (*target.TemplateSyncHistoryResponse, error) { | ||
var resp target.TemplateSyncHistoryResponse | ||
if err := clt.Post(accessToken, req, &resp); err != nil { | ||
return nil, err | ||
} | ||
return &resp, 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,15 @@ | ||
package target | ||
|
||
import ( | ||
"github.com/bububa/kwai-marketing-api/core" | ||
"github.com/bububa/kwai-marketing-api/model/dsp/target" | ||
) | ||
|
||
// TemplateUnitSync 定向模板同步 | ||
func TemplateUnitSync(clt *core.SDKClient, accessToken string, req *target.TemplateUnitSyncRequest) (*target.TemplateUnitSyncResponse, error) { | ||
var resp target.TemplateUnitSyncResponse | ||
if err := clt.Post(accessToken, req, &resp); err != nil { | ||
return nil, err | ||
} | ||
return &resp, 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,15 @@ | ||
package target | ||
|
||
import ( | ||
"github.com/bububa/kwai-marketing-api/core" | ||
"github.com/bububa/kwai-marketing-api/model/dsp/target" | ||
) | ||
|
||
// TemplateUpdate 更新定向模板 | ||
func TemplateUpdate(clt *core.SDKClient, accessToken string, req *target.TemplateUpdateRequest) (uint64, error) { | ||
var resp target.TemplateUpdateResponse | ||
if err := clt.Post(accessToken, req, &resp); err != nil { | ||
return 0, err | ||
} | ||
return resp.TemplateID, 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,15 @@ | ||
package target | ||
|
||
import ( | ||
"github.com/bububa/kwai-marketing-api/core" | ||
"github.com/bububa/kwai-marketing-api/model/dsp/target" | ||
) | ||
|
||
// TemplateUpgrade 模板升级 | ||
func TemplateUpgrade(clt *core.SDKClient, accessToken string, req *target.TemplateUpgradeRequest) (int64, error) { | ||
var resp target.TemplateUpgradeResponse | ||
if err := clt.Post(accessToken, req, &resp); err != nil { | ||
return 0, err | ||
} | ||
return resp.TemplateCount, 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,15 @@ | ||
package target | ||
|
||
import ( | ||
"github.com/bububa/kwai-marketing-api/core" | ||
"github.com/bububa/kwai-marketing-api/model/dsp/target" | ||
) | ||
|
||
// TemplateUpgradeList 查询待升级模板列表 | ||
func TemplateUpgradeList(clt *core.SDKClient, accessToken string, req *target.TemplateUpgradeListRequest) ([]target.TemplateUpgradeItem, error) { | ||
var resp []target.TemplateUpgradeItem | ||
if err := clt.Post(accessToken, req, &resp); err != nil { | ||
return nil, err | ||
} | ||
return resp, 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 target 定向模板 | ||
package target |
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,57 @@ | ||
package target | ||
|
||
import "github.com/bububa/kwai-marketing-api/model" | ||
|
||
// OptionDistanceListRequest 根据店铺名称查询商圈信息 API Request | ||
type OptionDistanceListRequest struct { | ||
// ProvinceName 省份,城市二选一必填 | ||
ProvinceName string `json:"province_name,omitempty"` | ||
// CityName 省份,城市二选一必填 | ||
CityName string `json:"city_name,omitempty"` | ||
// DistrictName 街区,选填 | ||
DistrictName string `json:"district_name,omitempty"` | ||
// LocationName 店铺名,必填 | ||
LocationName string `json:"location_name,omitempty"` | ||
// Page 页数 | ||
Page int `json:"page,omitempty"` | ||
// PageSize 页面大小 | ||
PageSize int `json:"page_size,omitempty"` | ||
} | ||
|
||
// Url implement GetRequest interface | ||
func (r OptionDistanceListRequest) Url() string { | ||
return "gw/dsp/target/option/distance_list" | ||
} | ||
|
||
// Encode implement PostRequest interface | ||
func (r OptionDistanceListRequest) Encode() []byte { | ||
return model.JSONMarshal(r) | ||
} | ||
|
||
// OptionDistanceListResponse 根据店铺名称查询商圈信息 API Response | ||
type OptionDistanceListResponse struct { | ||
// List 商圈信息列表 | ||
List []Distance `json:"list,omitempty"` | ||
// CurrentPage 当前页数 | ||
CurrentPage int `json:"current_page,omitempty"` | ||
// PageSize 页面大小 | ||
PageSize int `json:"page_size,omitempty"` | ||
// NextPage 下一页页数 | ||
NextPage int `json:"next_page,omitempty"` | ||
} | ||
|
||
// Distance 商圈信息 | ||
type Distance struct { | ||
// Address 地址 | ||
Address string `json:"address,omitempty"` | ||
// Lat 经度 | ||
Lat string `json:"lat,omitempty"` | ||
// Lng 纬度 | ||
Lng string `json:"lng,omitempty"` | ||
// LocationName 店铺名称 | ||
LocationName string `json:"location_name,omitempty"` | ||
// PoiID 唯一标识 | ||
PoiID string `json:"poi_id,omitempty"` | ||
// Radius 半径(单位m) | ||
Radius int64 `json:"radius,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,32 @@ | ||
package target | ||
|
||
import ( | ||
"github.com/bububa/kwai-marketing-api/model" | ||
"github.com/bububa/kwai-marketing-api/model/dsp/unit" | ||
) | ||
|
||
// TemplateCreateRequest 创建定向模板 API Request | ||
type TemplateCreateRequest struct { | ||
// Target 定向信息 | ||
Target *unit.Target `json:"target,omitempty"` | ||
// TemplateName 定向模板名称 | ||
TemplateName string `json:"template_name,omitempty"` | ||
// AdvertiserID 广告主 ID | ||
AdvertiserID uint64 `json:"advertiser_id,omitempty"` | ||
} | ||
|
||
// Url implement GetRequest interface | ||
func (r TemplateCreateRequest) Url() string { | ||
return "gw/dsp/target/template/create" | ||
} | ||
|
||
// Encode implement GetRequest interface | ||
func (r TemplateCreateRequest) Encode() []byte { | ||
return model.JSONMarshal(r) | ||
} | ||
|
||
// TemplateCreateResponse 创建定向模板 API Response | ||
type TemplateCreateResponse struct { | ||
// TemplateID 模板ID | ||
TemplateID uint64 `json:"template_id,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,27 @@ | ||
package target | ||
|
||
import ( | ||
"github.com/bububa/kwai-marketing-api/model" | ||
) | ||
|
||
// TemplateDeleteRequest 删除定向模板 API Request | ||
type TemplateDeleteRequest struct { | ||
// TemplateID 模板ID | ||
TemplateID uint64 `json:"template_id,omitempty"` | ||
} | ||
|
||
// Url implement PostRequest interface | ||
func (r TemplateDeleteRequest) Url() string { | ||
return "gw/dsp/target/template/delete" | ||
} | ||
|
||
// Encode implement PostRequest interface | ||
func (r TemplateDeleteRequest) Encode() []byte { | ||
return model.JSONMarshal(r) | ||
} | ||
|
||
// TemplateDeleteResponse API Response | ||
type TemplateDeleteResponse struct { | ||
// TemplateID 模板ID | ||
TemplateID uint64 `json:"template_id,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,55 @@ | ||
package target | ||
|
||
import ( | ||
"github.com/bububa/kwai-marketing-api/model" | ||
"github.com/bububa/kwai-marketing-api/model/dsp/unit" | ||
) | ||
|
||
// TemplateDetailsRequest 查询定向模板 API Request | ||
type TemplateDetailsRequest struct { | ||
// TemplateID 模板ID列表(默认ID和分页参数二选一必传) | ||
TemplateID []uint64 `json:"template_id,omitempty"` | ||
// AdvertiserID 广告主 ID | ||
AdvertiserID uint64 `json:"advertiser_id,omitempty"` | ||
// Page 请求的页码,默认为 1(page和page_size要么都传,要么都不传;都不传时需要传模板ID) | ||
Page int `json:"page,omitempty"` | ||
// PageSize 每页行数,默认 20 | ||
PageSize int `json:"page_size,omitempty"` | ||
} | ||
|
||
// Url implement GetRequest interface | ||
func (r TemplateDetailsRequest) Url() string { | ||
return "gw/dsp/target/template/details" | ||
} | ||
|
||
// Encode implement GetRequest interface | ||
func (r TemplateDetailsRequest) Encode() []byte { | ||
return model.JSONMarshal(r) | ||
} | ||
|
||
// TemplateDetailsResponse 查询定向模板 API Response | ||
type TemplateDetailsResponse struct { | ||
Details []Template `json:"details,omitempty"` | ||
// TotalCount 总数 | ||
TotalCount int `json:"total_count,omitempty"` | ||
// CurrentPage 当前页码, 第一页是1 | ||
CurrentPage int `json:"current_page"` | ||
// PageSize 分页大小 | ||
PageSize int `json:"page_size"` | ||
} | ||
|
||
// Template 定向模板 | ||
type Template struct { | ||
// Target 定向信息 | ||
Target *unit.Target `json:"target,omitempty"` | ||
// TemplateName 定向模板名称 | ||
TemplateName string `json:"template_name,omitempty"` | ||
// CreateTime 定向模板创建时间,"2019-06-11 15:17:25" | ||
CreateTime string `json:"create_time,omitempty"` | ||
// UpdateTime 定向模板最近修改时间 | ||
UpdateTime string `json:"update_time,omitempty"` | ||
// TemplateID 定向模板 ID | ||
TemplateID uint64 `json:"template_id,omitempty"` | ||
// UnitCount 绑定unit个数 | ||
UnitCount int `json:"unit_count,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,37 @@ | ||
package target | ||
|
||
import "github.com/bububa/kwai-marketing-api/model" | ||
|
||
// TemplateRelatedUnitListRequest 查询模板关联的广告列表接口 API Request | ||
type TemplateRelatedUnitListRequest struct { | ||
// CurrentPage 当前页码 | ||
CurrentPage int `json:"current_page,omitempty"` | ||
// PageSize 每页大小 | ||
PageSize int `json:"page_size,omitempty"` | ||
// TaskID 任务ID | ||
TaskID uint64 `json:"task_id,omitempty"` | ||
// TemplateID 模板ID | ||
TemplateID uint64 `json:"template_id,omitempty"` | ||
} | ||
|
||
// Url implement PostRequest interface | ||
func (r TemplateRelatedUnitListRequest) Url() string { | ||
return "gw/dsp/target/template/related_unit_list" | ||
} | ||
|
||
// Encode implement PostRequest interface | ||
func (r TemplateRelatedUnitListRequest) Encode() []byte { | ||
return model.JSONMarshal(r) | ||
} | ||
|
||
// TemplateRelatedUnitListResponse 查询模板关联的广告列表接口 API Response | ||
type TemplateRelatedUnitListResponse struct { | ||
// Details 模板同步列表 | ||
Details []TemplateSyncUnit `json:"details,omitempty"` | ||
// CurrentPage 当前页码 | ||
CurrentPage int `json:"current_page,omitempty"` | ||
// PageSize 每页大小 | ||
PageSize int `json:"page_size,omitempty"` | ||
// TotalCount 总条数 | ||
TotalCount int `json:"total_count,omitempty"` | ||
} |
Oops, something went wrong.