routes.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Code generated by goctl. DO NOT EDIT.
  2. package handler
  3. import (
  4. "net/http"
  5. "git.i2edu.net/i2/i2-bill-api/internal/handler/auth"
  6. "git.i2edu.net/i2/i2-bill-api/internal/handler/user"
  7. "git.i2edu.net/i2/i2-bill-api/internal/svc"
  8. "git.i2edu.net/i2/go-zero/rest"
  9. )
  10. func RegisterHandlers(engine *rest.Server, serverCtx *svc.ServiceContext) {
  11. engine.AddRoutes(
  12. []rest.Route{
  13. {
  14. Method: http.MethodGet,
  15. Path: "/api/hello",
  16. Handler: auth.HelloHandler(serverCtx),
  17. },
  18. {
  19. Method: http.MethodPost,
  20. Path: "/api/auth/loginByWeixin",
  21. Handler: auth.LoginByWeixinHandler(serverCtx),
  22. },
  23. },
  24. )
  25. engine.AddRoutes(
  26. []rest.Route{
  27. {
  28. Method: http.MethodGet,
  29. Path: "/api/user/share/jzQrcode",
  30. Handler: user.JzQrCodeHandler(serverCtx),
  31. },
  32. {
  33. Method: http.MethodPost,
  34. Path: "/api/user/bindMobile",
  35. Handler: user.BindMobileHandler(serverCtx),
  36. },
  37. {
  38. Method: http.MethodGet,
  39. Path: "/api/user/info",
  40. Handler: user.GetUserHandler(serverCtx),
  41. },
  42. },
  43. rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret),
  44. )
  45. }