mr.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. package http
  2. import (
  3. "go-common/app/admin/ep/saga/model"
  4. bm "go-common/library/net/http/blademaster"
  5. )
  6. // @params ProjectDataReq
  7. // @router get /ep/admin/saga/v1/data/project/report
  8. // @response ProjectDataResp
  9. func queryProjectMr(c *bm.Context) {
  10. var (
  11. req = &model.ProjectDataReq{}
  12. err error
  13. )
  14. if err = c.Bind(req); err != nil {
  15. return
  16. }
  17. if req.Username, err = getUsername(c); err != nil {
  18. c.JSON(nil, err)
  19. return
  20. }
  21. c.JSON(srv.QueryProjectMr(c, req))
  22. }
  23. // @params TeamDataRequest
  24. // @router get /ep/admin/saga/v1/data/mr/report
  25. // @response TeamDataResp
  26. func queryTeamMr(c *bm.Context) {
  27. var (
  28. req = &model.TeamDataRequest{}
  29. err error
  30. )
  31. if err = c.Bind(req); err != nil {
  32. return
  33. }
  34. if req.Username, err = getUsername(c); err != nil {
  35. c.JSON(nil, err)
  36. return
  37. }
  38. c.JSON(srv.QueryTeamMr(c, req))
  39. }
  40. //@params ProjectMrReportReq
  41. //@router get /ep/admin/saga/v1/data/project/mr/report
  42. //@response ProjectMrReportResp
  43. func queryProjectMrReport(c *bm.Context) {
  44. var (
  45. req = &model.ProjectMrReportReq{}
  46. err error
  47. )
  48. if err = c.Bind(req); err != nil {
  49. return
  50. }
  51. if req.Username, err = getUsername(c); err != nil {
  52. c.JSON(nil, err)
  53. return
  54. }
  55. c.JSON(srv.QueryProjectMrReport(c, req))
  56. }