-
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
6 changed files
with
71 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,16 @@ | ||
package creative | ||
|
||
import ( | ||
"github.com/bububa/oceanengine/marketing-api/core" | ||
"github.com/bububa/oceanengine/marketing-api/model/creative" | ||
) | ||
|
||
// DetailGet 创意详细信息(新) | ||
func DetailGet(clt *core.SDKClient, accessToken string, req *creative.DetailGetRequest) (*creative.CreativeDetailV2, error) { | ||
var resp creative.DetailGetResponse | ||
err := clt.Get("v3.0/creative/detail/get/", req, &resp, accessToken) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return resp.Data, 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
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 creative | ||
|
||
// CreativeDetailV2 创意详情 (新) | ||
type CreativeDetailV2 struct { | ||
// AdvertiserID 广告主ID | ||
AdvertiserID uint64 `json:"advertiser_id,omitempty"` | ||
// AdID 广告计划ID,计划ID要属于广告主ID,且非删除计划,否则会报错 | ||
AdID uint64 `json:"ad_id,omitempty"` | ||
// CreativeList 自定义素材信息 | ||
CreativeList []CreativeInfo `json:"creative_list,omitempty"` | ||
// Creative 程序化素材信息,投放位置和创意类型决定素材规格。 | ||
Creative *CreativeInfo `json:"creative,omitempty"` | ||
// AdData 广告计划数据 | ||
AdData *AdData `json:"ad_data,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,31 @@ | ||
package creative | ||
|
||
import ( | ||
"net/url" | ||
"strconv" | ||
|
||
"github.com/bububa/oceanengine/marketing-api/model" | ||
) | ||
|
||
// DetailGetRequest 创意详细信息(新)API Request | ||
type DetailGetRequest struct { | ||
// AdvertiserID 广告主ID | ||
AdvertiserID uint64 `json:"advertiser_id,omitempty"` | ||
// AdID 计划ID | ||
AdID uint64 `json:"ad_id,omitempty"` | ||
} | ||
|
||
// Encode implement GetRequest interface | ||
func (r DetailGetRequest) Encode() string { | ||
values := &url.Values{} | ||
values.Set("advertiser_id", strconv.FormatUint(r.AdvertiserID, 10)) | ||
values.Set("ad_id", strconv.FormatUint(r.AdID, 10)) | ||
return values.Encode() | ||
} | ||
|
||
// DetailGetResponse 创意详细信息(新)API Response | ||
type DetailGetResponse struct { | ||
model.BaseResponse | ||
// Data json返回值 | ||
Data *CreativeDetailV2 `json:"data,omitempty"` | ||
} |