routes.go 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret),
  51. )
  52. engine.AddRoutes(
  53. []rest.Route{
  54. {
  55. Method: http.MethodPost,
  56. Path: "/api/v1/part_time_user/add",
  57. Handler: part_time_user.PartTimeUserAddHandler(serverCtx),
  58. },
  59. {
  60. Method: http.MethodPost,
  61. Path: "/api/v1/part_time_user/update",
  62. Handler: part_time_user.PartTimeUserUpdateHandler(serverCtx),
  63. },
  64. },
  65. rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret),
  66. )
  67. engine.AddRoutes(
  68. []rest.Route{
  69. {
  70. Method: http.MethodPost,
  71. Path: "/api/acquirer/enroll",
  72. Handler: acquirer.EnrollHandler(serverCtx),
  73. },
  74. },
  75. rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret),
  76. )
  77. }