routes.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // Code generated by goctl. DO NOT EDIT.
  2. package handler
  3. import (
  4. "git.i2edu.net/i2/i2-bill-api/internal/handler/part_time_user"
  5. "net/http"
  6. auth "git.i2edu.net/i2/i2-bill-api/internal/handler/auth"
  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. Method: http.MethodPost,
  50. Path: "/api/v1/part_time_user/add",
  51. Handler: part_time_user.PartTimeUserAddHandler(serverCtx),
  52. },
  53. {
  54. Method: http.MethodPost,
  55. Path: "/api/v1/part_time_user/update",
  56. Handler: part_time_user.PartTimeUserUpdateHandler(serverCtx),
  57. },
  58. },
  59. rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret),
  60. )
  61. }