Browse Source

v0.0.1开发:
1)调整access token验签逻辑
2)cmdbff开发

#Suyghur 2 years ago
parent
commit
78df859e4c

+ 5 - 5
bff/cmdbff/api/desc/bean.api

@@ -42,7 +42,7 @@ type (
 
 type (
     CsFetchPlayerQueueReq {
-        Limit int `json:"limit"`
+        Limit int64 `json:"limit"`
     }
 
     CsFetchPlayerQueueResp {
@@ -55,8 +55,8 @@ type (
     }
 
     CsFetchHistoryChatReq {
-        Page int `json:"page"`
-        Limit int `json:"limit"`
+        Page int64 `json:"page"`
+        Limit int64 `json:"limit"`
     }
 
     CsFetchHistoryChatResp {
@@ -68,8 +68,8 @@ type (
     CsFetchHistoryMsgReq {
         PlayerId string `json:"player_id"`
         GameId string `json:"game_id"`
-        Page int `json:"page"`
-        Limit int `json:"limit"`
+        Page int64 `json:"page"`
+        Limit int64 `json:"limit"`
     }
 
     CsFetchHistoryMsgResp {

+ 11 - 3
bff/cmdbff/api/internal/logic/cs/connectplayerlogic.go

@@ -2,9 +2,10 @@ package cs
 
 import (
 	"context"
-
 	"ylink/bff/cmdbff/api/internal/svc"
 	"ylink/bff/cmdbff/api/internal/types"
+	"ylink/core/cmd/rpc/cmd"
+	"ylink/ext/ctxdata"
 
 	"github.com/zeromicro/go-zero/core/logx"
 )
@@ -24,7 +25,14 @@ func NewConnectPlayerLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Con
 }
 
 func (l *ConnectPlayerLogic) ConnectPlayer(req *types.CsConnectPlayerReq) error {
-	// todo: add your logic here and delete this line
-
+	csId := ctxdata.GetCsIdFromCtx(l.ctx)
+	_, err := l.svcCtx.CmdRpc.CsConnectPlayer(l.ctx, &cmd.CsConnectPlayerReq{
+		CsId:     csId,
+		PlayerId: req.PlayerId,
+		GameId:   req.GameId,
+	})
+	if err != nil {
+		return err
+	}
 	return nil
 }

+ 0 - 37
bff/cmdbff/api/internal/logic/cs/csconnectplayerlogic.go

@@ -1,37 +0,0 @@
-package cs
-
-import (
-	"context"
-	"ylink/core/cmd/rpc/pb"
-
-	"ylink/bff/cmdbff/api/internal/svc"
-	"ylink/bff/cmdbff/api/internal/types"
-
-	"github.com/zeromicro/go-zero/core/logx"
-)
-
-type CsConnectPlayerLogic struct {
-	logx.Logger
-	ctx    context.Context
-	svcCtx *svc.ServiceContext
-}
-
-func NewCsConnectPlayerLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CsConnectPlayerLogic {
-	return &CsConnectPlayerLogic{
-		Logger: logx.WithContext(ctx),
-		ctx:    ctx,
-		svcCtx: svcCtx,
-	}
-}
-
-func (l *CsConnectPlayerLogic) CsConnectPlayer(req *types.CsConnectPlayerReq) error {
-	_, err := l.svcCtx.CmdRpc.CsConnectPlayer(l.ctx, &pb.CsConnectPlayerReq{
-		PlayerId: req.PlayerId,
-		GameId:   req.GameId,
-		CsId:     "",
-	})
-	if err != nil {
-		return err
-	}
-	return nil
-}

+ 0 - 30
bff/cmdbff/api/internal/logic/cs/csfetchhistorylistlogic.go

@@ -1,30 +0,0 @@
-package cs
-
-import (
-	"context"
-
-	"ylink/bff/cmdbff/api/internal/svc"
-	"ylink/bff/cmdbff/api/internal/types"
-
-	"github.com/zeromicro/go-zero/core/logx"
-)
-
-type CsFetchHistoryListLogic struct {
-	logx.Logger
-	ctx    context.Context
-	svcCtx *svc.ServiceContext
-}
-
-func NewCsFetchHistoryListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CsFetchHistoryListLogic {
-	return &CsFetchHistoryListLogic{
-		Logger: logx.WithContext(ctx),
-		ctx:    ctx,
-		svcCtx: svcCtx,
-	}
-}
-
-func (l *CsFetchHistoryListLogic) CsFetchHistoryList(req *types.CsFetchHistoryChatReq) (resp *types.CsFetchHistoryChatResp, err error) {
-	// todo: add your logic here and delete this line
-
-	return
-}

+ 0 - 30
bff/cmdbff/api/internal/logic/cs/csfetchhistorymsglogic.go

@@ -1,30 +0,0 @@
-package cs
-
-import (
-	"context"
-
-	"ylink/bff/cmdbff/api/internal/svc"
-	"ylink/bff/cmdbff/api/internal/types"
-
-	"github.com/zeromicro/go-zero/core/logx"
-)
-
-type CsFetchHistoryMsgLogic struct {
-	logx.Logger
-	ctx    context.Context
-	svcCtx *svc.ServiceContext
-}
-
-func NewCsFetchHistoryMsgLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CsFetchHistoryMsgLogic {
-	return &CsFetchHistoryMsgLogic{
-		Logger: logx.WithContext(ctx),
-		ctx:    ctx,
-		svcCtx: svcCtx,
-	}
-}
-
-func (l *CsFetchHistoryMsgLogic) CsFetchHistoryMsg(req *types.CsFetchHistoryMsgReq) (resp *types.CsFetchHistoryMsgResp, err error) {
-	// todo: add your logic here and delete this line
-
-	return
-}

+ 0 - 30
bff/cmdbff/api/internal/logic/cs/csfetchmsglogic.go

@@ -1,30 +0,0 @@
-package cs
-
-import (
-	"context"
-
-	"ylink/bff/cmdbff/api/internal/svc"
-	"ylink/bff/cmdbff/api/internal/types"
-
-	"github.com/zeromicro/go-zero/core/logx"
-)
-
-type CsFetchMsgLogic struct {
-	logx.Logger
-	ctx    context.Context
-	svcCtx *svc.ServiceContext
-}
-
-func NewCsFetchMsgLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CsFetchMsgLogic {
-	return &CsFetchMsgLogic{
-		Logger: logx.WithContext(ctx),
-		ctx:    ctx,
-		svcCtx: svcCtx,
-	}
-}
-
-func (l *CsFetchMsgLogic) CsFetchMsg(req *types.CsFetchMsgReq) (resp *types.CsFetchMsgResp, err error) {
-	// todo: add your logic here and delete this line
-
-	return
-}

+ 0 - 30
bff/cmdbff/api/internal/logic/cs/csfetchplayerqueuelogic.go

@@ -1,30 +0,0 @@
-package cs
-
-import (
-	"context"
-
-	"ylink/bff/cmdbff/api/internal/svc"
-	"ylink/bff/cmdbff/api/internal/types"
-
-	"github.com/zeromicro/go-zero/core/logx"
-)
-
-type CsFetchPlayerQueueLogic struct {
-	logx.Logger
-	ctx    context.Context
-	svcCtx *svc.ServiceContext
-}
-
-func NewCsFetchPlayerQueueLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CsFetchPlayerQueueLogic {
-	return &CsFetchPlayerQueueLogic{
-		Logger: logx.WithContext(ctx),
-		ctx:    ctx,
-		svcCtx: svcCtx,
-	}
-}
-
-func (l *CsFetchPlayerQueueLogic) CsFetchPlayerQueue(req *types.CsFetchPlayerQueueReq) (resp *types.CsFetchPlayerQueueResp, err error) {
-	// todo: add your logic here and delete this line
-
-	return
-}

+ 0 - 30
bff/cmdbff/api/internal/logic/cs/cssendmsglogic.go

@@ -1,30 +0,0 @@
-package cs
-
-import (
-	"context"
-
-	"ylink/bff/cmdbff/api/internal/svc"
-	"ylink/bff/cmdbff/api/internal/types"
-
-	"github.com/zeromicro/go-zero/core/logx"
-)
-
-type CsSendMsgLogic struct {
-	logx.Logger
-	ctx    context.Context
-	svcCtx *svc.ServiceContext
-}
-
-func NewCsSendMsgLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CsSendMsgLogic {
-	return &CsSendMsgLogic{
-		Logger: logx.WithContext(ctx),
-		ctx:    ctx,
-		svcCtx: svcCtx,
-	}
-}
-
-func (l *CsSendMsgLogic) CsSendMsg(req *types.CsSendMsgReq) error {
-	// todo: add your logic here and delete this line
-
-	return nil
-}

+ 16 - 3
bff/cmdbff/api/internal/logic/cs/fetchhistorylistlogic.go

@@ -2,6 +2,8 @@ package cs
 
 import (
 	"context"
+	"ylink/core/cmd/rpc/cmd"
+	"ylink/ext/ctxdata"
 
 	"ylink/bff/cmdbff/api/internal/svc"
 	"ylink/bff/cmdbff/api/internal/types"
@@ -24,7 +26,18 @@ func NewFetchHistoryListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *
 }
 
 func (l *FetchHistoryListLogic) FetchHistoryList(req *types.CsFetchHistoryChatReq) (resp *types.CsFetchHistoryChatResp, err error) {
-	// todo: add your logic here and delete this line
-
-	return
+	csId := ctxdata.GetCsIdFromCtx(l.ctx)
+	cmdResp, err := l.svcCtx.CmdRpc.CsFetchHistoryChat(l.ctx, &cmd.CsFetchHistoryChatReq{
+		CsId:  csId,
+		Page:  req.Page,
+		Limit: req.Limit,
+	})
+	if err != nil {
+		return nil, err
+	}
+	return &types.CsFetchHistoryChatResp{
+		TotalPage:   cmdResp.TotalPage,
+		CurrentPage: cmdResp.CurrentPage,
+		List:        cmdResp.List.AsSlice(),
+	}, nil
 }

+ 9 - 3
bff/cmdbff/api/internal/logic/player/disconnectlogic.go

@@ -2,6 +2,8 @@ package player
 
 import (
 	"context"
+	"ylink/core/cmd/rpc/cmd"
+	"ylink/ext/ctxdata"
 
 	"github.com/zeromicro/go-zero/core/logx"
 	"ylink/bff/cmdbff/api/internal/svc"
@@ -22,7 +24,11 @@ func NewDisconnectLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Discon
 }
 
 func (l *DisconnectLogic) Disconnect() error {
-	// todo: add your logic here and delete this line
-
-	return nil
+	playerId := ctxdata.GetPlayerIdFromCtx(l.ctx)
+	gameId := ctxdata.GetGameIdFromCtx(l.ctx)
+	_, err := l.svcCtx.CmdRpc.PlayerDisconnect(l.ctx, &cmd.PlayerDisconnectReq{
+		PlayerId: playerId,
+		GameId:   gameId,
+	})
+	return err
 }

+ 21 - 3
bff/cmdbff/api/internal/logic/player/fetchcsinfologic.go

@@ -2,6 +2,8 @@ package player
 
 import (
 	"context"
+	"ylink/core/cmd/rpc/cmd"
+	"ylink/ext/ctxdata"
 
 	"ylink/bff/cmdbff/api/internal/svc"
 	"ylink/bff/cmdbff/api/internal/types"
@@ -24,7 +26,23 @@ func NewFetchCsInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Fetch
 }
 
 func (l *FetchCsInfoLogic) FetchCsInfo(req *types.PlayerFetchCsInfoReq) (resp *types.PlayerFetchCsInfoResp, err error) {
-	// todo: add your logic here and delete this line
-
-	return
+	playerId := ctxdata.GetPlayerIdFromCtx(l.ctx)
+	gameId := ctxdata.GetGameIdFromCtx(l.ctx)
+	l.Logger.Infof("player id: %s", playerId)
+	cmdResp, err := l.svcCtx.CmdRpc.PlayerFetchCsInfo(l.ctx, &cmd.PlayerFetchCsInfoReq{
+		PlayerId: playerId,
+		GameId:   gameId,
+		CsId:     req.CsId,
+	})
+	if err != nil {
+		l.Logger.Info(err.Error())
+		return nil, err
+	}
+	return &types.PlayerFetchCsInfoResp{
+		CsId:         cmdResp.CsId,
+		CsNickname:   cmdResp.CsNickname,
+		CsAvatarUrl:  cmdResp.CsAvatarUrl,
+		CsSignature:  cmdResp.CsSignature,
+		OnlineStatus: cmdResp.OnlineStatus,
+	}, nil
 }

+ 18 - 3
bff/cmdbff/api/internal/logic/player/fetchhistorymsglogic.go

@@ -2,6 +2,8 @@ package player
 
 import (
 	"context"
+	"ylink/core/cmd/rpc/pb"
+	"ylink/ext/ctxdata"
 
 	"ylink/bff/cmdbff/api/internal/svc"
 	"ylink/bff/cmdbff/api/internal/types"
@@ -24,7 +26,20 @@ func NewFetchHistoryMsgLogic(ctx context.Context, svcCtx *svc.ServiceContext) *F
 }
 
 func (l *FetchHistoryMsgLogic) FetchHistoryMsg(req *types.PlayerFetchHistoryMsgReq) (resp *types.PlayerFetchHistoryMsgResp, err error) {
-	// todo: add your logic here and delete this line
-
-	return
+	playerId := ctxdata.GetPlayerIdFromCtx(l.ctx)
+	gameId := ctxdata.GetGameIdFromCtx(l.ctx)
+	cmdResp, err := l.svcCtx.CmdRpc.PlayerFetchHistoryMsg(l.ctx, &pb.PlayerFetchHistoryMsgReq{
+		PlayerId: playerId,
+		GameId:   gameId,
+		Page:     req.Page,
+		Limit:    req.Limit,
+	})
+	if err != nil {
+		return nil, err
+	}
+	return &types.PlayerFetchHistoryMsgResp{
+		TotalPage:   cmdResp.TotalPage,
+		CurrentPage: cmdResp.CurrentPage,
+		List:        cmdResp.List.AsSlice(),
+	}, nil
 }

+ 14 - 3
bff/cmdbff/api/internal/logic/player/fetchmsglogic.go

@@ -2,6 +2,8 @@ package player
 
 import (
 	"context"
+	"ylink/core/cmd/rpc/pb"
+	"ylink/ext/ctxdata"
 
 	"ylink/bff/cmdbff/api/internal/svc"
 	"ylink/bff/cmdbff/api/internal/types"
@@ -24,7 +26,16 @@ func NewFetchMsgLogic(ctx context.Context, svcCtx *svc.ServiceContext) *FetchMsg
 }
 
 func (l *FetchMsgLogic) FetchMsg() (resp *types.PlayerFetchMsgResp, err error) {
-	// todo: add your logic here and delete this line
-
-	return
+	playerId := ctxdata.GetGameIdFromCtx(l.ctx)
+	gameId := ctxdata.GetGameIdFromCtx(l.ctx)
+	cmdResp, err := l.svcCtx.CmdRpc.PlayerFetchMsg(l.ctx, &pb.PlayerFetchMsgReq{
+		PlayerId: playerId,
+		GameId:   gameId,
+	})
+	if err != nil {
+		return nil, err
+	}
+	return &types.PlayerFetchMsgResp{
+		List: cmdResp.List.AsSlice(),
+	}, nil
 }

+ 0 - 34
bff/cmdbff/api/internal/logic/player/playerdisconnectlogic.go

@@ -1,34 +0,0 @@
-package player
-
-import (
-	"context"
-	"ylink/core/cmd/rpc/pb"
-	"ylink/ext/ctxdata"
-
-	"github.com/zeromicro/go-zero/core/logx"
-	"ylink/bff/cmdbff/api/internal/svc"
-)
-
-type PlayerDisconnectLogic struct {
-	logx.Logger
-	ctx    context.Context
-	svcCtx *svc.ServiceContext
-}
-
-func NewPlayerDisconnectLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PlayerDisconnectLogic {
-	return &PlayerDisconnectLogic{
-		Logger: logx.WithContext(ctx),
-		ctx:    ctx,
-		svcCtx: svcCtx,
-	}
-}
-
-func (l *PlayerDisconnectLogic) PlayerDisconnect() error {
-	playerId := ctxdata.GetPlayerIdFromCtx(l.ctx)
-	gameId := ctxdata.GetGameIdFromCtx(l.ctx)
-	_, err := l.svcCtx.CmdRpc.PlayerDisconnect(l.ctx, &pb.PlayerDisconnectReq{
-		PlayerId: playerId,
-		GameId:   gameId,
-	})
-	return err
-}

+ 0 - 41
bff/cmdbff/api/internal/logic/player/playerfetchcsinfologic.go

@@ -1,41 +0,0 @@
-package player
-
-import (
-	"context"
-	"ylink/core/cmd/rpc/pb"
-
-	"ylink/bff/cmdbff/api/internal/svc"
-	"ylink/bff/cmdbff/api/internal/types"
-
-	"github.com/zeromicro/go-zero/core/logx"
-)
-
-type PlayerFetchCsInfoLogic struct {
-	logx.Logger
-	ctx    context.Context
-	svcCtx *svc.ServiceContext
-}
-
-func NewPlayerFetchCsInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PlayerFetchCsInfoLogic {
-	return &PlayerFetchCsInfoLogic{
-		Logger: logx.WithContext(ctx),
-		ctx:    ctx,
-		svcCtx: svcCtx,
-	}
-}
-
-func (l *PlayerFetchCsInfoLogic) PlayerFetchCsInfo(req *types.PlayerFetchCsInfoReq) (resp *types.PlayerFetchCsInfoResp, err error) {
-	cmdResp, err := l.svcCtx.CmdRpc.PlayerFetchCsInfo(l.ctx, &pb.PlayerFetchCsInfoReq{
-		CsId: req.CsId,
-	})
-	if err != nil {
-		return nil, err
-	}
-	return &types.PlayerFetchCsInfoResp{
-		CsId:         cmdResp.CsId,
-		CsNickname:   cmdResp.CsNickname,
-		CsAvatarUrl:  cmdResp.CsAvatarUrl,
-		CsSignature:  cmdResp.CsSignature,
-		OnlineStatus: cmdResp.OnlineStatus,
-	}, nil
-}

+ 0 - 45
bff/cmdbff/api/internal/logic/player/playerfetchhistorymsglogic.go

@@ -1,45 +0,0 @@
-package player
-
-import (
-	"context"
-	"ylink/core/cmd/rpc/pb"
-	"ylink/ext/ctxdata"
-
-	"ylink/bff/cmdbff/api/internal/svc"
-	"ylink/bff/cmdbff/api/internal/types"
-
-	"github.com/zeromicro/go-zero/core/logx"
-)
-
-type PlayerFetchHistoryMsgLogic struct {
-	logx.Logger
-	ctx    context.Context
-	svcCtx *svc.ServiceContext
-}
-
-func NewPlayerFetchHistoryMsgLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PlayerFetchHistoryMsgLogic {
-	return &PlayerFetchHistoryMsgLogic{
-		Logger: logx.WithContext(ctx),
-		ctx:    ctx,
-		svcCtx: svcCtx,
-	}
-}
-
-func (l *PlayerFetchHistoryMsgLogic) PlayerFetchHistoryMsg(req *types.PlayerFetchHistoryMsgReq) (resp *types.PlayerFetchHistoryMsgResp, err error) {
-	playerId := ctxdata.GetPlayerIdFromCtx(l.ctx)
-	gameId := ctxdata.GetGameIdFromCtx(l.ctx)
-	cmdResp, err := l.svcCtx.CmdRpc.PlayerFetchHistoryMsg(l.ctx, &pb.PlayerFetchHistoryMsgReq{
-		PlayerId: playerId,
-		GameId:   gameId,
-		Page:     req.Page,
-		Limit:    req.Limit,
-	})
-	if err != nil {
-		return nil, err
-	}
-	return &types.PlayerFetchHistoryMsgResp{
-		TotalPage:   cmdResp.TotalPage,
-		CurrentPage: cmdResp.CurrentPage,
-		List:        cmdResp.List.AsSlice(),
-	}, nil
-}

+ 0 - 41
bff/cmdbff/api/internal/logic/player/playerfetchmsglogic.go

@@ -1,41 +0,0 @@
-package player
-
-import (
-	"context"
-	"ylink/core/cmd/rpc/pb"
-	"ylink/ext/ctxdata"
-
-	"ylink/bff/cmdbff/api/internal/svc"
-	"ylink/bff/cmdbff/api/internal/types"
-
-	"github.com/zeromicro/go-zero/core/logx"
-)
-
-type PlayerFetchMsgLogic struct {
-	logx.Logger
-	ctx    context.Context
-	svcCtx *svc.ServiceContext
-}
-
-func NewPlayerFetchMsgLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PlayerFetchMsgLogic {
-	return &PlayerFetchMsgLogic{
-		Logger: logx.WithContext(ctx),
-		ctx:    ctx,
-		svcCtx: svcCtx,
-	}
-}
-
-func (l *PlayerFetchMsgLogic) PlayerFetchMsg() (resp *types.PlayerFetchMsgResp, err error) {
-	playerId := ctxdata.GetGameIdFromCtx(l.ctx)
-	gameId := ctxdata.GetGameIdFromCtx(l.ctx)
-	cmdResp, err := l.svcCtx.CmdRpc.PlayerFetchMsg(l.ctx, &pb.PlayerFetchMsgReq{
-		PlayerId: playerId,
-		GameId:   gameId,
-	})
-	if err != nil {
-		return nil, err
-	}
-	return &types.PlayerFetchMsgResp{
-		List: cmdResp.List.AsSlice(),
-	}, nil
-}

+ 0 - 38
bff/cmdbff/api/internal/logic/player/playersendmsglogic.go

@@ -1,38 +0,0 @@
-package player
-
-import (
-	"context"
-	"ylink/core/cmd/rpc/pb"
-	"ylink/ext/ctxdata"
-
-	"ylink/bff/cmdbff/api/internal/svc"
-	"ylink/bff/cmdbff/api/internal/types"
-
-	"github.com/zeromicro/go-zero/core/logx"
-)
-
-type PlayerSendMsgLogic struct {
-	logx.Logger
-	ctx    context.Context
-	svcCtx *svc.ServiceContext
-}
-
-func NewPlayerSendMsgLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PlayerSendMsgLogic {
-	return &PlayerSendMsgLogic{
-		Logger: logx.WithContext(ctx),
-		ctx:    ctx,
-		svcCtx: svcCtx,
-	}
-}
-
-func (l *PlayerSendMsgLogic) PlayerSendMsg(req *types.PlayerSendMsgReq) error {
-	playerId := ctxdata.GetPlayerIdFromCtx(l.ctx)
-	gameId := ctxdata.GetGameIdFromCtx(l.ctx)
-	_, err := l.svcCtx.CmdRpc.PlayerSendMsg(l.ctx, &pb.PlayerSendMsgReq{
-		PlayerId: playerId,
-		GameId:   gameId,
-		Content:  req.Content,
-		Pic:      req.Pic,
-	})
-	return err
-}

+ 11 - 3
bff/cmdbff/api/internal/logic/player/sendmsglogic.go

@@ -2,6 +2,8 @@ package player
 
 import (
 	"context"
+	"ylink/core/cmd/rpc/pb"
+	"ylink/ext/ctxdata"
 
 	"ylink/bff/cmdbff/api/internal/svc"
 	"ylink/bff/cmdbff/api/internal/types"
@@ -24,7 +26,13 @@ func NewSendMsgLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SendMsgLo
 }
 
 func (l *SendMsgLogic) SendMsg(req *types.PlayerSendMsgReq) error {
-	// todo: add your logic here and delete this line
-
-	return nil
+	playerId := ctxdata.GetPlayerIdFromCtx(l.ctx)
+	gameId := ctxdata.GetGameIdFromCtx(l.ctx)
+	_, err := l.svcCtx.CmdRpc.PlayerSendMsg(l.ctx, &pb.PlayerSendMsgReq{
+		PlayerId: playerId,
+		GameId:   gameId,
+		Content:  req.Content,
+		Pic:      req.Pic,
+	})
+	return err
 }

+ 5 - 5
bff/cmdbff/api/internal/types/types.go

@@ -34,7 +34,7 @@ type PlayerSendMsgReq struct {
 }
 
 type CsFetchPlayerQueueReq struct {
-	Limit int `json:"limit"`
+	Limit int64 `json:"limit"`
 }
 
 type CsFetchPlayerQueueResp struct {
@@ -47,8 +47,8 @@ type CsConnectPlayerReq struct {
 }
 
 type CsFetchHistoryChatReq struct {
-	Page  int `json:"page"`
-	Limit int `json:"limit"`
+	Page  int64 `json:"page"`
+	Limit int64 `json:"limit"`
 }
 
 type CsFetchHistoryChatResp struct {
@@ -60,8 +60,8 @@ type CsFetchHistoryChatResp struct {
 type CsFetchHistoryMsgReq struct {
 	PlayerId string `json:"player_id"`
 	GameId   string `json:"game_id"`
-	Page     int    `json:"page"`
-	Limit    int    `json:"limit"`
+	Page     int64  `json:"page"`
+	Limit    int64  `json:"limit"`
 }
 
 type CsFetchHistoryMsgResp struct {

+ 1 - 1
ext/ctxdata/ctxdata.go

@@ -19,7 +19,7 @@ func GetGameIdFromCtx(ctx context.Context) string {
 	return gameId
 }
 
-func GetCsIdFromJwt(ctx context.Context) string {
+func GetCsIdFromCtx(ctx context.Context) string {
 	csId, _ := ctx.Value(jwtkey.CsId).(string)
 	return csId
 }

+ 1 - 0
ext/result/httpresult.go

@@ -44,6 +44,7 @@ func HttpResult(r *http.Request, w http.ResponseWriter, resp interface{}, err er
 }
 
 func ParamErrorResult(r *http.Request, w http.ResponseWriter, err error) {
+	logx.WithContext(r.Context()).Errorf("[API ERROR] : %+v", err)
 	msg := fmt.Sprintf("%s ,%s", MapErrMsg(RequestParamError), err.Error())
 	httpx.WriteJson(w, http.StatusBadRequest, Error(RequestParamError, msg))
 }