rank.go 943 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package http
  2. import (
  3. "go-common/app/admin/ep/melloi/model"
  4. bm "go-common/library/net/http/blademaster"
  5. "go-common/library/net/http/blademaster/binding"
  6. )
  7. func treesQuery(c *bm.Context) {
  8. c.JSON(srv.TreesQuery())
  9. }
  10. func treeNumQuery(c *bm.Context) {
  11. c.JSON(srv.TreeNumQuery())
  12. }
  13. func topHttpQuery(c *bm.Context) {
  14. c.JSON(srv.TopHttpQuery())
  15. }
  16. func topGrpcQuery(c *bm.Context) {
  17. c.JSON(srv.TopGrpcQuery())
  18. }
  19. func topSceneQuery(c *bm.Context) {
  20. c.JSON(srv.TopSceneQuery())
  21. }
  22. func topDeptQuery(c *bm.Context) {
  23. c.JSON(srv.TopDeptQuery())
  24. }
  25. func buildLineQuery(c *bm.Context) {
  26. rank := model.Rank{}
  27. summary := model.ReportSummary{}
  28. if err := c.BindWith(&rank, binding.Form); err != nil {
  29. c.JSON(nil, err)
  30. return
  31. }
  32. if err := c.BindWith(&summary, binding.Form); err != nil {
  33. c.JSON(nil, err)
  34. return
  35. }
  36. c.JSON(srv.BuildLineQuery(&rank, &summary))
  37. }
  38. func stateLineQuery(c *bm.Context) {
  39. c.JSON(srv.StateLineQuery())
  40. }