| | |
| | | package controllers |
| | | |
| | | import ( |
| | | "basic.com/pubsub/protomsg.git" |
| | | "basic.com/valib/bhomeclient.git" |
| | | "encoding/json" |
| | | "github.com/satori/go.uuid" |
| | | "vamicro/system-service/models" |
| | | "vamicro/system-service/service" |
| | | |
| | | "basic.com/pubsub/protomsg.git" |
| | | "basic.com/valib/bhomeclient.git" |
| | | uuid "github.com/satori/go.uuid" |
| | | ) |
| | | |
| | | type VoiceController struct{} |
| | |
| | | audioPath, err := sv.UploadVoice(file.Bytes, filename) |
| | | if err != nil { |
| | | if err.Error() == "audio format error" { |
| | | return &bhomeclient.Reply{Msg: "声音只允许mp3,wav,wma的格式"} |
| | | return &bhomeclient.Reply{Msg: "声音只允许mp3,wav的格式"} |
| | | } else { |
| | | return &bhomeclient.Reply{Msg: "声音上传失败:" + err.Error()} |
| | | } |