Skip to content

Commit

Permalink
Merge branch 'release/v1.2.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
bububa committed Jun 13, 2022
2 parents beb7a8d + 2c3dc81 commit 2c9b04d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
3 changes: 1 addition & 2 deletions api/advertiser/budget_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ func BudgetGet(clt *core.SDKClient, accessToken string, advertiserID uint64) (*a
AdvertiserID: advertiserID,
}
var resp advertiser.Budget
err := clt.Get(accessToken, req, &resp)
if err != nil {
if err := clt.Post(accessToken, req, &resp); err != nil {
return nil, err
}
return &resp, nil
Expand Down
14 changes: 5 additions & 9 deletions model/advertiser/budget_get_request.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package advertiser

import (
"net/url"
"strconv"
)
import "encoding/json"

// BudgetGetRequest 账户日预算查询APIRequest
type BudgetGetRequest struct {
Expand All @@ -16,9 +13,8 @@ func (r BudgetGetRequest) Url() string {
return "v1/advertiser/budget/get"
}

// Encode implement GetRequest interface
func (r BudgetGetRequest) Encode() string {
values := url.Values{}
values.Set("advertiser_id", strconv.FormatUint(r.AdvertiserID, 10))
return values.Encode()
// Encode implement PostRequest interface
func (r BudgetGetRequest) Encode() []byte {
bs, _ := json.Marshal(r)
return bs
}

0 comments on commit 2c9b04d

Please sign in to comment.