kefu/wechathook/routers/kefu.go

23 lines
392 B
Go

package routers
import (
"github.com/gin-gonic/gin"
"log"
"strings"
)
func PostKefuCallback(c *gin.Context) {
visitorId := c.PostForm("visitor_id")
content := c.PostForm("content")
log.Println(visitorId, content)
ids := strings.Split(visitorId, "|")
if len(ids) < 4 {
return
}
wxid := ids[3]
str, _ := SendWechat39825Msg(wxid, content)
c.JSON(200, gin.H{
"resp": str,
})
}