|
|
|
@ -2,12 +2,29 @@ package controller
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"encoding/json"
|
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
|
"github.com/gorilla/websocket"
|
|
|
|
|
"github.com/taoshihan1991/imaptool/models"
|
|
|
|
|
"github.com/taoshihan1991/imaptool/tools"
|
|
|
|
|
"log"
|
|
|
|
|
"net/http"
|
|
|
|
|
"time"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func GetNotice(c *gin.Context) {
|
|
|
|
|
kefuId:=c.Query("kefu_id")
|
|
|
|
|
user:=models.FindUser(kefuId)
|
|
|
|
|
info:=make(map[string]interface{})
|
|
|
|
|
info["nickname"]=user.Nickname
|
|
|
|
|
info["avator"]=user.Avator
|
|
|
|
|
info["name"]=user.Name
|
|
|
|
|
info["content"]="欢迎您!有什么我能帮助您的?"
|
|
|
|
|
info["time"]=time.Now().String()
|
|
|
|
|
c.JSON(200, gin.H{
|
|
|
|
|
"code": 200,
|
|
|
|
|
"msg": "ok",
|
|
|
|
|
"result":info,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
var upgrader = websocket.Upgrader{}
|
|
|
|
|
var oldFolders map[string]int
|
|
|
|
|
|
|
|
|
|