update ci
This commit is contained in:
@@ -97,10 +97,10 @@ Object API:
|
|||||||
|
|
||||||
数据处理 API:
|
数据处理 API:
|
||||||
|
|
||||||
* [x] 媒体处理(使用示例:[media_process.go](./example/media_process/media_process.go))
|
* [x] 媒体处理(使用示例:[media_process.go](./example/CI/media_process/media_process.go))
|
||||||
* [x] 文档处理(使用示例:[ci_doc_process.go](./example/doc_process/ci_doc_process.go))
|
* [x] 文档处理(使用示例:[ci_doc_process.go](./example/CI/doc_process/ci_doc_process.go))
|
||||||
|
|
||||||
|
|
||||||
内容审核 API:
|
内容审核 API:
|
||||||
|
|
||||||
* [x] 视频审核(使用示例:[ci_video_auditing_job.go](./example/content_auditing/ci_video_auditing_job.go))
|
* [x] 视频审核(使用示例:[ci_video_auditing_job.go](./example/CI/content_auditing/ci_video_auditing_job.go))
|
||||||
|
|||||||
189
ci_media.go
189
ci_media.go
@@ -10,7 +10,7 @@ type JobInput struct {
|
|||||||
Object string `xml:"Object,omitempty"`
|
Object string `xml:"Object,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type JobOutput struct {
|
type JobOutput struct {
|
||||||
Region string `xml:"Region,omitempty"`
|
Region string `xml:"Region,omitempty"`
|
||||||
Bucket string `xml:"Bucket,omitempty"`
|
Bucket string `xml:"Bucket,omitempty"`
|
||||||
Object string `xml:"Object,omitempty"`
|
Object string `xml:"Object,omitempty"`
|
||||||
@@ -21,114 +21,113 @@ type Container struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Video struct {
|
type Video struct {
|
||||||
Codec string `xml:"Codec"`
|
Codec string `xml:"Codec"`
|
||||||
Width string `xml:"Width"`
|
Width string `xml:"Width"`
|
||||||
Height string `xml:"Height"`
|
Height string `xml:"Height"`
|
||||||
Fps string `xml:"Fps"`
|
Fps string `xml:"Fps"`
|
||||||
Remove string `xml:"Remove"`
|
Remove string `xml:"Remove"`
|
||||||
Profile string `xml:"Profile"`
|
Profile string `xml:"Profile"`
|
||||||
Bitrate string `xml:"Bitrate"`
|
Bitrate string `xml:"Bitrate"`
|
||||||
Crf string `xml:"Crf"`
|
Crf string `xml:"Crf"`
|
||||||
Gop string `xml:"Gop"`
|
Gop string `xml:"Gop"`
|
||||||
Preset string `xml:"Preset"`
|
Preset string `xml:"Preset"`
|
||||||
Bufsize string `xml:"Bufsize"`
|
Bufsize string `xml:"Bufsize"`
|
||||||
Maxrate string `xml:"Maxrate"`
|
Maxrate string `xml:"Maxrate"`
|
||||||
HlsTsTime string `xml:"HlsTsTime"`
|
HlsTsTime string `xml:"HlsTsTime"`
|
||||||
Pixfmt string `xml:"Pixfmt"`
|
Pixfmt string `xml:"Pixfmt"`
|
||||||
LongShortMode string `xml:"LongShortMode"`
|
LongShortMode string `xml:"LongShortMode"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type TimeInterval struct {
|
type TimeInterval struct {
|
||||||
Start string `xml:"Start"`
|
Start string `xml:"Start"`
|
||||||
Duration string `xml:"Duration"`
|
Duration string `xml:"Duration"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Audio struct {
|
type Audio struct {
|
||||||
Codec string `xml:"Codec"`
|
Codec string `xml:"Codec"`
|
||||||
Samplerate string `xml:"Samplerate"`
|
Samplerate string `xml:"Samplerate"`
|
||||||
Bitrate string `xml:"Bitrate"`
|
Bitrate string `xml:"Bitrate"`
|
||||||
Channels string `xml:"Channels"`
|
Channels string `xml:"Channels"`
|
||||||
Remove string `xml:"Remove"`
|
Remove string `xml:"Remove"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type TransConfig struct {
|
type TransConfig struct {
|
||||||
AdjDarMethod string `xml:"AdjDarMethod"`
|
AdjDarMethod string `xml:"AdjDarMethod"`
|
||||||
IsCheckReso string `xml:"IsCheckReso"`
|
IsCheckReso string `xml:"IsCheckReso"`
|
||||||
ResoAdjMethod string `xml:"ResoAdjMethod"`
|
ResoAdjMethod string `xml:"ResoAdjMethod"`
|
||||||
IsCheckVideoBitrate string `xml:"IsCheckVideoBitrate"`
|
IsCheckVideoBitrate string `xml:"IsCheckVideoBitrate"`
|
||||||
VideoBitrateAdjMethod string `xml:"VideoBitrateAdjMethod"`
|
VideoBitrateAdjMethod string `xml:"VideoBitrateAdjMethod"`
|
||||||
IsCheckAudioBitrate string `xml:"IsCheckAudioBitrate"`
|
IsCheckAudioBitrate string `xml:"IsCheckAudioBitrate"`
|
||||||
AudioBitrateAdjMethod string `xml:"AudioBitrateAdjMethod"`
|
AudioBitrateAdjMethod string `xml:"AudioBitrateAdjMethod"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Transcode struct {
|
type Transcode struct {
|
||||||
Container *Container `xml:"Container,omitempty"`
|
Container *Container `xml:"Container,omitempty"`
|
||||||
Video *Video `xml:"Video,omitempty"`
|
Video *Video `xml:"Video,omitempty"`
|
||||||
TimeInterval *TimeInterval `xml:"TimeInterval,omitempty"`
|
TimeInterval *TimeInterval `xml:"TimeInterval,omitempty"`
|
||||||
Audio *Audio `xml:"Audio,omitempty"`
|
Audio *Audio `xml:"Audio,omitempty"`
|
||||||
TransConfig *TransConfig `xml:"TransConfig,omitempty"`
|
TransConfig *TransConfig `xml:"TransConfig,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Image struct {
|
type Image struct {
|
||||||
Url string `xml:"Url,omitempty"`
|
Url string `xml:"Url,omitempty"`
|
||||||
Mode string `xml:"Mode,omitempty"`
|
Mode string `xml:"Mode,omitempty"`
|
||||||
Width string `xml:"Width,omitempty"`
|
Width string `xml:"Width,omitempty"`
|
||||||
Height string `xml:"Height,omitempty"`
|
Height string `xml:"Height,omitempty"`
|
||||||
Transparency string `xml:"Transparency,omitempty"`
|
Transparency string `xml:"Transparency,omitempty"`
|
||||||
Background string `xml:"Background,omitempty"`
|
Background string `xml:"Background,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
type Text struct {
|
type Text struct {
|
||||||
FontSize string `xml:"FontSize,omitempty"`
|
FontSize string `xml:"FontSize,omitempty"`
|
||||||
FontType string `xml:"FontType,omitempty"`
|
FontType string `xml:"FontType,omitempty"`
|
||||||
FontColor string `xml:"FontColor,omitempty"`
|
FontColor string `xml:"FontColor,omitempty"`
|
||||||
Transparency string `xml:"Transparency,omitempty"`
|
Transparency string `xml:"Transparency,omitempty"`
|
||||||
Text string `xml:"Text,omitempty"`
|
Text string `xml:"Text,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Watermark struct {
|
type Watermark struct {
|
||||||
Type string `xml:"Type,omitempty"`
|
Type string `xml:"Type,omitempty"`
|
||||||
Pos string `xml:"Pos,omitempty"`
|
Pos string `xml:"Pos,omitempty"`
|
||||||
LocMode string `xml:"LocMode,omitempty"`
|
LocMode string `xml:"LocMode,omitempty"`
|
||||||
Dx string `xml:"Dx,omitempty"`
|
Dx string `xml:"Dx,omitempty"`
|
||||||
Dy string `xml:"Dy,omitempty"`
|
Dy string `xml:"Dy,omitempty"`
|
||||||
StartTime string `xml:"StartTime,omitempty"`
|
StartTime string `xml:"StartTime,omitempty"`
|
||||||
EndTime string `xml:"EndTime,omitempty"`
|
EndTime string `xml:"EndTime,omitempty"`
|
||||||
Image *Image `xml:"Image,omitempty"`
|
Image *Image `xml:"Image,omitempty"`
|
||||||
Text *Text `xml:"Text,omitempty"`
|
Text *Text `xml:"Text,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MediaProcessJobOperation struct {
|
type MediaProcessJobOperation struct {
|
||||||
Output *JobOutput `xml:"Output,omitempty"`
|
Output *JobOutput `xml:"Output,omitempty"`
|
||||||
Transcode *Transcode `xml:"Transcode,omitempty"`
|
Transcode *Transcode `xml:"Transcode,omitempty"`
|
||||||
Watermark *Watermark `xml:"Watermark,omitempty"`
|
Watermark *Watermark `xml:"Watermark,omitempty"`
|
||||||
TemplateId string `xml:"TemplateId,omitempty"`
|
TemplateId string `xml:"TemplateId,omitempty"`
|
||||||
WatermarkTemplateId []string `xml:"WatermarkTemplateId,omitempty"`
|
WatermarkTemplateId []string `xml:"WatermarkTemplateId,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateMediaJobsOptions struct {
|
type CreateMediaJobsOptions struct {
|
||||||
XMLName xml.Name `xml:"Request"`
|
XMLName xml.Name `xml:"Request"`
|
||||||
Tag string `xml:"Tag,omitempty"`
|
Tag string `xml:"Tag,omitempty"`
|
||||||
Input *JobInput `xml:"Input,omitempty"`
|
Input *JobInput `xml:"Input,omitempty"`
|
||||||
Operation *MediaProcessJobOperation `xml:"Operation,omitempty"`
|
Operation *MediaProcessJobOperation `xml:"Operation,omitempty"`
|
||||||
QueueId string `xml:"QueueId,omitempty"`
|
QueueId string `xml:"QueueId,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MediaProcessJobDetail struct {
|
type MediaProcessJobDetail struct {
|
||||||
Code string `xml:"Code,omitempty"`
|
Code string `xml:"Code,omitempty"`
|
||||||
Message string `xml:"Message,omitempty"`
|
Message string `xml:"Message,omitempty"`
|
||||||
JobId string `xml:"JobId,omitempty"`
|
JobId string `xml:"JobId,omitempty"`
|
||||||
Tag string `xml:"Tag,omitempty"`
|
Tag string `xml:"Tag,omitempty"`
|
||||||
State string `xml:"State,omitempty"`
|
State string `xml:"State,omitempty"`
|
||||||
CreationTime string `xml:"CreationTime,omitempty"`
|
CreationTime string `xml:"CreationTime,omitempty"`
|
||||||
QueueId string `xml:"QueueId,omitempty"`
|
QueueId string `xml:"QueueId,omitempty"`
|
||||||
Input *JobInput `xml:"Input,omitempty"`
|
Input *JobInput `xml:"Input,omitempty"`
|
||||||
Operation *MediaProcessJobOperation `xml:"Operation,omitempty"`
|
Operation *MediaProcessJobOperation `xml:"Operation,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateMediaJobsResult struct {
|
type CreateMediaJobsResult struct {
|
||||||
XMLName xml.Name `xml:"Response"`
|
XMLName xml.Name `xml:"Response"`
|
||||||
JobsDetail MediaProcessJobDetail `xml:"JobsDetail,omitempty"`
|
JobsDetail MediaProcessJobDetail `xml:"JobsDetail,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -143,12 +142,12 @@ func (s *CIService) CreateMediaJobs(ctx context.Context, opt *CreateMediaJobsOpt
|
|||||||
}
|
}
|
||||||
resp, err := s.client.send(ctx, &sendOpt)
|
resp, err := s.client.send(ctx, &sendOpt)
|
||||||
return &res, resp, err
|
return &res, resp, err
|
||||||
}
|
}
|
||||||
|
|
||||||
type DescribeMediaProcessJobResult struct {
|
type DescribeMediaProcessJobResult struct {
|
||||||
XMLName xml.Name `xml:"Response"`
|
XMLName xml.Name `xml:"Response"`
|
||||||
JobsDetail *MediaProcessJobDetail `xml:"JobsDetail,omitempty"`
|
JobsDetail *MediaProcessJobDetail `xml:"JobsDetail,omitempty"`
|
||||||
NonExistJobIds string `xml:"NonExistJobIds,omitempty"`
|
NonExistJobIds string `xml:"NonExistJobIds,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *CIService) DescribeMediaJobs(ctx context.Context, jobid string) (*DescribeMediaProcessJobResult, *Response, error) {
|
func (s *CIService) DescribeMediaJobs(ctx context.Context, jobid string) (*DescribeMediaProcessJobResult, *Response, error) {
|
||||||
@@ -201,23 +200,23 @@ type DescribeMediaProcessQueuesOptions struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type DescribeMediaProcessQueuesResult struct {
|
type DescribeMediaProcessQueuesResult struct {
|
||||||
XMLName xml.Name `xml:"Response"`
|
XMLName xml.Name `xml:"Response"`
|
||||||
RequestId string `xml:"RequestId,omitempty"`
|
RequestId string `xml:"RequestId,omitempty"`
|
||||||
TotalCount int `xml:"TotalCount,omitempty"`
|
TotalCount int `xml:"TotalCount,omitempty"`
|
||||||
PageNumber int `xml:"PageNumber,omitempty"`
|
PageNumber int `xml:"PageNumber,omitempty"`
|
||||||
PageSize int `xml:"PageSize,omitempty"`
|
PageSize int `xml:"PageSize,omitempty"`
|
||||||
QueueList []MediaProcessQueue `xml:"QueueList,omitempty"`
|
QueueList []MediaProcessQueue `xml:"QueueList,omitempty"`
|
||||||
NonExistPIDs []string `xml:"NonExistPIDs,omitempty"`
|
NonExistPIDs []string `xml:"NonExistPIDs,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MediaProcessQueue struct {
|
type MediaProcessQueue struct {
|
||||||
QueueId string `xml:"QueueId,omitempty"`
|
QueueId string `xml:"QueueId,omitempty"`
|
||||||
Name string `xml:"Name,omitempty"`
|
Name string `xml:"Name,omitempty"`
|
||||||
State string `xml:"State,omitempty"`
|
State string `xml:"State,omitempty"`
|
||||||
MaxSize int `xml:"MaxSize,omitempty"`
|
MaxSize int `xml:"MaxSize,omitempty"`
|
||||||
MaxConcurrent int `xml:"MaxConcurrent,omitempty"`
|
MaxConcurrent int `xml:"MaxConcurrent,omitempty"`
|
||||||
UpdateTime string `xml:"UpdateTime,omitempty"`
|
UpdateTime string `xml:"UpdateTime,omitempty"`
|
||||||
CreateTime string `xml:"CreateTime,omitempty"`
|
CreateTime string `xml:"CreateTime,omitempty"`
|
||||||
NotifyConfig *MediaProcessQueueNotifyConfig `xml:"NotifyConfig,omitempty"`
|
NotifyConfig *MediaProcessQueueNotifyConfig `xml:"NotifyConfig,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -242,16 +241,16 @@ func (s *CIService) DescribeMediaProcessQueues(ctx context.Context, opt *Describ
|
|||||||
}
|
}
|
||||||
|
|
||||||
type UpdateMediaProcessQueueOptions struct {
|
type UpdateMediaProcessQueueOptions struct {
|
||||||
XMLName xml.Name `xml:"Request"`
|
XMLName xml.Name `xml:"Request"`
|
||||||
Name string `xml:"Name,omitempty"`
|
Name string `xml:"Name,omitempty"`
|
||||||
QueueID string `xml:"QueueID,omitempty"`
|
QueueID string `xml:"QueueID,omitempty"`
|
||||||
State string `xml:"State,omitempty"`
|
State string `xml:"State,omitempty"`
|
||||||
NotifyConfig *MediaProcessQueueNotifyConfig `xml:"NotifyConfig,omitempty"`
|
NotifyConfig *MediaProcessQueueNotifyConfig `xml:"NotifyConfig,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateMediaProcessQueueResult struct {
|
type UpdateMediaProcessQueueResult struct {
|
||||||
XMLName xml.Name `xml:"Response"`
|
XMLName xml.Name `xml:"Response"`
|
||||||
RequestId string `xml:"RequestId"`
|
RequestId string `xml:"RequestId"`
|
||||||
Queue *MediaProcessQueue `xml:"Queue"`
|
Queue *MediaProcessQueue `xml:"Queue"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -277,17 +276,17 @@ type DescribeMediaProcessBucketsOptions struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type DescribeMediaProcessBucketsResult struct {
|
type DescribeMediaProcessBucketsResult struct {
|
||||||
XMLName xml.Name `xml:"Response"`
|
XMLName xml.Name `xml:"Response"`
|
||||||
RequestId string `xml:"RequestId,omitempty"`
|
RequestId string `xml:"RequestId,omitempty"`
|
||||||
TotalCount int `xml:"TotalCount,omitempty"`
|
TotalCount int `xml:"TotalCount,omitempty"`
|
||||||
PageNumber int `xml:"PageNumber,omitempty"`
|
PageNumber int `xml:"PageNumber,omitempty"`
|
||||||
PageSize int `xml:"PageSize,omitempty"`
|
PageSize int `xml:"PageSize,omitempty"`
|
||||||
MediaBucketList []MediaProcessBucket `xml:"MediaBucketList,omitempty"`
|
MediaBucketList []MediaProcessBucket `xml:"MediaBucketList,omitempty"`
|
||||||
}
|
}
|
||||||
type MediaProcessBucket struct {
|
type MediaProcessBucket struct {
|
||||||
BucketId string `xml:"BucketId,omitempty"`
|
BucketId string `xml:"BucketId,omitempty"`
|
||||||
Region string `xml:"Region,omitempty"`
|
Region string `xml:"Region,omitempty"`
|
||||||
CreateTime string `xml:"CreateTime,omitempty"`
|
CreateTime string `xml:"CreateTime,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *CIService) DescribeMediaProcessBuckets(ctx context.Context, opt *DescribeMediaProcessBucketsOptions) (*DescribeMediaProcessBucketsResult, *Response, error) {
|
func (s *CIService) DescribeMediaProcessBuckets(ctx context.Context, opt *DescribeMediaProcessBucketsOptions) (*DescribeMediaProcessBucketsResult, *Response, error) {
|
||||||
@@ -301,4 +300,4 @@ func (s *CIService) DescribeMediaProcessBuckets(ctx context.Context, opt *Descri
|
|||||||
}
|
}
|
||||||
resp, err := s.client.send(ctx, &sendOpt)
|
resp, err := s.client.send(ctx, &sendOpt)
|
||||||
return &res, resp, err
|
return &res, resp, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ func main() {
|
|||||||
Codec: "AAC",
|
Codec: "AAC",
|
||||||
},
|
},
|
||||||
TimeInterval: &cos.TimeInterval{
|
TimeInterval: &cos.TimeInterval{
|
||||||
Start: "10",
|
Start: "10",
|
||||||
Duration: "",
|
Duration: "",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -95,4 +95,4 @@ func main() {
|
|||||||
DescribeJobRes, _, err := c.CI.DescribeMediaJobs(context.Background(), createJobRes.JobsDetail.JobId)
|
DescribeJobRes, _, err := c.CI.DescribeMediaJobs(context.Background(), createJobRes.JobsDetail.JobId)
|
||||||
log_status(err)
|
log_status(err)
|
||||||
fmt.Printf("%+v\n", DescribeJobRes.JobsDetail)
|
fmt.Printf("%+v\n", DescribeJobRes.JobsDetail)
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user