playerloginhandler.go 611 B

12345678910111213141516171819202122232425
  1. package handler
  2. import (
  3. "net/http"
  4. "ylink/bff/authbff/api/internal/logic"
  5. "ylink/bff/authbff/api/internal/svc"
  6. "ylink/bff/authbff/api/internal/types"
  7. "ylink/comm/result"
  8. "github.com/zeromicro/go-zero/rest/httpx"
  9. )
  10. func playerLoginHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
  11. return func(w http.ResponseWriter, r *http.Request) {
  12. var req types.PlayerAuthReq
  13. if err := httpx.Parse(r, &req); err != nil {
  14. result.ParamErrorResult(r, w, err)
  15. return
  16. }
  17. l := logic.NewPlayerLoginLogic(r.Context(), svcCtx)
  18. resp, err := l.PlayerLogin(&req)
  19. result.HttpResult(r, w, resp, err)
  20. }
  21. }