-
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
19 changed files
with
574 additions
and
3 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 file 本地推素材管理相关 | ||
package file |
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,19 @@ | ||
package file | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/bububa/oceanengine/marketing-api/core" | ||
"github.com/bububa/oceanengine/marketing-api/model/local/file" | ||
) | ||
|
||
// UploadTaskCreate 异步上传本地推视频 | ||
// 将视频文件通过连山云素材服务上传后获取到视频文件链接,再将获取到的连山云视频文件url作为入参的video_url通过素材库提供的视频上传接口进行文件上传 | ||
// 仅支持开发者购置连山云素材服务上传生成的tos链接上传,不支持其他三方链接地址 | ||
func UploadTaskCreate(ctx context.Context, clt *core.SDKClient, accessToken string, req *file.UploadTaskCreateRequest) (uint64, error) { | ||
var resp file.UploadTaskCreateResponse | ||
if err := clt.PostAPI(ctx, "v3.0/local/file/upload_task/create/", req, &resp, accessToken); err != nil { | ||
return 0, err | ||
} | ||
return resp.Data.TaskID, 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,17 @@ | ||
package file | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/bububa/oceanengine/marketing-api/core" | ||
"github.com/bububa/oceanengine/marketing-api/model/local/file" | ||
) | ||
|
||
// VideoAwemeGet 获取素材库视频 | ||
func VideoAwemeGet(ctx context.Context, clt *core.SDKClient, accessToken string, req *file.VideoAwemeGetRequest) (*file.VideoAwemeGetResult, error) { | ||
var resp file.VideoAwemeGetResponse | ||
if err := clt.GetAPI(ctx, "v3.0/local/file/video/aweme/get/", req, &resp, accessToken); 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package file | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/bububa/oceanengine/marketing-api/core" | ||
"github.com/bububa/oceanengine/marketing-api/model/local/file" | ||
) | ||
|
||
// VideoGet 获取素材库视频 | ||
func VideoGet(ctx context.Context, clt *core.SDKClient, accessToken string, req *file.VideoGetRequest) (*file.VideoGetResult, error) { | ||
var resp file.VideoGetResponse | ||
if err := clt.GetAPI(ctx, "v3.0/local/file/video/get/", req, &resp, accessToken); 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package file | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/bububa/oceanengine/marketing-api/core" | ||
"github.com/bububa/oceanengine/marketing-api/model/local/file" | ||
) | ||
|
||
// VideoUpload 上传视频 | ||
func VideoUpload(ctx context.Context, clt *core.SDKClient, accessToken string, req *file.VideoUploadRequest) (*file.Video, error) { | ||
var resp file.VideoUploadResponse | ||
if err := clt.Upload(ctx, "v3.0/local/file/video/upload/", req, &resp, accessToken); 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package file | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/bububa/oceanengine/marketing-api/core" | ||
"github.com/bububa/oceanengine/marketing-api/model/local/file" | ||
) | ||
|
||
// VideoUploadTaskList 查询异步上传本地推视频结果 | ||
func VideoUploadTaskList(ctx context.Context, clt *core.SDKClient, accessToken string, req *file.VideoUploadTaskListRequest) ([]file.UploadTask, error) { | ||
var resp file.VideoUploadTaskListResponse | ||
if err := clt.GetAPI(ctx, "v3.0/local/file/video/upload_task/list/", req, &resp, accessToken); err != nil { | ||
return nil, err | ||
} | ||
return resp.Data.List, 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,13 @@ | ||
package local | ||
|
||
// MaterialAnalysisType 评估类型 | ||
type MaterialAnalysisType string | ||
|
||
const ( | ||
// MaterialAnalysisType_FIRST_PUBLISH 首发 | ||
MaterialAnalysisType_FIRST_PUBLISH MaterialAnalysisType = "FIRST_PUBLISH" | ||
// MaterialAnalysisType_FIRST_PUBLISH_AND_HIGH_QUALITY 首发&优质 | ||
MaterialAnalysisType_FIRST_PUBLISH_AND_HIGH_QUALITY MaterialAnalysisType = "FIRST_PUBLISH_AND_HIGH_QUALITY" | ||
// MaterialAnalysisType_HIGH_QUALITY 优质 | ||
MaterialAnalysisType_HIGH_QUALITY MaterialAnalysisType = "HIGH_QUALITY" | ||
) |
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,17 @@ | ||
package local | ||
|
||
// MaterialSource 素材来源 | ||
type MaterialSource string | ||
|
||
const ( | ||
// MaterialSource_BP_PLATFORM 巨量引擎工作平台共享视频 | ||
MaterialSource_BP_PLATFORM MaterialSource = "BP_PLATFORM" | ||
// MaterialSource_CREATIVE_AIGC 即创 | ||
MaterialSource_CREATIVE_AIGC MaterialSource = "CREATIVE_AIGC" | ||
// MaterialSource_LOCAL_ADS_UPLOAD 本地上传 | ||
MaterialSource_LOCAL_ADS_UPLOAD MaterialSource = "LOCAL_ADS_UPLOAD" | ||
// MaterialSource_STAR 星图平台 | ||
MaterialSource_STAR MaterialSource = "STAR" | ||
// MaterialSource_MAPI MAPI上传 | ||
MaterialSource_MAPI MaterialSource = "MAPI" | ||
) |
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,13 @@ | ||
package local | ||
|
||
// UploadTaskStatus 任务处理状态 | ||
type UploadTaskStatus string | ||
|
||
const ( | ||
// UploadTaskStatus_PROCESS 处理中 | ||
UploadTaskStatus_PROCESS UploadTaskStatus = "PROCESS" | ||
// UploadTaskStatus_SUCCESS 成功 | ||
UploadTaskStatus_SUCCESS UploadTaskStatus = "SUCCESS" | ||
// UploadTaskStatus_FAILED 失败 | ||
UploadTaskStatus_FAILED UploadTaskStatus = "FAILED" | ||
) |
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 file 本地推素材管理相关 | ||
package file |
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 file | ||
|
||
import ( | ||
"github.com/bububa/oceanengine/marketing-api/model" | ||
"github.com/bububa/oceanengine/marketing-api/util" | ||
) | ||
|
||
// UploadTaskCreateRequest 异步上传本地推视频 API Request | ||
type UploadTaskCreateRequest struct { | ||
// LocalAccountID 本地推账户id | ||
LocalAccountID uint64 `json:"local_account_id,omitempty"` | ||
// Filename 素材的文件名 | ||
Filename string `json:"filename,omitempty"` | ||
// VideoURL 视频 url地址,最大支持上传文件大小:1000M | ||
// 仅支持开发者购置连山云素材服务上传生成的tos链接上传,不支持其他三方链接地址,具体见接入指南 | ||
VideoURL string `json:"video_url,omitempty"` | ||
} | ||
|
||
// Encode implements PostRequest interface | ||
func (r UploadTaskCreateRequest) Encode() []byte { | ||
return util.JSONMarshal(r) | ||
} | ||
|
||
// UploadTaskCreateResponse 异步上传本地推视频 API Response | ||
type UploadTaskCreateResponse struct { | ||
model.BaseResponse | ||
Data struct { | ||
// TaskID 本地推任务id | ||
TaskID uint64 `json:"task_id,omitempty"` | ||
} `json:"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,81 @@ | ||
package file | ||
|
||
import "github.com/bububa/oceanengine/marketing-api/enum/local" | ||
|
||
// Video 视频信息 | ||
type Video struct { | ||
// VideoID 视频id | ||
VideoID string `json:"video_id,omitempty"` | ||
// MaterialID 素材id | ||
MaterialID uint64 `json:"material_id,omitempty"` | ||
// Size 视频大小 | ||
Size int64 `json:"size,omitempty"` | ||
// VideoSiganture 视频md5 | ||
VideoSiganture string `json:"video_siganture,omitempty"` | ||
// Width 视频宽 | ||
Width int64 `json:"width,omitempty"` | ||
// Height 视频高 | ||
Height int64 `json:"height,omitempty"` | ||
// VideoURL 视频地址 | ||
VideoURL string `json:"video_url,omitempty"` | ||
// Duration 视频时长 | ||
Duration float64 `json:"duration,omitempty"` | ||
// VideoName 视频名称 | ||
VideoName string `json:"video_name,omitempty"` | ||
// PosterURL 视频首帧截图 | ||
PosterURL string `json:"poster_url,omitempty"` | ||
// MaterialProperties 素材标签,枚举值: | ||
// COPY 搬运风险 | ||
// FIRST_PUBLISH 首发 | ||
// HIGH_QUALITY 优质 | ||
// LOW_QUALITY 低质 | ||
// SIMILAR 同质化风险 | ||
MaterialProperties []string `json:"material_properties,omitempty"` | ||
// ImageMode 视频类型,枚举值: | ||
// IMAGE_MODE_VIDEO 横版视频 | ||
// IMAGE_MODE_VIDEO_VERTICAL 竖版视频 | ||
ImageMode local.ImageMode `json:"image_mode,omitempty"` | ||
// Source 视频来源,枚举值: | ||
// BP_PLATFORM 巨量引擎工作平台共享视频 | ||
// CREATIVE_AIGC 即创 | ||
// LOCAL_ADS_UPLOAD 本地上传 | ||
// STAR 星图平台 | ||
// MAPI MAPI接口上传 | ||
Source local.MaterialSource `json:"source,omitempty"` | ||
// CreateTime 素材的上传时间,格式:yyyy-mm-dd HH:mm:ss | ||
CreateTime string `json:"create_time,omitempty"` | ||
} | ||
|
||
// VideoAweme 抖音视频 | ||
type VideoAweme struct { | ||
// ItemID 抖音视频ID | ||
ItemID uint64 `json:"item_id,omitempty"` | ||
// Title 视频标题 | ||
Title string `json:"title,omitempty"` | ||
// VideoID 视频ID | ||
VideoID string `json:"video_id,omitempty"` | ||
// AwemeID 抖音号ID | ||
AwemeID string `json:"aweme_id,omitempty"` | ||
// ImageMode 视频类型,枚举值: | ||
// IMAGE_MODE_VIDEO 横版视频 | ||
// IMAGE_MODE_VIDEO_VERTICAL 竖版视频 | ||
ImageMode local.ImageMode `json:"image_mode,omitempty"` | ||
// CoverImageURL 视频封面图片地址 | ||
CoverImageURL string `json:"cover_image_url,omitempty"` | ||
// AwemeVideoURL 视频播放地址 | ||
AwemeVideoURL string `json:"aweme_video_url,omitempty"` | ||
// NotDeliveryReason 不可投放原因 | ||
NotDeliveryReason string `json:"not_delivery_reason,omitempty"` | ||
// CanDelivery 视频是否可投放 | ||
// true 可投放 | ||
// false 不可投放 | ||
CanDelivery bool `json:"can_delivery,omitempty"` | ||
// LegoMaterialID 素材id | ||
LegoMaterialID uint64 `json:"lego_material_id,omitempty"` | ||
// VideoWidth 视频宽度 | ||
VideoWidth int64 `json:"video_width,omitempty"` | ||
// VideoHeight 视频高度 | ||
VideoHeight int64 `json:"video_height,omitempty"` | ||
// Duration 视频时长 | ||
Duration string `json:"duration,omitempty"` | ||
} |
Oops, something went wrong.