Skip to content

Commit

Permalink
Merge branch 'release/v1.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
bububa committed May 19, 2022
2 parents 536fde0 + d9f202c commit b392055
Show file tree
Hide file tree
Showing 157 changed files with 312 additions and 310 deletions.
2 changes: 1 addition & 1 deletion api/advertiser/advertisers.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

// AdvertisersGet 获取罗盘绑定广告主列
func AdvertisersGet(clt *core.SDKClient, accessToken string, advertiserID int64) (*advertiser.AdvertisersResponse, error) {
func AdvertisersGet(clt *core.SDKClient, accessToken string, advertiserID uint64) (*advertiser.AdvertisersResponse, error) {
req := &advertiser.AdvertisersRequest{
AdvertiserID: advertiserID,
}
Expand Down
2 changes: 1 addition & 1 deletion api/advertiser/budget_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

// BudgetGet 账户日预算查询
func BudgetGet(clt *core.SDKClient, accessToken string, advertiserID int64) (*advertiser.Budget, error) {
func BudgetGet(clt *core.SDKClient, accessToken string, advertiserID uint64) (*advertiser.Budget, error) {
req := &advertiser.BudgetGetRequest{
AdvertiserID: advertiserID,
}
Expand Down
2 changes: 1 addition & 1 deletion api/advertiser/fund_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

// FundGet 获取广告账户余额信息
func FundGet(clt *core.SDKClient, accessToken string, advertiserID int64) (float64, error) {
func FundGet(clt *core.SDKClient, accessToken string, advertiserID uint64) (float64, error) {
req := &advertiser.FundGetRequest{
AdvertiserID: advertiserID,
}
Expand Down
2 changes: 1 addition & 1 deletion api/advertiser/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

// Info 获取广告账户信息
func Info(clt *core.SDKClient, accessToken string, advertiserID int64) (*advertiser.Info, error) {
func Info(clt *core.SDKClient, accessToken string, advertiserID uint64) (*advertiser.Info, error) {
req := &advertiser.InfoRequest{
AdvertiserID: advertiserID,
}
Expand Down
2 changes: 1 addition & 1 deletion api/advertiser/white_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

// WhiteList 获取可选白名单接口
func WhiteList(clt *core.SDKClient, accessToken string, advertiserID int64) (*advertiser.WhiteListResponse, error) {
func WhiteList(clt *core.SDKClient, accessToken string, advertiserID uint64) (*advertiser.WhiteListResponse, error) {
req := &advertiser.WhiteListRequest{
AdvertiserID: advertiserID,
}
Expand Down
2 changes: 1 addition & 1 deletion api/asset/adv_card_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

// AdvCardCreate 创建高级创意接口
func AdvCardCreate(clt *core.SDKClient, accessToken string, req *asset.AdvCardCreateRequest) ([]int64, error) {
func AdvCardCreate(clt *core.SDKClient, accessToken string, req *asset.AdvCardCreateRequest) ([]uint64, error) {
var resp asset.AdvCardCreateResponse
err := clt.Post(accessToken, req, &resp)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion api/asset/adv_card_remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

// AdvCardRemove 删除高级创意接口
func AdvCardRemove(clt *core.SDKClient, accessToken string, req *asset.AdvCardRemoveRequest) ([]int64, error) {
func AdvCardRemove(clt *core.SDKClient, accessToken string, req *asset.AdvCardRemoveRequest) ([]uint64, error) {
var resp asset.AdvCardRemoveResponse
err := clt.Post(accessToken, req, &resp)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion api/campaign/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

// Create 创建广告计划
func Create(clt *core.SDKClient, accessToken string, req *campaign.CreateRequest) (int64, error) {
func Create(clt *core.SDKClient, accessToken string, req *campaign.CreateRequest) (uint64, error) {
var resp campaign.CreateResponse
err := clt.Post(accessToken, req, &resp)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion api/campaign/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

// Update 修改广告计划
func Update(clt *core.SDKClient, accessToken string, req *campaign.UpdateRequest) (int64, error) {
func Update(clt *core.SDKClient, accessToken string, req *campaign.UpdateRequest) (uint64, error) {
var resp campaign.UpdateResponse
err := clt.Post(accessToken, req, &resp)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion api/campaign/update_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

// UpdateStatus 修改广告计划状态
func UpdateStatus(clt *core.SDKClient, accessToken string, req *campaign.UpdateStatusRequest) ([]int64, error) {
func UpdateStatus(clt *core.SDKClient, accessToken string, req *campaign.UpdateStatusRequest) ([]uint64, error) {
var resp campaign.UpdateStatusResponse
err := clt.Post(accessToken, req, &resp)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion api/creative/advanced_program_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

// AdvancedProgramCreate 创建程序化2.0创意
func AdvancedProgramCreate(clt *core.SDKClient, accessToken string, req *creative.AdvancedProgramCreateRequest) (int64, error) {
func AdvancedProgramCreate(clt *core.SDKClient, accessToken string, req *creative.AdvancedProgramCreateRequest) (uint64, error) {
var resp creative.AdvancedProgramCreateResponse
err := clt.Post(accessToken, req, &resp)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion api/creative/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

// Create 创建创意
// 【注】联盟广告不支持便利贴图片素材,只有联盟广告支持横版竖版图片素材。
func Create(clt *core.SDKClient, accessToken string, req *creative.CreateRequest) (int64, error) {
func Create(clt *core.SDKClient, accessToken string, req *creative.CreateRequest) (uint64, error) {
var resp creative.CreateResponse
err := clt.Post(accessToken, req, &resp)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion api/creative/create_advanced.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

// Create 创建创意
// 【注】联盟广告不支持便利贴图片素材,只有联盟广告支持横版竖版图片素材。
func CreateAdvanced(clt *core.SDKClient, accessToken string, req *creative.CreateAdvancedRequest) (int64, error) {
func CreateAdvanced(clt *core.SDKClient, accessToken string, req *creative.CreateAdvancedRequest) (uint64, error) {
var resp creative.CreateAdvancedResponse
err := clt.Post(accessToken, req, &resp)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion api/creative/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

// Update 修改创意
//【注】联盟广告不支持便利贴图片素材。
func Update(clt *core.SDKClient, accessToken string, req *creative.UpdateRequest) (int64, error) {
func Update(clt *core.SDKClient, accessToken string, req *creative.UpdateRequest) (uint64, error) {
var resp creative.UpdateResponse
err := clt.Post(accessToken, req, &resp)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion api/creative/update_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

// UpdateStatus 修改创意状态
func UpdateStatus(clt *core.SDKClient, accessToken string, req *creative.UpdateStatusRequest) ([]int64, error) {
func UpdateStatus(clt *core.SDKClient, accessToken string, req *creative.UpdateStatusRequest) ([]uint64, error) {
var resp creative.UpdateStatusResponse
err := clt.Post(accessToken, req, &resp)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion api/region/district_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

// DistrictList 获取商圈地域定向
func DistrictList(clt *core.SDKClient, accessToken string, advertiserID int64) (map[string]region.District, error) {
func DistrictList(clt *core.SDKClient, accessToken string, advertiserID uint64) (map[string]region.District, error) {
req := &region.DistrictListRequest{
AdvertiserID: advertiserID,
}
Expand Down
2 changes: 1 addition & 1 deletion api/tool/creative_word_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

// CreativeWordList 获取可选的动态词包
func CreativeWordList(clt *core.SDKClient, accessToken string, advertiserID int64) ([]tool.CreativeWord, error) {
func CreativeWordList(clt *core.SDKClient, accessToken string, advertiserID uint64) ([]tool.CreativeWord, error) {
req := &tool.CreativeWordListRequest{
AdvertiserID: advertiserID,
}
Expand Down
2 changes: 1 addition & 1 deletion api/tool/creative_word_styles.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

// CreativeWordStyles 获取可选的封面贴纸样式
func CreativeWordStyles(clt *core.SDKClient, accessToken string, advertiserID int64) ([]tool.CreativeWordStyle, error) {
func CreativeWordStyles(clt *core.SDKClient, accessToken string, advertiserID uint64) ([]tool.CreativeWordStyle, error) {
req := &tool.CreativeWordStylesRequest{
AdvertiserID: advertiserID,
}
Expand Down
2 changes: 1 addition & 1 deletion api/unit/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

// Create 创建广告组
func Create(clt *core.SDKClient, accessToken string, req *unit.CreateRequest) (int64, error) {
func Create(clt *core.SDKClient, accessToken string, req *unit.CreateRequest) (uint64, error) {
var resp unit.CreateResponse
err := clt.Post(accessToken, req, &resp)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion api/unit/create_union.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
// 【注】白名单账户支持定投联盟广告,创建广告组接口不变,有以下几点限制:
// 1. 仅支持计划类型为“提升应用安装”;“收集销售线索”;“获取电商下单”“提高应用活跃”的广告;
// 2. 仅支持部分定向;3. 转化目标参数convert_id、深度转化目标deep_conversion_type有特殊要求。
func CreateUnion(clt *core.SDKClient, accessToken string, req *unit.CreateUnionRequest) (int64, error) {
func CreateUnion(clt *core.SDKClient, accessToken string, req *unit.CreateUnionRequest) (uint64, error) {
var resp unit.CreateUnionResponse
err := clt.Post(accessToken, req, &resp)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion api/unit/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

// Update 修改广告组
func Update(clt *core.SDKClient, accessToken string, req *unit.UpdateRequest) (int64, error) {
func Update(clt *core.SDKClient, accessToken string, req *unit.UpdateRequest) (uint64, error) {
var resp unit.UpdateResponse
err := clt.Post(accessToken, req, &resp)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion api/unit/update_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

// UpdateStatus 修改广告组状态
func UpdateStatus(clt *core.SDKClient, accessToken string, req *unit.UpdateStatusRequest) ([]int64, error) {
func UpdateStatus(clt *core.SDKClient, accessToken string, req *unit.UpdateStatusRequest) ([]uint64, error) {
var resp unit.UpdateStatusResponse
err := clt.Post(accessToken, req, &resp)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion api/unit/update_union.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

// UpdateUnion 修改联盟定投广告组
// 【注】白名单账户支持定投联盟广告,修改广告组接口不变,有以下限制:1. 仅支持部分定向。
func UpdateUnion(clt *core.SDKClient, accessToken string, req *unit.UpdateUnionRequest) (int64, error) {
func UpdateUnion(clt *core.SDKClient, accessToken string, req *unit.UpdateUnionRequest) (uint64, error) {
var resp unit.UpdateUnionResponse
err := clt.Post(accessToken, req, &resp)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions core/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ import (

// SDKClient api client
type SDKClient struct {
appID int64
appID uint64
secret string
debug bool
}

// NewSDKClient init sdk client
func NewSDKClient(appID int64, secret string) *SDKClient {
func NewSDKClient(appID uint64, secret string) *SDKClient {
return &SDKClient{
appID: appID,
secret: secret,
Expand All @@ -34,7 +34,7 @@ func (c *SDKClient) SetDebug(debug bool) {
}

// AppID appID getter
func (c *SDKClient) AppID() int64 {
func (c *SDKClient) AppID() uint64 {
return c.appID
}

Expand Down
2 changes: 1 addition & 1 deletion model/advertiser/advertisers_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
// AdvertisersRequest 广告罗盘请求信息
type AdvertisersRequest struct {
// AdvertiserID 广告主ID
AdvertiserID int64 `json:"advertiser_id,omitempty"`
AdvertiserID uint64 `json:"advertiser_id,omitempty"`
}

// Url implement GetRequest interface
Expand Down
4 changes: 2 additions & 2 deletions model/advertiser/budget_get_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
// BudgetGetRequest 账户日预算查询APIRequest
type BudgetGetRequest struct {
// AdvertiserID 广告主ID
AdvertiserID int64 `json:"advertiser_id,omitempty"`
AdvertiserID uint64 `json:"advertiser_id,omitempty"`
}

// Url implement GetRequest interface
Expand All @@ -19,6 +19,6 @@ func (r BudgetGetRequest) Url() string {
// Encode implement GetRequest interface
func (r BudgetGetRequest) Encode() string {
values := url.Values{}
values.Set("advertiser_id", strconv.FormatInt(r.AdvertiserID, 10))
values.Set("advertiser_id", strconv.FormatUint(r.AdvertiserID, 10))
return values.Encode()
}
3 changes: 1 addition & 2 deletions model/advertiser/fund_daily_flows_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
// FundDailyFlowsRequest 广告主账号流水信息APIRequest
type FundDailyFlowsRequest struct {
// AdvertiserID 广告主ID
AdvertiserID int64 `json:"advertiser_id,omitempty"`
AdvertiserID uint64 `json:"advertiser_id,omitempty"`
// StartDate 开始日期
StartDate string `json:"start_date,omitempty"`
// EndDate 结束日期
Expand All @@ -23,7 +23,6 @@ func (r FundDailyFlowsRequest) Url() string {
return "v1/advertiser/fund/daily_flows"
}

// Encode implement GetRequest interface
// Encode implement GetRequest interface
func (r FundDailyFlowsRequest) Encode() []byte {
buf, _ := json.Marshal(r)
Expand Down
2 changes: 1 addition & 1 deletion model/advertiser/fund_get_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
// FundGetRequest 获取广告主账户余额APIRequest
type FundGetRequest struct {
// AdvertiserID 广告主ID
AdvertiserID int64 `json:"advertiser_id,omitempty"`
AdvertiserID uint64 `json:"advertiser_id,omitempty"`
}

// Url implement GetRequest interface
Expand Down
6 changes: 3 additions & 3 deletions model/advertiser/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ package advertiser
// Info 广告主信息
type Info struct {
// UserID 账户快手ID
UserID int64 `json:"user_id,omitempty"`
UserID uint64 `json:"user_id,omitempty"`
// CorporationName 公司名称
CorporationName string `json:"corporation_name,omitempty"`
// UserName 快手昵称
UserName string `json:"user_name,omitempty"`
// IndustryID 二级行业 id
IndustryID int64 `json:"industry_id,omitempty"`
IndustryID uint64 `json:"industry_id,omitempty"`
// IndustryName 二级行业名称
IndustryName string `json:"industry_name,omitempty"`
// PrimaryIndustryID 一级行业 id
PrimaryIndustryID int64 `json:"primary_industry_id,omitempty"`
PrimaryIndustryID uint64 `json:"primary_industry_id,omitempty"`
// PrimaryIndustryName 一级行业名称
PrimaryIndustryName string `json:"primary_industry_name,omitempty"`
}
6 changes: 4 additions & 2 deletions model/advertiser/info_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
// InfoRequest 获取广告主信息APIRequest
type InfoRequest struct {
// AdvertiserID 广告主ID
AdvertiserID int64 `json:"advertiser_id,omitempty"`
AdvertiserID uint64 `json:"advertiser_id,omitempty"`
}

// Url implement GetRequest interface
Expand All @@ -18,4 +18,6 @@ func (r InfoRequest) Url() string {
func (r InfoRequest) Encode() []byte {
ret, _ := json.Marshal(r)
return ret
}
}


2 changes: 1 addition & 1 deletion model/advertiser/update_budget_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "encoding/json"
// UpdateBudgetRequest 修改账户预算APIRequest
type UpdateBudgetRequest struct {
// AdvertiserID 广告主ID
AdvertiserID int64 `json:"advertiser_id,omitempty"`
AdvertiserID uint64 `json:"advertiser_id,omitempty"`
// DayBudget 单日预算 单位:厘,指定0表示预算不限,默认为0;每天不小于500元,不超过100000000元,仅支持输入数字;修改预算不得低于该账户当日花费的120%,与day_budget不能同时传
DayBudget int64 `json:"day_budget,omitempty"`
// DayBudgetSchedule 单日预算金额; 广告组单日预算金额,单位:厘,指定0表示预算不限,默认为0;不小于100元,不超过100000000元,仅支持输入数字;修改预算不得低于该广告组当日花费的120%
Expand Down
4 changes: 2 additions & 2 deletions model/advertiser/white_list_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
// WhiteListRequest 获取可选白名单接口 API Request
type WhiteListRequest struct {
// AdvertiserID 广告主id
AdvertiserID int64 `json:"advertiser_id,omitempty"`
AdvertiserID uint64 `json:"advertiser_id,omitempty"`
}

// Url implement PostRequest interface
Expand All @@ -19,6 +19,6 @@ func (r WhiteListRequest) Url() string {
// Encode implement PostRequest interface
func (r WhiteListRequest) Encode() string {
values := &url.Values{}
values.Set("advertiser_id", strconv.FormatInt(r.AdvertiserID, 10))
values.Set("advertiser_id", strconv.FormatUint(r.AdvertiserID, 10))
return values.Encode()
}
2 changes: 1 addition & 1 deletion model/asset/adv_card.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package asset
// AdvCard 高级创意
type AdvCard struct {
// AdvCardID 卡片 id
AdvCardID int64 `json:"adv_card_id,omitempty"`
AdvCardID uint64 `json:"adv_card_id,omitempty"`
// TemplateName 模版名
TemplateName string `json:"template_name,omitempty"`
// UnitCount 关联广告组数
Expand Down
2 changes: 1 addition & 1 deletion model/asset/adv_card_create_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "encoding/json"
// AdvCardCreateRequest 创建高级创意接口API Request
type AdvCardCreateRequest struct {
// AdvertiserID 广告主 id
AdvertiserID int64 `json:'advertiser_id,omitempty'`
AdvertiserID uint64 `json:"advertiser_id,omitempty"`
// AdvList 卡片
AdvList []AdvCard `json:"adv_list,omitempty"`
}
Expand Down
2 changes: 1 addition & 1 deletion model/asset/adv_card_create_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ package asset
// AdvCardCreateResponse 创建高级创意接口
type AdvCardCreateResponse struct {
// AdvList 卡片 id 数组
AdvList []int64 `json:"adv_list,omitempty"`
AdvList []uint64 `json:"adv_list,omitempty"`
}
2 changes: 1 addition & 1 deletion model/asset/adv_card_list_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "encoding/json"
// AdvCardListRequest 获取高级创意列表
type AdvCardListRequest struct {
// AdvertiserID 广告主 id
AdvertiserID int64 `json:"advertiser_id,omitempty"`
AdvertiserID uint64 `json:"advertiser_id,omitempty"`
// CardType 卡片类型; 100:图片卡片 101:多利益卡-图文 102:多利益卡-多标签 103:电商促销样式
CardType int `json:"card_type,omitempty"`
// Page 查询的页码数
Expand Down
4 changes: 2 additions & 2 deletions model/asset/adv_card_remove_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import "encoding/json"
// AdvCardRemoveRequest 删除高级创意接口
type AdvCardRemoveRequest struct {
// AdvertiserID 广告主 id
AdvertiserID int64 `json:"advertiser_id,omitempty"`
AdvertiserID uint64 `json:"advertiser_id,omitempty"`
// AdvCardID 卡片 id
AdvCardID int64 `json:"adv_card_id,omitempty"`
AdvCardID uint64 `json:"adv_card_id,omitempty"`
}

// Url implement PostRequest interface
Expand Down
Loading

0 comments on commit b392055

Please sign in to comment.