修改:1、服务信息查看地址 2、ZBus对象结构新加入客户端连接编号属性

This commit is contained in:
2023-10-21 08:56:58 +08:00
parent f7360c45d8
commit 4fc7121b28
3 changed files with 31 additions and 21 deletions

View File

@@ -6,6 +6,8 @@ import (
"zhub/internal/zbus"
)
var r = gin.Default()
func init() {
// 1.日志文件 定期分割归档
@@ -13,18 +15,14 @@ func init() {
func StartWatch() {
r := gin.Default()
r.Group("/users")
r.GET("/", func(c *gin.Context) {
c.File("./public/index.html")
})
r.GET("/info", func(c *gin.Context) {
r.GET("/_/info", func(c *gin.Context) {
c.JSON(http.StatusOK, zbus.Info())
})
r.GET("/cleanup", func(c *gin.Context) {
r.GET("/_/cleanup", func(c *gin.Context) {
zbus.Bus.Clearup()
c.JSON(http.StatusOK, "+OK")
})