routes.go 1.8 KB

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