commit.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 queryProjectCommit(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.QueryProjectCommit(c, req))
  22. }
  23. // @params TeamDataRequest
  24. // @router get /ep/admin/saga/v1/data/commit/report
  25. // @response TeamDataResp
  26. func queryTeamCommit(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.QueryTeamCommit(c, req))
  39. }
  40. // @params CommitRequest
  41. // @router get /ep/admin/saga/v1/data/commit
  42. // @response CommitResp
  43. func queryCommit(c *bm.Context) {
  44. var (
  45. req = &model.CommitRequest{}
  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.QueryCommit(c, req))
  56. }