routes.go 866 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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/svc"
  6. "github.com/tal-tech/go-zero/rest"
  7. )
  8. func RegisterHandlers(engine *rest.Server, serverCtx *svc.ServiceContext) {
  9. engine.AddRoutes(
  10. []rest.Route{
  11. {
  12. Method: http.MethodGet,
  13. Path: "/api/hello",
  14. Handler: HelloHandler(serverCtx),
  15. },
  16. {
  17. Method: http.MethodPost,
  18. Path: "/api/auth/loginByWeixin",
  19. Handler: LoginByWeixinHandler(serverCtx),
  20. },
  21. },
  22. )
  23. engine.AddRoutes(
  24. []rest.Route{
  25. {
  26. Method: http.MethodGet,
  27. Path: "/api/users/id/:userId",
  28. Handler: GetUserHandler(serverCtx),
  29. },
  30. {
  31. Method: http.MethodPost,
  32. Path: "/api/v1/part_time_user/add",
  33. Handler: PartTimeUserAdHandler(serverCtx),
  34. },
  35. },
  36. rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret),
  37. )
  38. }