playerfetchcsinfologic.go 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package logic
  2. import (
  3. "context"
  4. "ylink/core/cmd/rpc/internal/svc"
  5. "ylink/core/cmd/rpc/pb"
  6. "ylink/core/inner/rpc/inner"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type PlayerFetchCsInfoLogic struct {
  10. ctx context.Context
  11. svcCtx *svc.ServiceContext
  12. logx.Logger
  13. }
  14. func NewPlayerFetchCsInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PlayerFetchCsInfoLogic {
  15. return &PlayerFetchCsInfoLogic{
  16. ctx: ctx,
  17. svcCtx: svcCtx,
  18. Logger: logx.WithContext(ctx),
  19. }
  20. }
  21. func (l *PlayerFetchCsInfoLogic) PlayerFetchCsInfo(in *pb.PlayerFetchCsInfoReq) (*pb.PlayerFetchCsInfoResp, error) {
  22. innerResp, err := l.svcCtx.InnerRpc.PlayerFetchCsInfo(l.ctx, &inner.InnerPlayerFetchCsInfoReq{
  23. PlayerId: in.PlayerId,
  24. GameId: in.GameId,
  25. CsId: in.CsId,
  26. })
  27. if err != nil {
  28. return nil, err
  29. }
  30. return &pb.PlayerFetchCsInfoResp{
  31. CsId: innerResp.CsId,
  32. CsNickname: innerResp.CsNickname,
  33. CsAvatarUrl: innerResp.CsAvatarUrl,
  34. CsSignature: innerResp.CsSignature,
  35. OnlineStatus: innerResp.OnlineStatus,
  36. }, nil
  37. }