-
Notifications
You must be signed in to change notification settings - Fork 44
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
5 changed files
with
93 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package aweme | ||
|
||
import ( | ||
"github.com/bububa/oceanengine/marketing-api/core" | ||
"github.com/bububa/oceanengine/marketing-api/model/qianchuan/aweme" | ||
) | ||
|
||
// OrderBudgetAdd 追加随心推订单预算 | ||
// 可以使用该接口进行投放中订单的续费和续期操作 | ||
func OrderBudgetAdd(clt *core.SDKClient, accessToken string, req *aweme.OrderBudgetAddRequest) error { | ||
return clt.Post("v1.0/qianchuan/aweme/order/budget/add/", req, nil, accessToken) | ||
} |
16 changes: 16 additions & 0 deletions
16
marketing-api/api/qianchuan/aweme/order_suggest_delivery_time_get.go
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,16 @@ | ||
package aweme | ||
|
||
import ( | ||
"github.com/bububa/oceanengine/marketing-api/core" | ||
"github.com/bububa/oceanengine/marketing-api/model/qianchuan/aweme" | ||
) | ||
|
||
// OrderSuggestDeliveryTimeGet 获取建议延长时长 | ||
// 在追加随心推订单预算时,支持该订单的获取建议投放时长 | ||
func OrderSuggestDeliveryTimeGet(clt *core.SDKClient, accessToken string, req *aweme.OrderSuggestDeliveryTimeGetRequest) (float64, error) { | ||
var resp aweme.OrderSuggestDeliveryTimeGetResponse | ||
if err := clt.Get("v1.0/qianchuan/aweme/order/suggest/delivery_time/get/", req, &resp, accessToken); err != nil { | ||
return 0, err | ||
} | ||
return resp.Data.SuggestDeliveryTime, 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
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,22 @@ | ||
package aweme | ||
|
||
import "github.com/bububa/oceanengine/marketing-api/util" | ||
|
||
// OrderBudgetAddRequest 追加随心推订单预算 API Request | ||
type OrderBudgetAddRequest struct { | ||
// AdvertiserID 广告主id | ||
AdvertiserID uint64 `json:"advertiser_id,omitempty"` | ||
// OrderID 需要追加预算的订单id | ||
OrderID uint64 `json:"order_id,omitempty"` | ||
// RenewalBudget 追加的预算 | ||
RenewalBudget float64 `json:"renewal_budget,omitempty"` | ||
// RenewvalDeliverySeconds 延长的投放时间 | ||
// 短视频订单,0-7天(步进单位为1天) | ||
// 直播订单,0-24小时(步进单位为0.5小时) | ||
RenewvalDeliverySeconds float64 `json:"renewval_delivery_seconds,omitempty"` | ||
} | ||
|
||
// Encode implement PostRequest interface | ||
func (r OrderBudgetAddRequest) Encode() []byte { | ||
return util.JSONMarshal(r) | ||
} |
40 changes: 40 additions & 0 deletions
40
marketing-api/model/qianchuan/aweme/order_suggest_delivery_time_get.go
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,40 @@ | ||
package aweme | ||
|
||
import ( | ||
"strconv" | ||
|
||
"github.com/bububa/oceanengine/marketing-api/model" | ||
"github.com/bububa/oceanengine/marketing-api/util" | ||
) | ||
|
||
// OrderSuggestDeliveryTimeGetRequest 获取建议延长时长 API Request | ||
type OrderSuggestDeliveryTimeGetRequest struct { | ||
// AdvertiserID 广告主id | ||
AdvertiserID uint64 `json:"advertiser_id,omitempty"` | ||
// OrderID 需要追加预算的订单id | ||
OrderID uint64 `json:"order_id,omitempty"` | ||
// AddAmount 追加的预算 | ||
AddAmount float64 `json:"add_amount,omitempty"` | ||
} | ||
|
||
// Encode implement GetRequest interface | ||
func (r OrderSuggestDeliveryTimeGetRequest) Encode() string { | ||
values := util.GetUrlValues() | ||
values.Set("advertiser_id", strconv.FormatUint(r.AdvertiserID, 10)) | ||
values.Set("order_id", strconv.FormatUint(r.OrderID, 10)) | ||
values.Set("add_amount", strconv.FormatFloat(r.AddAmount, 'f', -1, 64)) | ||
ret := values.Encode() | ||
util.PutUrlValues(values) | ||
return ret | ||
} | ||
|
||
// OrderSuggestDeliveryTimeGetResponse 获取建议延长时长 API Response | ||
type OrderSuggestDeliveryTimeGetResponse struct { | ||
model.BaseResponse | ||
Data struct { | ||
// SuggestDeliveryTime 建议追加投放时长 | ||
// 短视频:xx天 | ||
// 直播:xx小时 | ||
SuggestDeliveryTime float64 `json:"suggest_delivery_time,omitempty"` | ||
} `json:"data,omitempty"` | ||
} |