Skip to content

Commit

Permalink
向前兼容
Browse files Browse the repository at this point in the history
  • Loading branch information
lilang authored and jojoliang committed Nov 22, 2022
1 parent b6a81ed commit 929ab55
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -1888,7 +1888,19 @@ type GoodsMattingptions struct {
}

// GoodsMatting 商品抠图
func (s *CIService) GoodsMatting(ctx context.Context, key string, opt *GoodsMattingptions) (*Response, error) {
func (s *CIService) GoodsMatting(ctx context.Context, key string) (*Response, error) {
sendOpt := sendOptions{
baseURL: s.client.BaseURL.BucketURL,
uri: "/" + encodeURIComponent(key) + "?ci-process=GoodsMatting",
method: http.MethodGet,
disableCloseBody: true,
}
resp, err := s.client.send(ctx, &sendOpt)
return resp, err
}

// GoodsMattingWithOpt 商品抠图
func (s *CIService) GoodsMattingWithOpt(ctx context.Context, key string, opt *GoodsMattingptions) (*Response, error) {
sendOpt := sendOptions{
baseURL: s.client.BaseURL.BucketURL,
uri: "/" + encodeURIComponent(key) + "?ci-process=GoodsMatting",
Expand Down
2 changes: 1 addition & 1 deletion example/CI/ai_recognition/goods_matting.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func goodsMattingWhenDownload() {
CenterLayout: "1",
PaddingLayout: "500x500",
}
resp, err := c.CI.GoodsMatting(context.Background(), key, opt)
resp, err := c.CI.GoodsMattingWithOpt(context.Background(), key, opt)
log_status(err)
fd, _ := os.OpenFile(localPath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0660)
io.Copy(fd, resp.Body)
Expand Down

0 comments on commit 929ab55

Please sign in to comment.