csfetchplayerqueuelogic.go 871 B

12345678910111213141516171819202122232425262728293031323334353637
  1. package logic
  2. import (
  3. "context"
  4. "ylink/core/cmd/rpc/cmd"
  5. "ylink/bff/cmdbff/api/internal/svc"
  6. "ylink/bff/cmdbff/api/internal/types"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type CsFetchPlayerQueueLogic struct {
  10. logx.Logger
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. }
  14. func NewCsFetchPlayerQueueLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CsFetchPlayerQueueLogic {
  15. return &CsFetchPlayerQueueLogic{
  16. Logger: logx.WithContext(ctx),
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. }
  20. }
  21. func (l *CsFetchPlayerQueueLogic) CsFetchPlayerQueue(req *types.CsFetchPlayerQueueReq) (resp *types.CsFetchPlayerQueueResp, err error) {
  22. cmdResp, err := l.svcCtx.CmdRpc.CsFetchPlayerQueue(l.ctx, &cmd.CsFetchPlayerQueueReq{
  23. Limit: req.Limit,
  24. })
  25. if err != nil {
  26. return nil, err
  27. }
  28. return &types.CsFetchPlayerQueueResp{
  29. List: cmdResp.List.AsSlice(),
  30. }, nil
  31. }