service/api/proto/media/proto/proto.go

78 lines
1.4 KiB
Go

package proto
import "service/api/base"
const (
MediaTypeImg = 1 // 图片
MediaTypeVideo = 2 // 视频
)
// 获取上传所需材料
type MediaAuthReq struct {
base.BaseRequest
Mtype int32 `json:"mtype"` // 媒体类型,见: MediaType*
}
type MediaAuthData struct {
PolicyToken *PolicyToken `json:"policy_token"`
}
type MediaAuthResp struct {
base.BaseResponse
Data *MediaAuthData `json:"data"`
}
type PolicyToken struct {
AccessKeyId string `json:"access_key_id"`
Host string `json:"host"`
Expire int64 `json:"expire"`
Signature string `json:"signature"`
Directory string `json:"directory"`
Policy string `json:"policy"`
Callback string `json:"callback"`
Filename string `json:"filename"`
}
// 上传媒体
type CUploadReq struct {
base.BaseRequest
Mtype int32 `json:"mtype"`
Item interface{} `json:"item"`
}
type CUploadData struct {
RetItem interface{} `json:"ret_item"`
}
type CUploadResp struct {
base.BaseResponse
Data *CUploadData `json:"data"`
}
// 查询
type ImageListReq struct {
base.BaseRequest
Ids []int64 `json:"ids"`
}
type ImageListData struct {
}
type ImageListResp struct {
base.BaseResponse
Data *ImageListData `json:"data"`
}
type VideoListReq struct {
base.BaseRequest
Ids []int64 `json:"ids"`
}
type VideoListData struct {
}
type VideoListResp struct {
base.BaseResponse
Data *VideoListData `json:"data"`
}