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