You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
732 B
31 lines
732 B
package http |
|
|
|
import bm "go-common/library/net/http/blademaster" |
|
|
|
func onlineTop(c *bm.Context) { |
|
v := new(struct { |
|
Business string `form:"business" validate:"required"` |
|
Num int `form:"num" validate:"required"` |
|
}) |
|
if err := c.Bind(v); err != nil { |
|
return |
|
} |
|
c.JSON(srv.OnlineTop(c, v.Business, v.Num)) |
|
} |
|
|
|
func onlineRoom(c *bm.Context) { |
|
v := new(struct { |
|
Business string `form:"business" validate:"required"` |
|
Rooms []string `form:"rooms" validate:"required"` |
|
}) |
|
if err := c.Bind(v); err != nil { |
|
return |
|
} |
|
c.JSON(srv.OnlineRoom(c, v.Business, v.Rooms)) |
|
} |
|
|
|
func onlineTotal(c *bm.Context) { |
|
res := make(map[string]int64) |
|
res["ip_count"], res["conn_count"] = srv.OnlineTotal(c) |
|
c.JSON(res, nil) |
|
}
|
|
|