routes.go 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // Code generated by goctl. DO NOT EDIT.
  2. package handler
  3. import (
  4. "net/http"
  5. acquirer "git.i2edu.net/i2/i2-bill-api/internal/handler/acquirer"
  6. auth "git.i2edu.net/i2/i2-bill-api/internal/handler/auth"
  7. part_time_user "git.i2edu.net/i2/i2-bill-api/internal/handler/part_time_user"
  8. user "git.i2edu.net/i2/i2-bill-api/internal/handler/user"
  9. "git.i2edu.net/i2/i2-bill-api/internal/svc"
  10. "git.i2edu.net/i2/go-zero/rest"
  11. )
  12. func RegisterHandlers(engine *rest.Server, serverCtx *svc.ServiceContext) {
  13. engine.AddRoutes(
  14. []rest.Route{
  15. {
  16. Method: http.MethodGet,
  17. Path: "/api/hello",
  18. Handler: auth.HelloHandler(serverCtx),
  19. },
  20. {
  21. Method: http.MethodPost,
  22. Path: "/api/auth/loginByWeixin",
  23. Handler: auth.LoginByWeixinHandler(serverCtx),
  24. },
  25. },
  26. )
  27. engine.AddRoutes(
  28. []rest.Route{
  29. {
  30. Method: http.MethodGet,
  31. Path: "/api/user/share/jzQrcode",
  32. Handler: user.JzQrCodeHandler(serverCtx),
  33. },
  34. {
  35. Method: http.MethodPost,
  36. Path: "/api/user/bindMobile",
  37. Handler: user.BindMobileHandler(serverCtx),
  38. },
  39. {
  40. Method: http.MethodGet,
  41. Path: "/api/user/info",
  42. Handler: user.GetUserHandler(serverCtx),
  43. },
  44. {
  45. Method: http.MethodPost,
  46. Path: "/api/user/punchClock",
  47. Handler: user.PunchClockHandler(serverCtx),
  48. },
  49. {
  50. Method: http.MethodPost,
  51. Path: "/api/v1/part_time_user/add",
  52. Handler: part_time_user.PartTimeUserAddHandler(serverCtx),
  53. },
  54. {
  55. Method: http.MethodPost,
  56. Path: "/api/v1/part_time_user/update",
  57. Handler: part_time_user.PartTimeUserUpdateHandler(serverCtx),
  58. },
  59. },
  60. rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret),
  61. )
  62. engine.AddRoutes(
  63. []rest.Route{
  64. {
  65. Method: http.MethodPost,
  66. Path: "/api/acquirer/enroll",
  67. Handler: acquirer.EnrollHandler(serverCtx),
  68. },
  69. },
  70. rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret),
  71. )
  72. }