routes.go 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. // Code generated by goctl. DO NOT EDIT.
  2. package handler
  3. import (
  4. "net/http"
  5. cscmd "ylink/bff/apibff/api/internal/handler/cs/cmd"
  6. cslogin "ylink/bff/apibff/api/internal/handler/cs/login"
  7. playercmd "ylink/bff/apibff/api/internal/handler/player/cmd"
  8. playerlogin "ylink/bff/apibff/api/internal/handler/player/login"
  9. "ylink/bff/apibff/api/internal/svc"
  10. "github.com/zeromicro/go-zero/rest"
  11. )
  12. func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
  13. server.AddRoutes(
  14. []rest.Route{
  15. {
  16. Method: http.MethodPost,
  17. Path: "/player/login",
  18. Handler: playerlogin.PlayerLoginHandler(serverCtx),
  19. },
  20. },
  21. rest.WithPrefix("/api/v1"),
  22. )
  23. server.AddRoutes(
  24. []rest.Route{
  25. {
  26. Method: http.MethodPost,
  27. Path: "/player/send",
  28. Handler: playercmd.PlayerSendHandler(serverCtx),
  29. },
  30. {
  31. Method: http.MethodPost,
  32. Path: "/player/logout",
  33. Handler: playercmd.PlayerLogoutHandler(serverCtx),
  34. },
  35. },
  36. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  37. rest.WithPrefix("/api/v1"),
  38. )
  39. server.AddRoutes(
  40. []rest.Route{
  41. {
  42. Method: http.MethodPost,
  43. Path: "/cs/login",
  44. Handler: cslogin.CsLoginHandler(serverCtx),
  45. },
  46. },
  47. rest.WithPrefix("/api/v1"),
  48. )
  49. server.AddRoutes(
  50. []rest.Route{
  51. {
  52. Method: http.MethodPost,
  53. Path: "/cs/fetch_queue",
  54. Handler: cscmd.CsFetchQueueHandler(serverCtx),
  55. },
  56. {
  57. Method: http.MethodPost,
  58. Path: "/cs/connect",
  59. Handler: cscmd.CsConnectHandler(serverCtx),
  60. },
  61. {
  62. Method: http.MethodPost,
  63. Path: "/cs/send",
  64. Handler: cscmd.CsSendHandler(serverCtx),
  65. },
  66. {
  67. Method: http.MethodPost,
  68. Path: "/cs/disconnect",
  69. Handler: cscmd.CsDisconnectHandler(serverCtx),
  70. },
  71. {
  72. Method: http.MethodPost,
  73. Path: "/cs/logout",
  74. Handler: cscmd.CsLogoutHandler(serverCtx),
  75. },
  76. },
  77. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  78. rest.WithPrefix("/api/v1"),
  79. )
  80. }