|
|
|
@ -55,26 +55,26 @@ func (MessageApi) SetOptions(options map[string]bool, value bool) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m MessageApi) newUserSendMsgReq(c *gin.Context, params *apistruct.SendMsg) *msg.SendMsgReq {
|
|
|
|
|
var newContent string
|
|
|
|
|
var newContent interface{}
|
|
|
|
|
var err error
|
|
|
|
|
options := make(map[string]bool, 5)
|
|
|
|
|
switch params.ContentType {
|
|
|
|
|
case constant.Text:
|
|
|
|
|
newContent = params.Content["text"].(string)
|
|
|
|
|
case constant.Picture:
|
|
|
|
|
fallthrough
|
|
|
|
|
newContent = params.Content["picture"].(map[string]interface{})
|
|
|
|
|
case constant.Custom:
|
|
|
|
|
fallthrough
|
|
|
|
|
newContent = params.Content["custom"].(map[string]interface{})
|
|
|
|
|
case constant.Voice:
|
|
|
|
|
fallthrough
|
|
|
|
|
newContent = params.Content["voice"].(map[string]interface{})
|
|
|
|
|
case constant.Video:
|
|
|
|
|
fallthrough
|
|
|
|
|
newContent = params.Content["video"].(map[string]interface{})
|
|
|
|
|
case constant.File:
|
|
|
|
|
fallthrough
|
|
|
|
|
newContent = params.Content["file"].(map[string]interface{})
|
|
|
|
|
case constant.CustomNotTriggerConversation:
|
|
|
|
|
fallthrough
|
|
|
|
|
newContent = params.Content["customNotTriggerConversation"].(map[string]interface{})
|
|
|
|
|
case constant.CustomOnlineOnly:
|
|
|
|
|
fallthrough
|
|
|
|
|
newContent = params.Content["customOnlineOnly"].(map[string]interface{})
|
|
|
|
|
default:
|
|
|
|
|
newContent = utils.StructToJsonString(params.Content)
|
|
|
|
|
}
|
|
|
|
|