From ba2e64b62e8dde661dd87659707a4a9d0d6aa515 Mon Sep 17 00:00:00 2001 From: jojoliang Date: Fri, 11 Dec 2020 14:45:45 +0800 Subject: [PATCH] update ci --- ci.go | 19 +++++++++++-------- ci_doc.go | 9 +++++---- cos.go | 2 +- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/ci.go b/ci.go index ed1bc84..f69dd41 100644 --- a/ci.go +++ b/ci.go @@ -31,21 +31,23 @@ func EncodePicOperations(pic *PicOperations) string { } type ImageProcessResult struct { - XMLName xml.Name `xml:"UploadResult"` - OriginalInfo *PicOriginalInfo `xml:"OriginalInfo,omitempty"` - ProcessObject *PicProcessObject `xml:"ProcessResults>Object,omitempty"` + XMLName xml.Name `xml:"UploadResult"` + OriginalInfo *PicOriginalInfo `xml:"OriginalInfo,omitempty"` + ProcessResults *PicProcessObject `xml:"ProcessResults>Object,omitempty"` } type PicOriginalInfo struct { Key string `xml:"Key,omitempty"` Location string `xml:"Location,omitempty"` ImageInfo *PicImageInfo `xml:"ImageInfo,omitempty"` + ETag string `xml:"ETag,omitempty"` } type PicImageInfo struct { - Format string `xml:"Format,omitempty"` - Width int `xml:"Width,omitempty"` - Height int `xml:"Height,omitempty"` - Size int `xml:"Size,omitempty"` - Quality int `xml:"Quality,omitempty"` + Format string `xml:"Format,omitempty"` + Width int `xml:"Width,omitempty"` + Height int `xml:"Height,omitempty"` + Quality int `xml:"Quality,omitempty"` + Ave string `xml:"Ave,omitempty"` + Orientation int `xml:"Orientation,omitempty"` } type PicProcessObject struct { Key string `xml:"Key,omitempty"` @@ -55,6 +57,7 @@ type PicProcessObject struct { Height int `xml:"Height,omitempty"` Size int `xml:"Size,omitempty"` Quality int `xml:"Quality,omitempty"` + ETag string `xml:"ETag,omitempty"` WatermarkStatus int `xml:"WatermarkStatus,omitempty"` } diff --git a/ci_doc.go b/ci_doc.go index b6a571e..30b3214 100644 --- a/ci_doc.go +++ b/ci_doc.go @@ -261,10 +261,11 @@ type DocPreviewOptions struct { func (s *CIService) DocPreview(ctx context.Context, name string, opt *DocPreviewOptions) (*Response, error) { sendOpt := sendOptions{ - baseURL: s.client.BaseURL.BucketURL, - uri: "/" + encodeURIComponent(name) + "?ci-process=doc-preview", - optQuery: opt, - method: http.MethodGet, + baseURL: s.client.BaseURL.BucketURL, + uri: "/" + encodeURIComponent(name) + "?ci-process=doc-preview", + optQuery: opt, + method: http.MethodGet, + disableCloseBody: true, } resp, err := s.client.send(ctx, &sendOpt) return resp, err diff --git a/cos.go b/cos.go index d34018f..eb4d866 100644 --- a/cos.go +++ b/cos.go @@ -22,7 +22,7 @@ import ( const ( // Version current go sdk version - Version = "0.7.14" + Version = "0.7.15" userAgent = "cos-go-sdk-v5/" + Version contentTypeXML = "application/xml" defaultServiceBaseURL = "http://service.cos.myqcloud.com"