|
|
|
@ -36,13 +36,17 @@ func GetStatistics(c *gin.Context) {
|
|
|
|
|
visitors := models.CountVisitors()
|
|
|
|
|
message := models.CountMessage()
|
|
|
|
|
session := len(ws.ClientList)
|
|
|
|
|
kefuNum := 0
|
|
|
|
|
for _, kefus := range ws.KefuList {
|
|
|
|
|
kefuNum += len(kefus)
|
|
|
|
|
}
|
|
|
|
|
c.JSON(200, gin.H{
|
|
|
|
|
"code": 200,
|
|
|
|
|
"msg": "ok",
|
|
|
|
|
"result": gin.H{
|
|
|
|
|
"visitors": visitors,
|
|
|
|
|
"message": message,
|
|
|
|
|
"session": session,
|
|
|
|
|
"session": session + kefuNum,
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|