|
|
|
@ -155,7 +155,7 @@ func SendMessageV2(c *gin.Context) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
models.CreateMessage(kefuInfo.Name, vistorInfo.VisitorId, content, cType)
|
|
|
|
|
var msg TypeMessage
|
|
|
|
|
//var msg TypeMessage
|
|
|
|
|
if cType == "kefu" {
|
|
|
|
|
guest, ok := ws.ClientList[vistorInfo.VisitorId]
|
|
|
|
|
|
|
|
|
@ -191,20 +191,21 @@ func SendMessageV2(c *gin.Context) {
|
|
|
|
|
// })
|
|
|
|
|
// return
|
|
|
|
|
//}
|
|
|
|
|
msg = TypeMessage{
|
|
|
|
|
Type: "message",
|
|
|
|
|
Data: ws.ClientMessage{
|
|
|
|
|
Avator: vistorInfo.Avator,
|
|
|
|
|
Id: vistorInfo.VisitorId,
|
|
|
|
|
Name: vistorInfo.Name,
|
|
|
|
|
ToId: kefuInfo.Name,
|
|
|
|
|
Content: content,
|
|
|
|
|
Time: time.Now().Format("2006-01-02 15:04:05"),
|
|
|
|
|
IsKefu: "no",
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
str, _ := json.Marshal(msg)
|
|
|
|
|
ws.OneKefuMessage(kefuInfo.Name, str)
|
|
|
|
|
//msg = TypeMessage{
|
|
|
|
|
// Type: "message",
|
|
|
|
|
// Data: ws.ClientMessage{
|
|
|
|
|
// Avator: vistorInfo.Avator,
|
|
|
|
|
// Id: vistorInfo.VisitorId,
|
|
|
|
|
// Name: vistorInfo.Name,
|
|
|
|
|
// ToId: kefuInfo.Name,
|
|
|
|
|
// Content: content,
|
|
|
|
|
// Time: time.Now().Format("2006-01-02 15:04:05"),
|
|
|
|
|
// IsKefu: "no",
|
|
|
|
|
// },
|
|
|
|
|
//}
|
|
|
|
|
//str, _ := json.Marshal(msg)
|
|
|
|
|
//ws.OneKefuMessage(kefuInfo.Name, str)
|
|
|
|
|
ws.KefuMessage(vistorInfo.VisitorId, content, kefuInfo)
|
|
|
|
|
go ws.SendServerJiang(vistorInfo.Name+"说", content, c.Request.Host)
|
|
|
|
|
go SendAppGetuiPush(kefuInfo.Name, vistorInfo.Name, content)
|
|
|
|
|
kefus, ok := ws.KefuList[kefuInfo.Name]
|
|
|
|
@ -214,9 +215,8 @@ func SendMessageV2(c *gin.Context) {
|
|
|
|
|
}
|
|
|
|
|
go ws.VisitorAutoReply(vistorInfo, kefuInfo, content)
|
|
|
|
|
c.JSON(200, gin.H{
|
|
|
|
|
"code": 200,
|
|
|
|
|
"msg": "ok",
|
|
|
|
|
"result": msg,
|
|
|
|
|
"code": 200,
|
|
|
|
|
"msg": "ok",
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|