50 lines
902 B
Go
50 lines
902 B
Go
package request
|
|
|
|
import (
|
|
"errors"
|
|
)
|
|
|
|
// 上传音乐
|
|
type UploadMusicRequest struct {
|
|
AccessToken string
|
|
MusicName string // 音乐名称
|
|
Singer string // 演唱者
|
|
Size string //
|
|
Long string //
|
|
TypeCode string //1=原唱 2=伴奏
|
|
MusicUrl string // 音乐Key audio/+uuid
|
|
PersistId string
|
|
AvInfo string
|
|
}
|
|
|
|
// 参数合法性检验
|
|
func (request *UploadMusicRequest) CheckParameter() (err error) {
|
|
|
|
if len(request.AccessToken) == 0 {
|
|
err = errors.New("AccessToken不能为空")
|
|
return
|
|
}
|
|
|
|
if len(request.MusicName) == 0 {
|
|
err = errors.New("MusicName不能为空")
|
|
return
|
|
}
|
|
|
|
if len(request.Singer) == 0 {
|
|
err = errors.New("Singer不能为空")
|
|
return
|
|
}
|
|
|
|
if len(request.TypeCode) == 0 {
|
|
err = errors.New("TypeCode不能为空")
|
|
return
|
|
}
|
|
|
|
if len(request.MusicUrl) == 0 {
|
|
err = errors.New("MusicUrl不能为空")
|
|
return
|
|
}
|
|
|
|
return
|
|
}
|