38 lines
789 B
Go
38 lines
789 B
Go
|
package oss
|
||
|
|
||
|
import (
|
||
|
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||
|
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
||
|
)
|
||
|
|
||
|
type PutOssRequest struct {
|
||
|
*requests.StreamRequest
|
||
|
BucketName string `position:"Query" field:"bucket_name" default:"image"`
|
||
|
FileStream []byte
|
||
|
}
|
||
|
|
||
|
type PutOssResponse struct {
|
||
|
*responses.BaseResponse
|
||
|
Code int `json:"code"`
|
||
|
Msg string `json:"msg"`
|
||
|
Data struct {
|
||
|
Url string `json:"url"`
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func CreatePutOssRequest() (req *PutOssRequest) {
|
||
|
req = &PutOssRequest{
|
||
|
StreamRequest: &requests.StreamRequest{},
|
||
|
}
|
||
|
|
||
|
req.InitWithApiInfo(HOST, VERSION, "api/upload/put")
|
||
|
req.Method = requests.POST
|
||
|
return
|
||
|
}
|
||
|
|
||
|
func CreatePutOssResponse() (resp *PutOssResponse) {
|
||
|
return &PutOssResponse{
|
||
|
BaseResponse: &responses.BaseResponse{},
|
||
|
}
|
||
|
}
|