Prechádzať zdrojové kódy

v0.0.1开发:apibff接口开发

#Suyghur 2 rokov pred
rodič
commit
a8f313a9ac
51 zmenil súbory, kde vykonal 2288 pridanie a 496 odobranie
  1. 0 1
      apis/auth/auth/auth.go
  2. 1 6
      apis/auth/etc/auth.yaml
  3. 8 2
      apis/auth/internal/logic/checkauthlogic.go
  4. 1 1
      apis/auth/internal/logic/csauthlogic.go
  5. 1 1
      apis/auth/internal/logic/playerauthlogic.go
  6. 63 127
      apis/auth/pb/auth.pb.go
  7. 1 5
      apis/auth/pb/auth.proto
  8. 40 0
      apis/cmd/cmd.go
  9. 107 0
      apis/cmd/cmd/cmd.go
  10. 7 0
      apis/cmd/etc/cmd.yaml
  11. 7 0
      apis/cmd/internal/config/config.go
  12. 30 0
      apis/cmd/internal/logic/csconnectplayerlogic.go
  13. 30 0
      apis/cmd/internal/logic/csfetchhistorychatlogic.go
  14. 30 0
      apis/cmd/internal/logic/csfetchhistorymsglogic.go
  15. 30 0
      apis/cmd/internal/logic/csfetchmsglogic.go
  16. 30 0
      apis/cmd/internal/logic/csfetchplayerqueuelogic.go
  17. 30 0
      apis/cmd/internal/logic/cssendmsglogic.go
  18. 30 0
      apis/cmd/internal/logic/playerdisconnectlogic.go
  19. 45 0
      apis/cmd/internal/logic/playerfetchcsinfologic.go
  20. 30 0
      apis/cmd/internal/logic/playerfetchhistorymsglogic.go
  21. 30 0
      apis/cmd/internal/logic/playerfetchmsglogic.go
  22. 30 0
      apis/cmd/internal/logic/playersendmsglogic.go
  23. 78 0
      apis/cmd/internal/server/cmdserver.go
  24. 13 0
      apis/cmd/internal/svc/servicecontext.go
  25. 1006 0
      apis/cmd/pb/cmd.pb.go
  26. 69 17
      apis/cmd/pb/cmd.proto
  27. 465 0
      apis/cmd/pb/cmd_grpc.pb.go
  28. 2 26
      bff/apibff/desc/apibff.api
  29. 0 15
      bff/apibff/desc/bean.api
  30. 4 10
      bff/apibff/etc/apibff.yaml
  31. 2 2
      bff/apibff/internal/config/config.go
  32. 0 28
      bff/apibff/internal/handler/cs/auth/csauthhandler.go
  33. 0 28
      bff/apibff/internal/handler/cs/cmd/csfetchplayerinfohandler.go
  34. 0 28
      bff/apibff/internal/handler/player/auth/playerauthhandler.go
  35. 2 31
      bff/apibff/internal/handler/routes.go
  36. 0 44
      bff/apibff/internal/logic/cs/auth/csauthlogic.go
  37. 0 30
      bff/apibff/internal/logic/cs/cmd/csfetchplayerinfologic.go
  38. 0 44
      bff/apibff/internal/logic/player/auth/playerauthlogic.go
  39. 12 2
      bff/apibff/internal/logic/player/cmd/playerfetchcsinfologic.go
  40. 5 5
      bff/apibff/internal/svc/servicecontext.go
  41. 0 15
      bff/apibff/internal/types/types.go
  42. 1 1
      bff/authbff/desc/authbff.api
  43. 1 1
      bff/authbff/internal/logic/checkauthlogic.go
  44. 1 1
      bff/authbff/internal/types/types.go
  45. 9 2
      bff/rpcbff/etc/rpcbff.yaml
  46. 1 0
      bff/rpcbff/internal/config/config.go
  47. 11 5
      bff/rpcbff/internal/logic/connectlogic.go
  48. 1 1
      bff/rpcbff/internal/logic/disconnectlogic.go
  49. 9 3
      bff/rpcbff/internal/svc/servicecontext.go
  50. 14 13
      bff/rpcbff/pb/rpcbff.pb.go
  51. 1 1
      bff/rpcbff/pb/rpcbff.proto

+ 0 - 1
apis/auth/auth/auth.go

@@ -13,7 +13,6 @@ import (
 )
 
 type (
-	AuthReq       = pb.AuthReq
 	AuthResp      = pb.AuthResp
 	CheckAuthReq  = pb.CheckAuthReq
 	CsAuthReq     = pb.CsAuthReq

+ 1 - 6
apis/auth/etc/auth.yaml

@@ -8,9 +8,4 @@ Etcd:
 
 JwtAuth:
   AccessSecret: ylink2022
-  AccessExpire: 259200
-
-Redis:
-  Host: 127.0.0.1:6379
-  Type: node
-  Pass: ylink2020
+  AccessExpire: 86400

+ 8 - 2
apis/auth/internal/logic/checkauthlogic.go

@@ -29,7 +29,7 @@ func (l *CheckAuthLogic) CheckAuth(in *pb.CheckAuthReq) (*pb.AuthResp, error) {
 	// 解析传入的token
 	// 第二个参数是一个回调函数,作用是判断生成token所用的签名算法是否和传入token的签名算法是否一致。
 	// 算法匹配就返回密钥,用来解析token.
-	token, err := jwt.Parse(in.Token, func(token *jwt.Token) (i interface{}, err error) {
+	token, err := jwt.Parse(in.AccessToken, func(token *jwt.Token) (i interface{}, err error) {
 		if _, ok := token.Method.(*jwt.SigningMethodHMAC); !ok {
 			return nil, errors.New("unexpected signing method")
 		}
@@ -42,12 +42,18 @@ func (l *CheckAuthLogic) CheckAuth(in *pb.CheckAuthReq) (*pb.AuthResp, error) {
 	}
 
 	// 将获取的token中的Claims强转为MapClaims
-	_, ok := token.Claims.(jwt.MapClaims)
+	claims, ok := token.Claims.(jwt.MapClaims)
 	// 判断token是否有效
 	if !(ok && token.Valid) {
 		return nil, errors.New("cannot convert claim to mapClaim")
 	}
 
+	iat := claims["iat"].(int64)
+	exp := claims["exp"].(int64)
+	if iat == exp {
+		return nil, errors.New("access token is invalid")
+	}
+
 	data, err := structpb.NewStruct(map[string]interface{}{})
 	if err != nil {
 		return nil, err

+ 1 - 1
apis/auth/internal/logic/csauthlogic.go

@@ -34,7 +34,7 @@ func (l *CsAuthLogic) CsAuth(in *pb.CsAuthReq) (*pb.AuthResp, error) {
 		return nil, err
 	}
 	data, err := structpb.NewStruct(map[string]interface{}{
-		"token": token,
+		"access_token": token,
 	})
 	if err != nil {
 		return nil, err

+ 1 - 1
apis/auth/internal/logic/playerauthlogic.go

@@ -35,7 +35,7 @@ func (l *PlayerAuthLogic) PlayerAuth(in *pb.PlayerAuthReq) (*pb.AuthResp, error)
 	}
 
 	data, err := structpb.NewStruct(map[string]interface{}{
-		"token": token,
+		"access_token": token,
 	})
 	if err != nil {
 		return nil, err

+ 63 - 127
apis/auth/pb/auth.pb.go

@@ -21,53 +21,6 @@ const (
 	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
 )
 
-type AuthReq struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
-	unknownFields protoimpl.UnknownFields
-
-	Data *structpb.Struct `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
-}
-
-func (x *AuthReq) Reset() {
-	*x = AuthReq{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_pb_auth_proto_msgTypes[0]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
-}
-
-func (x *AuthReq) String() string {
-	return protoimpl.X.MessageStringOf(x)
-}
-
-func (*AuthReq) ProtoMessage() {}
-
-func (x *AuthReq) ProtoReflect() protoreflect.Message {
-	mi := &file_pb_auth_proto_msgTypes[0]
-	if protoimpl.UnsafeEnabled && x != nil {
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		if ms.LoadMessageInfo() == nil {
-			ms.StoreMessageInfo(mi)
-		}
-		return ms
-	}
-	return mi.MessageOf(x)
-}
-
-// Deprecated: Use AuthReq.ProtoReflect.Descriptor instead.
-func (*AuthReq) Descriptor() ([]byte, []int) {
-	return file_pb_auth_proto_rawDescGZIP(), []int{0}
-}
-
-func (x *AuthReq) GetData() *structpb.Struct {
-	if x != nil {
-		return x.Data
-	}
-	return nil
-}
-
 type PlayerAuthReq struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -80,7 +33,7 @@ type PlayerAuthReq struct {
 func (x *PlayerAuthReq) Reset() {
 	*x = PlayerAuthReq{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_pb_auth_proto_msgTypes[1]
+		mi := &file_pb_auth_proto_msgTypes[0]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -93,7 +46,7 @@ func (x *PlayerAuthReq) String() string {
 func (*PlayerAuthReq) ProtoMessage() {}
 
 func (x *PlayerAuthReq) ProtoReflect() protoreflect.Message {
-	mi := &file_pb_auth_proto_msgTypes[1]
+	mi := &file_pb_auth_proto_msgTypes[0]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -106,7 +59,7 @@ func (x *PlayerAuthReq) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use PlayerAuthReq.ProtoReflect.Descriptor instead.
 func (*PlayerAuthReq) Descriptor() ([]byte, []int) {
-	return file_pb_auth_proto_rawDescGZIP(), []int{1}
+	return file_pb_auth_proto_rawDescGZIP(), []int{0}
 }
 
 func (x *PlayerAuthReq) GetPlayerId() string {
@@ -134,7 +87,7 @@ type CsAuthReq struct {
 func (x *CsAuthReq) Reset() {
 	*x = CsAuthReq{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_pb_auth_proto_msgTypes[2]
+		mi := &file_pb_auth_proto_msgTypes[1]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -147,7 +100,7 @@ func (x *CsAuthReq) String() string {
 func (*CsAuthReq) ProtoMessage() {}
 
 func (x *CsAuthReq) ProtoReflect() protoreflect.Message {
-	mi := &file_pb_auth_proto_msgTypes[2]
+	mi := &file_pb_auth_proto_msgTypes[1]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -160,7 +113,7 @@ func (x *CsAuthReq) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use CsAuthReq.ProtoReflect.Descriptor instead.
 func (*CsAuthReq) Descriptor() ([]byte, []int) {
-	return file_pb_auth_proto_rawDescGZIP(), []int{2}
+	return file_pb_auth_proto_rawDescGZIP(), []int{1}
 }
 
 func (x *CsAuthReq) GetCsId() string {
@@ -175,13 +128,13 @@ type CheckAuthReq struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
+	AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`
 }
 
 func (x *CheckAuthReq) Reset() {
 	*x = CheckAuthReq{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_pb_auth_proto_msgTypes[3]
+		mi := &file_pb_auth_proto_msgTypes[2]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -194,7 +147,7 @@ func (x *CheckAuthReq) String() string {
 func (*CheckAuthReq) ProtoMessage() {}
 
 func (x *CheckAuthReq) ProtoReflect() protoreflect.Message {
-	mi := &file_pb_auth_proto_msgTypes[3]
+	mi := &file_pb_auth_proto_msgTypes[2]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -207,12 +160,12 @@ func (x *CheckAuthReq) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use CheckAuthReq.ProtoReflect.Descriptor instead.
 func (*CheckAuthReq) Descriptor() ([]byte, []int) {
-	return file_pb_auth_proto_rawDescGZIP(), []int{3}
+	return file_pb_auth_proto_rawDescGZIP(), []int{2}
 }
 
-func (x *CheckAuthReq) GetToken() string {
+func (x *CheckAuthReq) GetAccessToken() string {
 	if x != nil {
-		return x.Token
+		return x.AccessToken
 	}
 	return ""
 }
@@ -230,7 +183,7 @@ type AuthResp struct {
 func (x *AuthResp) Reset() {
 	*x = AuthResp{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_pb_auth_proto_msgTypes[4]
+		mi := &file_pb_auth_proto_msgTypes[3]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -243,7 +196,7 @@ func (x *AuthResp) String() string {
 func (*AuthResp) ProtoMessage() {}
 
 func (x *AuthResp) ProtoReflect() protoreflect.Message {
-	mi := &file_pb_auth_proto_msgTypes[4]
+	mi := &file_pb_auth_proto_msgTypes[3]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -256,7 +209,7 @@ func (x *AuthResp) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use AuthResp.ProtoReflect.Descriptor instead.
 func (*AuthResp) Descriptor() ([]byte, []int) {
-	return file_pb_auth_proto_rawDescGZIP(), []int{4}
+	return file_pb_auth_proto_rawDescGZIP(), []int{3}
 }
 
 func (x *AuthResp) GetCode() int64 {
@@ -286,35 +239,32 @@ var file_pb_auth_proto_rawDesc = []byte{
 	0x0a, 0x0d, 0x70, 0x62, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
 	0x02, 0x70, 0x62, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74,
 	0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74,
-	0x6f, 0x22, 0x36, 0x0a, 0x07, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x71, 0x12, 0x2b, 0x0a, 0x04,
-	0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f,
-	0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72,
-	0x75, 0x63, 0x74, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x45, 0x0a, 0x0d, 0x50, 0x6c, 0x61,
-	0x79, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x71, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6c,
-	0x61, 0x79, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70,
-	0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x67, 0x61, 0x6d, 0x65, 0x5f,
-	0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x61, 0x6d, 0x65, 0x49, 0x64,
-	0x22, 0x20, 0x0a, 0x09, 0x43, 0x73, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x71, 0x12, 0x13, 0x0a,
-	0x05, 0x63, 0x73, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x73,
-	0x49, 0x64, 0x22, 0x24, 0x0a, 0x0c, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x75, 0x74, 0x68, 0x52,
-	0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x5d, 0x0a, 0x08, 0x41, 0x75, 0x74, 0x68,
-	0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01,
-	0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18,
-	0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x2b, 0x0a, 0x04, 0x64, 0x61,
-	0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
-	0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63,
-	0x74, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0x89, 0x01, 0x0a, 0x04, 0x41, 0x75, 0x74, 0x68,
-	0x12, 0x2d, 0x0a, 0x0a, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x11,
-	0x2e, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65,
-	0x71, 0x1a, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12,
-	0x25, 0x0a, 0x06, 0x63, 0x73, 0x41, 0x75, 0x74, 0x68, 0x12, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x43,
-	0x73, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x41, 0x75,
-	0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2b, 0x0a, 0x09, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x41,
-	0x75, 0x74, 0x68, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x75,
-	0x74, 0x68, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x52,
-	0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
-	0x74, 0x6f, 0x33,
+	0x6f, 0x22, 0x45, 0x0a, 0x0d, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x52,
+	0x65, 0x71, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18,
+	0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x64, 0x12,
+	0x17, 0x0a, 0x07, 0x67, 0x61, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x06, 0x67, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x22, 0x20, 0x0a, 0x09, 0x43, 0x73, 0x41, 0x75,
+	0x74, 0x68, 0x52, 0x65, 0x71, 0x12, 0x13, 0x0a, 0x05, 0x63, 0x73, 0x5f, 0x69, 0x64, 0x18, 0x01,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x73, 0x49, 0x64, 0x22, 0x31, 0x0a, 0x0c, 0x43, 0x68,
+	0x65, 0x63, 0x6b, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x71, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63,
+	0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x5d, 0x0a,
+	0x08, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64,
+	0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a,
+	0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12,
+	0x2b, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e,
+	0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
+	0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0x89, 0x01, 0x0a,
+	0x04, 0x41, 0x75, 0x74, 0x68, 0x12, 0x2d, 0x0a, 0x0a, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x41,
+	0x75, 0x74, 0x68, 0x12, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x41,
+	0x75, 0x74, 0x68, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x41, 0x75, 0x74, 0x68,
+	0x52, 0x65, 0x73, 0x70, 0x12, 0x25, 0x0a, 0x06, 0x63, 0x73, 0x41, 0x75, 0x74, 0x68, 0x12, 0x0d,
+	0x2e, 0x70, 0x62, 0x2e, 0x43, 0x73, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e,
+	0x70, 0x62, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2b, 0x0a, 0x09, 0x63,
+	0x68, 0x65, 0x63, 0x6b, 0x41, 0x75, 0x74, 0x68, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68,
+	0x65, 0x63, 0x6b, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x70, 0x62, 0x2e,
+	0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62,
+	0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -329,29 +279,27 @@ func file_pb_auth_proto_rawDescGZIP() []byte {
 	return file_pb_auth_proto_rawDescData
 }
 
-var file_pb_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
+var file_pb_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
 var file_pb_auth_proto_goTypes = []interface{}{
-	(*AuthReq)(nil),         // 0: pb.AuthReq
-	(*PlayerAuthReq)(nil),   // 1: pb.PlayerAuthReq
-	(*CsAuthReq)(nil),       // 2: pb.CsAuthReq
-	(*CheckAuthReq)(nil),    // 3: pb.CheckAuthReq
-	(*AuthResp)(nil),        // 4: pb.AuthResp
-	(*structpb.Struct)(nil), // 5: google.protobuf.Struct
+	(*PlayerAuthReq)(nil),   // 0: pb.PlayerAuthReq
+	(*CsAuthReq)(nil),       // 1: pb.CsAuthReq
+	(*CheckAuthReq)(nil),    // 2: pb.CheckAuthReq
+	(*AuthResp)(nil),        // 3: pb.AuthResp
+	(*structpb.Struct)(nil), // 4: google.protobuf.Struct
 }
 var file_pb_auth_proto_depIdxs = []int32{
-	5, // 0: pb.AuthReq.data:type_name -> google.protobuf.Struct
-	5, // 1: pb.AuthResp.data:type_name -> google.protobuf.Struct
-	1, // 2: pb.Auth.playerAuth:input_type -> pb.PlayerAuthReq
-	2, // 3: pb.Auth.csAuth:input_type -> pb.CsAuthReq
-	3, // 4: pb.Auth.checkAuth:input_type -> pb.CheckAuthReq
-	4, // 5: pb.Auth.playerAuth:output_type -> pb.AuthResp
-	4, // 6: pb.Auth.csAuth:output_type -> pb.AuthResp
-	4, // 7: pb.Auth.checkAuth:output_type -> pb.AuthResp
-	5, // [5:8] is the sub-list for method output_type
-	2, // [2:5] is the sub-list for method input_type
-	2, // [2:2] is the sub-list for extension type_name
-	2, // [2:2] is the sub-list for extension extendee
-	0, // [0:2] is the sub-list for field type_name
+	4, // 0: pb.AuthResp.data:type_name -> google.protobuf.Struct
+	0, // 1: pb.Auth.playerAuth:input_type -> pb.PlayerAuthReq
+	1, // 2: pb.Auth.csAuth:input_type -> pb.CsAuthReq
+	2, // 3: pb.Auth.checkAuth:input_type -> pb.CheckAuthReq
+	3, // 4: pb.Auth.playerAuth:output_type -> pb.AuthResp
+	3, // 5: pb.Auth.csAuth:output_type -> pb.AuthResp
+	3, // 6: pb.Auth.checkAuth:output_type -> pb.AuthResp
+	4, // [4:7] is the sub-list for method output_type
+	1, // [1:4] is the sub-list for method input_type
+	1, // [1:1] is the sub-list for extension type_name
+	1, // [1:1] is the sub-list for extension extendee
+	0, // [0:1] is the sub-list for field type_name
 }
 
 func init() { file_pb_auth_proto_init() }
@@ -361,18 +309,6 @@ func file_pb_auth_proto_init() {
 	}
 	if !protoimpl.UnsafeEnabled {
 		file_pb_auth_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*AuthReq); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
-		file_pb_auth_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
 			switch v := v.(*PlayerAuthReq); i {
 			case 0:
 				return &v.state
@@ -384,7 +320,7 @@ func file_pb_auth_proto_init() {
 				return nil
 			}
 		}
-		file_pb_auth_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+		file_pb_auth_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
 			switch v := v.(*CsAuthReq); i {
 			case 0:
 				return &v.state
@@ -396,7 +332,7 @@ func file_pb_auth_proto_init() {
 				return nil
 			}
 		}
-		file_pb_auth_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
+		file_pb_auth_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
 			switch v := v.(*CheckAuthReq); i {
 			case 0:
 				return &v.state
@@ -408,7 +344,7 @@ func file_pb_auth_proto_init() {
 				return nil
 			}
 		}
-		file_pb_auth_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
+		file_pb_auth_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
 			switch v := v.(*AuthResp); i {
 			case 0:
 				return &v.state
@@ -427,7 +363,7 @@ func file_pb_auth_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_pb_auth_proto_rawDesc,
 			NumEnums:      0,
-			NumMessages:   5,
+			NumMessages:   4,
 			NumExtensions: 0,
 			NumServices:   1,
 		},

+ 1 - 5
apis/auth/pb/auth.proto

@@ -6,10 +6,6 @@ package pb;
 
 import "google/protobuf/struct.proto";
 
-message AuthReq{
-  google.protobuf.Struct data = 1;
-}
-
 message PlayerAuthReq{
   string player_id = 1;
   string game_id = 2;
@@ -20,7 +16,7 @@ message CsAuthReq{
 }
 
 message CheckAuthReq{
-  string  token = 1;
+  string  access_token = 1;
 }
 
 message AuthResp{

+ 40 - 0
apis/cmd/cmd.go

@@ -0,0 +1,40 @@
+package main
+
+import (
+	"flag"
+	"fmt"
+
+	"ylink/apis/cmd/internal/config"
+	"ylink/apis/cmd/internal/server"
+	"ylink/apis/cmd/internal/svc"
+	"ylink/apis/cmd/pb"
+
+	"github.com/zeromicro/go-zero/core/conf"
+	"github.com/zeromicro/go-zero/core/service"
+	"github.com/zeromicro/go-zero/zrpc"
+	"google.golang.org/grpc"
+	"google.golang.org/grpc/reflection"
+)
+
+var configFile = flag.String("f", "etc/cmd.yaml", "the config file")
+
+func main() {
+	flag.Parse()
+
+	var c config.Config
+	conf.MustLoad(*configFile, &c)
+	ctx := svc.NewServiceContext(c)
+	svr := server.NewCmdServer(ctx)
+
+	s := zrpc.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) {
+		pb.RegisterCmdServer(grpcServer, svr)
+
+		if c.Mode == service.DevMode || c.Mode == service.TestMode {
+			reflection.Register(grpcServer)
+		}
+	})
+	defer s.Stop()
+
+	fmt.Printf("Starting rpc server at %s...\n", c.ListenOn)
+	s.Start()
+}

+ 107 - 0
apis/cmd/cmd/cmd.go

@@ -0,0 +1,107 @@
+// Code generated by goctl. DO NOT EDIT!
+// Source: cmd.proto
+
+package cmd
+
+import (
+	"context"
+
+	"ylink/apis/cmd/pb"
+
+	"github.com/zeromicro/go-zero/zrpc"
+	"google.golang.org/grpc"
+)
+
+type (
+	CmdResp                  = pb.CmdResp
+	CsConnectPlayerReq       = pb.CsConnectPlayerReq
+	CsFetchHistoryChatReq    = pb.CsFetchHistoryChatReq
+	CsFetchHistoryMsgReq     = pb.CsFetchHistoryMsgReq
+	CsFetchMsgReq            = pb.CsFetchMsgReq
+	CsFetchPlayerQueueReq    = pb.CsFetchPlayerQueueReq
+	CsSendMsgReq             = pb.CsSendMsgReq
+	PlayerDisconnectReq      = pb.PlayerDisconnectReq
+	PlayerFetchCsInfoReq     = pb.PlayerFetchCsInfoReq
+	PlayerFetchHistoryMsgReq = pb.PlayerFetchHistoryMsgReq
+	PlayerFetchMsgReq        = pb.PlayerFetchMsgReq
+	PlayerSendMsgReq         = pb.PlayerSendMsgReq
+
+	Cmd interface {
+		PlayerFetchCsInfo(ctx context.Context, in *PlayerFetchCsInfoReq, opts ...grpc.CallOption) (*CmdResp, error)
+		PlayerFetchHistoryMsg(ctx context.Context, in *PlayerFetchHistoryMsgReq, opts ...grpc.CallOption) (*CmdResp, error)
+		PlayerFetchMsg(ctx context.Context, in *PlayerFetchMsgReq, opts ...grpc.CallOption) (*CmdResp, error)
+		PlayerSendMsg(ctx context.Context, in *PlayerSendMsgReq, opts ...grpc.CallOption) (*CmdResp, error)
+		PlayerDisconnect(ctx context.Context, in *PlayerDisconnectReq, opts ...grpc.CallOption) (*CmdResp, error)
+		CsFetchPlayerQueue(ctx context.Context, in *CsFetchPlayerQueueReq, opts ...grpc.CallOption) (*CmdResp, error)
+		CsConnectPlayer(ctx context.Context, in *CsConnectPlayerReq, opts ...grpc.CallOption) (*CmdResp, error)
+		CsFetchHistoryChat(ctx context.Context, in *CsFetchHistoryChatReq, opts ...grpc.CallOption) (*CmdResp, error)
+		CsFetchHistoryMsg(ctx context.Context, in *CsFetchHistoryMsgReq, opts ...grpc.CallOption) (*CmdResp, error)
+		CsFetchMsg(ctx context.Context, in *CsFetchMsgReq, opts ...grpc.CallOption) (*CmdResp, error)
+		CsSendMsg(ctx context.Context, in *CsSendMsgReq, opts ...grpc.CallOption) (*CmdResp, error)
+	}
+
+	defaultCmd struct {
+		cli zrpc.Client
+	}
+)
+
+func NewCmd(cli zrpc.Client) Cmd {
+	return &defaultCmd{
+		cli: cli,
+	}
+}
+
+func (m *defaultCmd) PlayerFetchCsInfo(ctx context.Context, in *PlayerFetchCsInfoReq, opts ...grpc.CallOption) (*CmdResp, error) {
+	client := pb.NewCmdClient(m.cli.Conn())
+	return client.PlayerFetchCsInfo(ctx, in, opts...)
+}
+
+func (m *defaultCmd) PlayerFetchHistoryMsg(ctx context.Context, in *PlayerFetchHistoryMsgReq, opts ...grpc.CallOption) (*CmdResp, error) {
+	client := pb.NewCmdClient(m.cli.Conn())
+	return client.PlayerFetchHistoryMsg(ctx, in, opts...)
+}
+
+func (m *defaultCmd) PlayerFetchMsg(ctx context.Context, in *PlayerFetchMsgReq, opts ...grpc.CallOption) (*CmdResp, error) {
+	client := pb.NewCmdClient(m.cli.Conn())
+	return client.PlayerFetchMsg(ctx, in, opts...)
+}
+
+func (m *defaultCmd) PlayerSendMsg(ctx context.Context, in *PlayerSendMsgReq, opts ...grpc.CallOption) (*CmdResp, error) {
+	client := pb.NewCmdClient(m.cli.Conn())
+	return client.PlayerSendMsg(ctx, in, opts...)
+}
+
+func (m *defaultCmd) PlayerDisconnect(ctx context.Context, in *PlayerDisconnectReq, opts ...grpc.CallOption) (*CmdResp, error) {
+	client := pb.NewCmdClient(m.cli.Conn())
+	return client.PlayerDisconnect(ctx, in, opts...)
+}
+
+func (m *defaultCmd) CsFetchPlayerQueue(ctx context.Context, in *CsFetchPlayerQueueReq, opts ...grpc.CallOption) (*CmdResp, error) {
+	client := pb.NewCmdClient(m.cli.Conn())
+	return client.CsFetchPlayerQueue(ctx, in, opts...)
+}
+
+func (m *defaultCmd) CsConnectPlayer(ctx context.Context, in *CsConnectPlayerReq, opts ...grpc.CallOption) (*CmdResp, error) {
+	client := pb.NewCmdClient(m.cli.Conn())
+	return client.CsConnectPlayer(ctx, in, opts...)
+}
+
+func (m *defaultCmd) CsFetchHistoryChat(ctx context.Context, in *CsFetchHistoryChatReq, opts ...grpc.CallOption) (*CmdResp, error) {
+	client := pb.NewCmdClient(m.cli.Conn())
+	return client.CsFetchHistoryChat(ctx, in, opts...)
+}
+
+func (m *defaultCmd) CsFetchHistoryMsg(ctx context.Context, in *CsFetchHistoryMsgReq, opts ...grpc.CallOption) (*CmdResp, error) {
+	client := pb.NewCmdClient(m.cli.Conn())
+	return client.CsFetchHistoryMsg(ctx, in, opts...)
+}
+
+func (m *defaultCmd) CsFetchMsg(ctx context.Context, in *CsFetchMsgReq, opts ...grpc.CallOption) (*CmdResp, error) {
+	client := pb.NewCmdClient(m.cli.Conn())
+	return client.CsFetchMsg(ctx, in, opts...)
+}
+
+func (m *defaultCmd) CsSendMsg(ctx context.Context, in *CsSendMsgReq, opts ...grpc.CallOption) (*CmdResp, error) {
+	client := pb.NewCmdClient(m.cli.Conn())
+	return client.CsSendMsg(ctx, in, opts...)
+}

+ 7 - 0
apis/cmd/etc/cmd.yaml

@@ -0,0 +1,7 @@
+Name: cmd.rpc
+ListenOn: 0.0.0.0:12000
+
+Etcd:
+  Hosts:
+    - 127.0.0.1:2379
+  Key: cmd.rpc

+ 7 - 0
apis/cmd/internal/config/config.go

@@ -0,0 +1,7 @@
+package config
+
+import "github.com/zeromicro/go-zero/zrpc"
+
+type Config struct {
+	zrpc.RpcServerConf
+}

+ 30 - 0
apis/cmd/internal/logic/csconnectplayerlogic.go

@@ -0,0 +1,30 @@
+package logic
+
+import (
+	"context"
+
+	"ylink/apis/cmd/internal/svc"
+	"ylink/apis/cmd/pb"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type CsConnectPlayerLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewCsConnectPlayerLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CsConnectPlayerLogic {
+	return &CsConnectPlayerLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+func (l *CsConnectPlayerLogic) CsConnectPlayer(in *pb.CsConnectPlayerReq) (*pb.CmdResp, error) {
+	// todo: add your logic here and delete this line
+
+	return &pb.CmdResp{}, nil
+}

+ 30 - 0
apis/cmd/internal/logic/csfetchhistorychatlogic.go

@@ -0,0 +1,30 @@
+package logic
+
+import (
+	"context"
+
+	"ylink/apis/cmd/internal/svc"
+	"ylink/apis/cmd/pb"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type CsFetchHistoryChatLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewCsFetchHistoryChatLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CsFetchHistoryChatLogic {
+	return &CsFetchHistoryChatLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+func (l *CsFetchHistoryChatLogic) CsFetchHistoryChat(in *pb.CsFetchHistoryChatReq) (*pb.CmdResp, error) {
+	// todo: add your logic here and delete this line
+
+	return &pb.CmdResp{}, nil
+}

+ 30 - 0
apis/cmd/internal/logic/csfetchhistorymsglogic.go

@@ -0,0 +1,30 @@
+package logic
+
+import (
+	"context"
+
+	"ylink/apis/cmd/internal/svc"
+	"ylink/apis/cmd/pb"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type CsFetchHistoryMsgLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewCsFetchHistoryMsgLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CsFetchHistoryMsgLogic {
+	return &CsFetchHistoryMsgLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+func (l *CsFetchHistoryMsgLogic) CsFetchHistoryMsg(in *pb.CsFetchHistoryMsgReq) (*pb.CmdResp, error) {
+	// todo: add your logic here and delete this line
+
+	return &pb.CmdResp{}, nil
+}

+ 30 - 0
apis/cmd/internal/logic/csfetchmsglogic.go

@@ -0,0 +1,30 @@
+package logic
+
+import (
+	"context"
+
+	"ylink/apis/cmd/internal/svc"
+	"ylink/apis/cmd/pb"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type CsFetchMsgLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewCsFetchMsgLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CsFetchMsgLogic {
+	return &CsFetchMsgLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+func (l *CsFetchMsgLogic) CsFetchMsg(in *pb.CsFetchMsgReq) (*pb.CmdResp, error) {
+	// todo: add your logic here and delete this line
+
+	return &pb.CmdResp{}, nil
+}

+ 30 - 0
apis/cmd/internal/logic/csfetchplayerqueuelogic.go

@@ -0,0 +1,30 @@
+package logic
+
+import (
+	"context"
+
+	"ylink/apis/cmd/internal/svc"
+	"ylink/apis/cmd/pb"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type CsFetchPlayerQueueLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewCsFetchPlayerQueueLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CsFetchPlayerQueueLogic {
+	return &CsFetchPlayerQueueLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+func (l *CsFetchPlayerQueueLogic) CsFetchPlayerQueue(in *pb.CsFetchPlayerQueueReq) (*pb.CmdResp, error) {
+	// todo: add your logic here and delete this line
+
+	return &pb.CmdResp{}, nil
+}

+ 30 - 0
apis/cmd/internal/logic/cssendmsglogic.go

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

+ 30 - 0
apis/cmd/internal/logic/playerdisconnectlogic.go

@@ -0,0 +1,30 @@
+package logic
+
+import (
+	"context"
+
+	"ylink/apis/cmd/internal/svc"
+	"ylink/apis/cmd/pb"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type PlayerDisconnectLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewPlayerDisconnectLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PlayerDisconnectLogic {
+	return &PlayerDisconnectLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+func (l *PlayerDisconnectLogic) PlayerDisconnect(in *pb.PlayerDisconnectReq) (*pb.CmdResp, error) {
+	// todo: add your logic here and delete this line
+
+	return &pb.CmdResp{}, nil
+}

+ 45 - 0
apis/cmd/internal/logic/playerfetchcsinfologic.go

@@ -0,0 +1,45 @@
+package logic
+
+import (
+	"context"
+	"google.golang.org/protobuf/types/known/structpb"
+
+	"ylink/apis/cmd/internal/svc"
+	"ylink/apis/cmd/pb"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type PlayerFetchCsInfoLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewPlayerFetchCsInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PlayerFetchCsInfoLogic {
+	return &PlayerFetchCsInfoLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+func (l *PlayerFetchCsInfoLogic) PlayerFetchCsInfo(in *pb.PlayerFetchCsInfoReq) (*pb.CmdResp, error) {
+	l.Logger.Infof("invoke PlayerFetchCsInfo func, cs_id: %s", in.CsId)
+
+	data, err := structpb.NewStruct(map[string]interface{}{
+		"cs_id":         "cs_1231",
+		"cs_nickname":   "vip客服1231",
+		"cs_avatar_url": "https://www.baidu.com",
+		"cs_signature":  "服务时间:9:30-20:30",
+		"online_status": 1,
+	})
+	if err != nil {
+		return nil, err
+	}
+	return &pb.CmdResp{
+		Code: 0,
+		Msg:  "success",
+		Data: data,
+	}, nil
+}

+ 30 - 0
apis/cmd/internal/logic/playerfetchhistorymsglogic.go

@@ -0,0 +1,30 @@
+package logic
+
+import (
+	"context"
+
+	"ylink/apis/cmd/internal/svc"
+	"ylink/apis/cmd/pb"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type PlayerFetchHistoryMsgLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewPlayerFetchHistoryMsgLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PlayerFetchHistoryMsgLogic {
+	return &PlayerFetchHistoryMsgLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+func (l *PlayerFetchHistoryMsgLogic) PlayerFetchHistoryMsg(in *pb.PlayerFetchHistoryMsgReq) (*pb.CmdResp, error) {
+	// todo: add your logic here and delete this line
+
+	return &pb.CmdResp{}, nil
+}

+ 30 - 0
apis/cmd/internal/logic/playerfetchmsglogic.go

@@ -0,0 +1,30 @@
+package logic
+
+import (
+	"context"
+
+	"ylink/apis/cmd/internal/svc"
+	"ylink/apis/cmd/pb"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type PlayerFetchMsgLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewPlayerFetchMsgLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PlayerFetchMsgLogic {
+	return &PlayerFetchMsgLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+func (l *PlayerFetchMsgLogic) PlayerFetchMsg(in *pb.PlayerFetchMsgReq) (*pb.CmdResp, error) {
+	// todo: add your logic here and delete this line
+
+	return &pb.CmdResp{}, nil
+}

+ 30 - 0
apis/cmd/internal/logic/playersendmsglogic.go

@@ -0,0 +1,30 @@
+package logic
+
+import (
+	"context"
+
+	"ylink/apis/cmd/internal/svc"
+	"ylink/apis/cmd/pb"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type PlayerSendMsgLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewPlayerSendMsgLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PlayerSendMsgLogic {
+	return &PlayerSendMsgLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+func (l *PlayerSendMsgLogic) PlayerSendMsg(in *pb.PlayerSendMsgReq) (*pb.CmdResp, error) {
+	// todo: add your logic here and delete this line
+
+	return &pb.CmdResp{}, nil
+}

+ 78 - 0
apis/cmd/internal/server/cmdserver.go

@@ -0,0 +1,78 @@
+// Code generated by goctl. DO NOT EDIT!
+// Source: cmd.proto
+
+package server
+
+import (
+	"context"
+
+	"ylink/apis/cmd/internal/logic"
+	"ylink/apis/cmd/internal/svc"
+	"ylink/apis/cmd/pb"
+)
+
+type CmdServer struct {
+	svcCtx *svc.ServiceContext
+	pb.UnimplementedCmdServer
+}
+
+func NewCmdServer(svcCtx *svc.ServiceContext) *CmdServer {
+	return &CmdServer{
+		svcCtx: svcCtx,
+	}
+}
+
+func (s *CmdServer) PlayerFetchCsInfo(ctx context.Context, in *pb.PlayerFetchCsInfoReq) (*pb.CmdResp, error) {
+	l := logic.NewPlayerFetchCsInfoLogic(ctx, s.svcCtx)
+	return l.PlayerFetchCsInfo(in)
+}
+
+func (s *CmdServer) PlayerFetchHistoryMsg(ctx context.Context, in *pb.PlayerFetchHistoryMsgReq) (*pb.CmdResp, error) {
+	l := logic.NewPlayerFetchHistoryMsgLogic(ctx, s.svcCtx)
+	return l.PlayerFetchHistoryMsg(in)
+}
+
+func (s *CmdServer) PlayerFetchMsg(ctx context.Context, in *pb.PlayerFetchMsgReq) (*pb.CmdResp, error) {
+	l := logic.NewPlayerFetchMsgLogic(ctx, s.svcCtx)
+	return l.PlayerFetchMsg(in)
+}
+
+func (s *CmdServer) PlayerSendMsg(ctx context.Context, in *pb.PlayerSendMsgReq) (*pb.CmdResp, error) {
+	l := logic.NewPlayerSendMsgLogic(ctx, s.svcCtx)
+	return l.PlayerSendMsg(in)
+}
+
+func (s *CmdServer) PlayerDisconnect(ctx context.Context, in *pb.PlayerDisconnectReq) (*pb.CmdResp, error) {
+	l := logic.NewPlayerDisconnectLogic(ctx, s.svcCtx)
+	return l.PlayerDisconnect(in)
+}
+
+func (s *CmdServer) CsFetchPlayerQueue(ctx context.Context, in *pb.CsFetchPlayerQueueReq) (*pb.CmdResp, error) {
+	l := logic.NewCsFetchPlayerQueueLogic(ctx, s.svcCtx)
+	return l.CsFetchPlayerQueue(in)
+}
+
+func (s *CmdServer) CsConnectPlayer(ctx context.Context, in *pb.CsConnectPlayerReq) (*pb.CmdResp, error) {
+	l := logic.NewCsConnectPlayerLogic(ctx, s.svcCtx)
+	return l.CsConnectPlayer(in)
+}
+
+func (s *CmdServer) CsFetchHistoryChat(ctx context.Context, in *pb.CsFetchHistoryChatReq) (*pb.CmdResp, error) {
+	l := logic.NewCsFetchHistoryChatLogic(ctx, s.svcCtx)
+	return l.CsFetchHistoryChat(in)
+}
+
+func (s *CmdServer) CsFetchHistoryMsg(ctx context.Context, in *pb.CsFetchHistoryMsgReq) (*pb.CmdResp, error) {
+	l := logic.NewCsFetchHistoryMsgLogic(ctx, s.svcCtx)
+	return l.CsFetchHistoryMsg(in)
+}
+
+func (s *CmdServer) CsFetchMsg(ctx context.Context, in *pb.CsFetchMsgReq) (*pb.CmdResp, error) {
+	l := logic.NewCsFetchMsgLogic(ctx, s.svcCtx)
+	return l.CsFetchMsg(in)
+}
+
+func (s *CmdServer) CsSendMsg(ctx context.Context, in *pb.CsSendMsgReq) (*pb.CmdResp, error) {
+	l := logic.NewCsSendMsgLogic(ctx, s.svcCtx)
+	return l.CsSendMsg(in)
+}

+ 13 - 0
apis/cmd/internal/svc/servicecontext.go

@@ -0,0 +1,13 @@
+package svc
+
+import "ylink/apis/cmd/internal/config"
+
+type ServiceContext struct {
+	Config config.Config
+}
+
+func NewServiceContext(c config.Config) *ServiceContext {
+	return &ServiceContext{
+		Config: c,
+	}
+}

+ 1006 - 0
apis/cmd/pb/cmd.pb.go

@@ -0,0 +1,1006 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// 	protoc-gen-go v1.28.0
+// 	protoc        v3.19.4
+// source: pb/cmd.proto
+
+package pb
+
+import (
+	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	structpb "google.golang.org/protobuf/types/known/structpb"
+	reflect "reflect"
+	sync "sync"
+)
+
+const (
+	// Verify that this generated code is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+	// Verify that runtime/protoimpl is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+type CmdResp struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Code int64            `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
+	Msg  string           `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
+	Data *structpb.Struct `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
+}
+
+func (x *CmdResp) Reset() {
+	*x = CmdResp{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_pb_cmd_proto_msgTypes[0]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *CmdResp) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CmdResp) ProtoMessage() {}
+
+func (x *CmdResp) ProtoReflect() protoreflect.Message {
+	mi := &file_pb_cmd_proto_msgTypes[0]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use CmdResp.ProtoReflect.Descriptor instead.
+func (*CmdResp) Descriptor() ([]byte, []int) {
+	return file_pb_cmd_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *CmdResp) GetCode() int64 {
+	if x != nil {
+		return x.Code
+	}
+	return 0
+}
+
+func (x *CmdResp) GetMsg() string {
+	if x != nil {
+		return x.Msg
+	}
+	return ""
+}
+
+func (x *CmdResp) GetData() *structpb.Struct {
+	if x != nil {
+		return x.Data
+	}
+	return nil
+}
+
+//*
+//Player Command Request Bean
+type PlayerFetchCsInfoReq struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	CsId string `protobuf:"bytes,1,opt,name=cs_id,json=csId,proto3" json:"cs_id,omitempty"`
+}
+
+func (x *PlayerFetchCsInfoReq) Reset() {
+	*x = PlayerFetchCsInfoReq{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_pb_cmd_proto_msgTypes[1]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *PlayerFetchCsInfoReq) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*PlayerFetchCsInfoReq) ProtoMessage() {}
+
+func (x *PlayerFetchCsInfoReq) ProtoReflect() protoreflect.Message {
+	mi := &file_pb_cmd_proto_msgTypes[1]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use PlayerFetchCsInfoReq.ProtoReflect.Descriptor instead.
+func (*PlayerFetchCsInfoReq) Descriptor() ([]byte, []int) {
+	return file_pb_cmd_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *PlayerFetchCsInfoReq) GetCsId() string {
+	if x != nil {
+		return x.CsId
+	}
+	return ""
+}
+
+type PlayerFetchHistoryMsgReq struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Page  int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
+	Limit int64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
+}
+
+func (x *PlayerFetchHistoryMsgReq) Reset() {
+	*x = PlayerFetchHistoryMsgReq{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_pb_cmd_proto_msgTypes[2]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *PlayerFetchHistoryMsgReq) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*PlayerFetchHistoryMsgReq) ProtoMessage() {}
+
+func (x *PlayerFetchHistoryMsgReq) ProtoReflect() protoreflect.Message {
+	mi := &file_pb_cmd_proto_msgTypes[2]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use PlayerFetchHistoryMsgReq.ProtoReflect.Descriptor instead.
+func (*PlayerFetchHistoryMsgReq) Descriptor() ([]byte, []int) {
+	return file_pb_cmd_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *PlayerFetchHistoryMsgReq) GetPage() int64 {
+	if x != nil {
+		return x.Page
+	}
+	return 0
+}
+
+func (x *PlayerFetchHistoryMsgReq) GetLimit() int64 {
+	if x != nil {
+		return x.Limit
+	}
+	return 0
+}
+
+type PlayerFetchMsgReq struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+}
+
+func (x *PlayerFetchMsgReq) Reset() {
+	*x = PlayerFetchMsgReq{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_pb_cmd_proto_msgTypes[3]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *PlayerFetchMsgReq) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*PlayerFetchMsgReq) ProtoMessage() {}
+
+func (x *PlayerFetchMsgReq) ProtoReflect() protoreflect.Message {
+	mi := &file_pb_cmd_proto_msgTypes[3]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use PlayerFetchMsgReq.ProtoReflect.Descriptor instead.
+func (*PlayerFetchMsgReq) Descriptor() ([]byte, []int) {
+	return file_pb_cmd_proto_rawDescGZIP(), []int{3}
+}
+
+type PlayerSendMsgReq struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Content string `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"`
+	Pic     string `protobuf:"bytes,2,opt,name=pic,proto3" json:"pic,omitempty"`
+}
+
+func (x *PlayerSendMsgReq) Reset() {
+	*x = PlayerSendMsgReq{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_pb_cmd_proto_msgTypes[4]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *PlayerSendMsgReq) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*PlayerSendMsgReq) ProtoMessage() {}
+
+func (x *PlayerSendMsgReq) ProtoReflect() protoreflect.Message {
+	mi := &file_pb_cmd_proto_msgTypes[4]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use PlayerSendMsgReq.ProtoReflect.Descriptor instead.
+func (*PlayerSendMsgReq) Descriptor() ([]byte, []int) {
+	return file_pb_cmd_proto_rawDescGZIP(), []int{4}
+}
+
+func (x *PlayerSendMsgReq) GetContent() string {
+	if x != nil {
+		return x.Content
+	}
+	return ""
+}
+
+func (x *PlayerSendMsgReq) GetPic() string {
+	if x != nil {
+		return x.Pic
+	}
+	return ""
+}
+
+type PlayerDisconnectReq struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+}
+
+func (x *PlayerDisconnectReq) Reset() {
+	*x = PlayerDisconnectReq{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_pb_cmd_proto_msgTypes[5]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *PlayerDisconnectReq) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*PlayerDisconnectReq) ProtoMessage() {}
+
+func (x *PlayerDisconnectReq) ProtoReflect() protoreflect.Message {
+	mi := &file_pb_cmd_proto_msgTypes[5]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use PlayerDisconnectReq.ProtoReflect.Descriptor instead.
+func (*PlayerDisconnectReq) Descriptor() ([]byte, []int) {
+	return file_pb_cmd_proto_rawDescGZIP(), []int{5}
+}
+
+//*
+//Cs Command Request Bean
+type CsFetchPlayerQueueReq struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Limit int64 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"`
+}
+
+func (x *CsFetchPlayerQueueReq) Reset() {
+	*x = CsFetchPlayerQueueReq{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_pb_cmd_proto_msgTypes[6]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *CsFetchPlayerQueueReq) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CsFetchPlayerQueueReq) ProtoMessage() {}
+
+func (x *CsFetchPlayerQueueReq) ProtoReflect() protoreflect.Message {
+	mi := &file_pb_cmd_proto_msgTypes[6]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use CsFetchPlayerQueueReq.ProtoReflect.Descriptor instead.
+func (*CsFetchPlayerQueueReq) Descriptor() ([]byte, []int) {
+	return file_pb_cmd_proto_rawDescGZIP(), []int{6}
+}
+
+func (x *CsFetchPlayerQueueReq) GetLimit() int64 {
+	if x != nil {
+		return x.Limit
+	}
+	return 0
+}
+
+type CsConnectPlayerReq struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	PlayerId string `protobuf:"bytes,1,opt,name=player_id,json=playerId,proto3" json:"player_id,omitempty"`
+	GameId   string `protobuf:"bytes,2,opt,name=game_id,json=gameId,proto3" json:"game_id,omitempty"`
+}
+
+func (x *CsConnectPlayerReq) Reset() {
+	*x = CsConnectPlayerReq{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_pb_cmd_proto_msgTypes[7]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *CsConnectPlayerReq) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CsConnectPlayerReq) ProtoMessage() {}
+
+func (x *CsConnectPlayerReq) ProtoReflect() protoreflect.Message {
+	mi := &file_pb_cmd_proto_msgTypes[7]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use CsConnectPlayerReq.ProtoReflect.Descriptor instead.
+func (*CsConnectPlayerReq) Descriptor() ([]byte, []int) {
+	return file_pb_cmd_proto_rawDescGZIP(), []int{7}
+}
+
+func (x *CsConnectPlayerReq) GetPlayerId() string {
+	if x != nil {
+		return x.PlayerId
+	}
+	return ""
+}
+
+func (x *CsConnectPlayerReq) GetGameId() string {
+	if x != nil {
+		return x.GameId
+	}
+	return ""
+}
+
+type CsFetchHistoryChatReq struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Page  int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
+	Limit int64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
+}
+
+func (x *CsFetchHistoryChatReq) Reset() {
+	*x = CsFetchHistoryChatReq{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_pb_cmd_proto_msgTypes[8]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *CsFetchHistoryChatReq) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CsFetchHistoryChatReq) ProtoMessage() {}
+
+func (x *CsFetchHistoryChatReq) ProtoReflect() protoreflect.Message {
+	mi := &file_pb_cmd_proto_msgTypes[8]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use CsFetchHistoryChatReq.ProtoReflect.Descriptor instead.
+func (*CsFetchHistoryChatReq) Descriptor() ([]byte, []int) {
+	return file_pb_cmd_proto_rawDescGZIP(), []int{8}
+}
+
+func (x *CsFetchHistoryChatReq) GetPage() int64 {
+	if x != nil {
+		return x.Page
+	}
+	return 0
+}
+
+func (x *CsFetchHistoryChatReq) GetLimit() int64 {
+	if x != nil {
+		return x.Limit
+	}
+	return 0
+}
+
+type CsFetchHistoryMsgReq struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	PlayerId string `protobuf:"bytes,1,opt,name=player_id,json=playerId,proto3" json:"player_id,omitempty"`
+	GameId   string `protobuf:"bytes,2,opt,name=game_id,json=gameId,proto3" json:"game_id,omitempty"`
+	Page     int64  `protobuf:"varint,3,opt,name=page,proto3" json:"page,omitempty"`
+	Limit    int64  `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"`
+}
+
+func (x *CsFetchHistoryMsgReq) Reset() {
+	*x = CsFetchHistoryMsgReq{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_pb_cmd_proto_msgTypes[9]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *CsFetchHistoryMsgReq) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CsFetchHistoryMsgReq) ProtoMessage() {}
+
+func (x *CsFetchHistoryMsgReq) ProtoReflect() protoreflect.Message {
+	mi := &file_pb_cmd_proto_msgTypes[9]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use CsFetchHistoryMsgReq.ProtoReflect.Descriptor instead.
+func (*CsFetchHistoryMsgReq) Descriptor() ([]byte, []int) {
+	return file_pb_cmd_proto_rawDescGZIP(), []int{9}
+}
+
+func (x *CsFetchHistoryMsgReq) GetPlayerId() string {
+	if x != nil {
+		return x.PlayerId
+	}
+	return ""
+}
+
+func (x *CsFetchHistoryMsgReq) GetGameId() string {
+	if x != nil {
+		return x.GameId
+	}
+	return ""
+}
+
+func (x *CsFetchHistoryMsgReq) GetPage() int64 {
+	if x != nil {
+		return x.Page
+	}
+	return 0
+}
+
+func (x *CsFetchHistoryMsgReq) GetLimit() int64 {
+	if x != nil {
+		return x.Limit
+	}
+	return 0
+}
+
+type CsFetchMsgReq struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	PlayerId string `protobuf:"bytes,1,opt,name=player_id,json=playerId,proto3" json:"player_id,omitempty"`
+	GameId   string `protobuf:"bytes,2,opt,name=game_id,json=gameId,proto3" json:"game_id,omitempty"`
+}
+
+func (x *CsFetchMsgReq) Reset() {
+	*x = CsFetchMsgReq{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_pb_cmd_proto_msgTypes[10]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *CsFetchMsgReq) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CsFetchMsgReq) ProtoMessage() {}
+
+func (x *CsFetchMsgReq) ProtoReflect() protoreflect.Message {
+	mi := &file_pb_cmd_proto_msgTypes[10]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use CsFetchMsgReq.ProtoReflect.Descriptor instead.
+func (*CsFetchMsgReq) Descriptor() ([]byte, []int) {
+	return file_pb_cmd_proto_rawDescGZIP(), []int{10}
+}
+
+func (x *CsFetchMsgReq) GetPlayerId() string {
+	if x != nil {
+		return x.PlayerId
+	}
+	return ""
+}
+
+func (x *CsFetchMsgReq) GetGameId() string {
+	if x != nil {
+		return x.GameId
+	}
+	return ""
+}
+
+type CsSendMsgReq struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	PlayerId string `protobuf:"bytes,1,opt,name=player_id,json=playerId,proto3" json:"player_id,omitempty"`
+	GameId   string `protobuf:"bytes,2,opt,name=game_id,json=gameId,proto3" json:"game_id,omitempty"`
+	Content  string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"`
+	Pic      string `protobuf:"bytes,4,opt,name=pic,proto3" json:"pic,omitempty"`
+}
+
+func (x *CsSendMsgReq) Reset() {
+	*x = CsSendMsgReq{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_pb_cmd_proto_msgTypes[11]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *CsSendMsgReq) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CsSendMsgReq) ProtoMessage() {}
+
+func (x *CsSendMsgReq) ProtoReflect() protoreflect.Message {
+	mi := &file_pb_cmd_proto_msgTypes[11]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use CsSendMsgReq.ProtoReflect.Descriptor instead.
+func (*CsSendMsgReq) Descriptor() ([]byte, []int) {
+	return file_pb_cmd_proto_rawDescGZIP(), []int{11}
+}
+
+func (x *CsSendMsgReq) GetPlayerId() string {
+	if x != nil {
+		return x.PlayerId
+	}
+	return ""
+}
+
+func (x *CsSendMsgReq) GetGameId() string {
+	if x != nil {
+		return x.GameId
+	}
+	return ""
+}
+
+func (x *CsSendMsgReq) GetContent() string {
+	if x != nil {
+		return x.Content
+	}
+	return ""
+}
+
+func (x *CsSendMsgReq) GetPic() string {
+	if x != nil {
+		return x.Pic
+	}
+	return ""
+}
+
+var File_pb_cmd_proto protoreflect.FileDescriptor
+
+var file_pb_cmd_proto_rawDesc = []byte{
+	0x0a, 0x0c, 0x70, 0x62, 0x2f, 0x63, 0x6d, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02,
+	0x70, 0x62, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+	0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+	0x22, 0x5c, 0x0a, 0x07, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x63,
+	0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12,
+	0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73,
+	0x67, 0x12, 0x2b, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32,
+	0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
+	0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x2b,
+	0x0a, 0x14, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x46, 0x65, 0x74, 0x63, 0x68, 0x43, 0x73, 0x49,
+	0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x12, 0x13, 0x0a, 0x05, 0x63, 0x73, 0x5f, 0x69, 0x64, 0x18,
+	0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x73, 0x49, 0x64, 0x22, 0x44, 0x0a, 0x18, 0x50,
+	0x6c, 0x61, 0x79, 0x65, 0x72, 0x46, 0x65, 0x74, 0x63, 0x68, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72,
+	0x79, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18,
+	0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c,
+	0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69,
+	0x74, 0x22, 0x13, 0x0a, 0x11, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x46, 0x65, 0x74, 0x63, 0x68,
+	0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x22, 0x3e, 0x0a, 0x10, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72,
+	0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f,
+	0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e,
+	0x74, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x03, 0x70, 0x69, 0x63, 0x22, 0x15, 0x0a, 0x13, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72,
+	0x44, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x22, 0x2d, 0x0a,
+	0x15, 0x43, 0x73, 0x46, 0x65, 0x74, 0x63, 0x68, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x51, 0x75,
+	0x65, 0x75, 0x65, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18,
+	0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x4a, 0x0a, 0x12,
+	0x43, 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x52,
+	0x65, 0x71, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18,
+	0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x64, 0x12,
+	0x17, 0x0a, 0x07, 0x67, 0x61, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x06, 0x67, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x22, 0x41, 0x0a, 0x15, 0x43, 0x73, 0x46, 0x65,
+	0x74, 0x63, 0x68, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x68, 0x61, 0x74, 0x52, 0x65,
+	0x71, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52,
+	0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02,
+	0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x76, 0x0a, 0x14, 0x43,
+	0x73, 0x46, 0x65, 0x74, 0x63, 0x68, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x4d, 0x73, 0x67,
+	0x52, 0x65, 0x71, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x5f, 0x69, 0x64,
+	0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x64,
+	0x12, 0x17, 0x0a, 0x07, 0x67, 0x61, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x06, 0x67, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67,
+	0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a,
+	0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69,
+	0x6d, 0x69, 0x74, 0x22, 0x45, 0x0a, 0x0d, 0x43, 0x73, 0x46, 0x65, 0x74, 0x63, 0x68, 0x4d, 0x73,
+	0x67, 0x52, 0x65, 0x71, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x5f, 0x69,
+	0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49,
+	0x64, 0x12, 0x17, 0x0a, 0x07, 0x67, 0x61, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x06, 0x67, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x22, 0x70, 0x0a, 0x0c, 0x43, 0x73,
+	0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6c,
+	0x61, 0x79, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70,
+	0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x67, 0x61, 0x6d, 0x65, 0x5f,
+	0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x61, 0x6d, 0x65, 0x49, 0x64,
+	0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69,
+	0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x69, 0x63, 0x32, 0xf3, 0x04, 0x0a,
+	0x03, 0x43, 0x6d, 0x64, 0x12, 0x3a, 0x0a, 0x11, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x46, 0x65,
+	0x74, 0x63, 0x68, 0x43, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x50,
+	0x6c, 0x61, 0x79, 0x65, 0x72, 0x46, 0x65, 0x74, 0x63, 0x68, 0x43, 0x73, 0x49, 0x6e, 0x66, 0x6f,
+	0x52, 0x65, 0x71, 0x1a, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x70,
+	0x12, 0x42, 0x0a, 0x15, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x46, 0x65, 0x74, 0x63, 0x68, 0x48,
+	0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x4d, 0x73, 0x67, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x50,
+	0x6c, 0x61, 0x79, 0x65, 0x72, 0x46, 0x65, 0x74, 0x63, 0x68, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72,
+	0x79, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6d, 0x64,
+	0x52, 0x65, 0x73, 0x70, 0x12, 0x34, 0x0a, 0x0e, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x46, 0x65,
+	0x74, 0x63, 0x68, 0x4d, 0x73, 0x67, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x79,
+	0x65, 0x72, 0x46, 0x65, 0x74, 0x63, 0x68, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x0b, 0x2e,
+	0x70, 0x62, 0x2e, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x32, 0x0a, 0x0d, 0x70, 0x6c,
+	0x61, 0x79, 0x65, 0x72, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x12, 0x14, 0x2e, 0x70, 0x62,
+	0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x52, 0x65,
+	0x71, 0x1a, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x38,
+	0x0a, 0x10, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65,
+	0x63, 0x74, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x69,
+	0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x0b, 0x2e, 0x70, 0x62,
+	0x2e, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3c, 0x0a, 0x12, 0x63, 0x73, 0x46, 0x65,
+	0x74, 0x63, 0x68, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x51, 0x75, 0x65, 0x75, 0x65, 0x12, 0x19,
+	0x2e, 0x70, 0x62, 0x2e, 0x43, 0x73, 0x46, 0x65, 0x74, 0x63, 0x68, 0x50, 0x6c, 0x61, 0x79, 0x65,
+	0x72, 0x51, 0x75, 0x65, 0x75, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x43,
+	0x6d, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x36, 0x0a, 0x0f, 0x63, 0x73, 0x43, 0x6f, 0x6e, 0x6e,
+	0x65, 0x63, 0x74, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x43,
+	0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x52, 0x65,
+	0x71, 0x1a, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3c,
+	0x0a, 0x12, 0x63, 0x73, 0x46, 0x65, 0x74, 0x63, 0x68, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79,
+	0x43, 0x68, 0x61, 0x74, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x73, 0x46, 0x65, 0x74, 0x63,
+	0x68, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x68, 0x61, 0x74, 0x52, 0x65, 0x71, 0x1a,
+	0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3a, 0x0a, 0x11,
+	0x63, 0x73, 0x46, 0x65, 0x74, 0x63, 0x68, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x4d, 0x73,
+	0x67, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x73, 0x46, 0x65, 0x74, 0x63, 0x68, 0x48, 0x69,
+	0x73, 0x74, 0x6f, 0x72, 0x79, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x0b, 0x2e, 0x70, 0x62,
+	0x2e, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2c, 0x0a, 0x0a, 0x63, 0x73, 0x46, 0x65,
+	0x74, 0x63, 0x68, 0x4d, 0x73, 0x67, 0x12, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x73, 0x46, 0x65,
+	0x74, 0x63, 0x68, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x43,
+	0x6d, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2a, 0x0a, 0x09, 0x63, 0x73, 0x53, 0x65, 0x6e, 0x64,
+	0x4d, 0x73, 0x67, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x73, 0x53, 0x65, 0x6e, 0x64, 0x4d,
+	0x73, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6d, 0x64, 0x52, 0x65,
+	0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
+	0x6f, 0x33,
+}
+
+var (
+	file_pb_cmd_proto_rawDescOnce sync.Once
+	file_pb_cmd_proto_rawDescData = file_pb_cmd_proto_rawDesc
+)
+
+func file_pb_cmd_proto_rawDescGZIP() []byte {
+	file_pb_cmd_proto_rawDescOnce.Do(func() {
+		file_pb_cmd_proto_rawDescData = protoimpl.X.CompressGZIP(file_pb_cmd_proto_rawDescData)
+	})
+	return file_pb_cmd_proto_rawDescData
+}
+
+var file_pb_cmd_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
+var file_pb_cmd_proto_goTypes = []interface{}{
+	(*CmdResp)(nil),                  // 0: pb.CmdResp
+	(*PlayerFetchCsInfoReq)(nil),     // 1: pb.PlayerFetchCsInfoReq
+	(*PlayerFetchHistoryMsgReq)(nil), // 2: pb.PlayerFetchHistoryMsgReq
+	(*PlayerFetchMsgReq)(nil),        // 3: pb.PlayerFetchMsgReq
+	(*PlayerSendMsgReq)(nil),         // 4: pb.PlayerSendMsgReq
+	(*PlayerDisconnectReq)(nil),      // 5: pb.PlayerDisconnectReq
+	(*CsFetchPlayerQueueReq)(nil),    // 6: pb.CsFetchPlayerQueueReq
+	(*CsConnectPlayerReq)(nil),       // 7: pb.CsConnectPlayerReq
+	(*CsFetchHistoryChatReq)(nil),    // 8: pb.CsFetchHistoryChatReq
+	(*CsFetchHistoryMsgReq)(nil),     // 9: pb.CsFetchHistoryMsgReq
+	(*CsFetchMsgReq)(nil),            // 10: pb.CsFetchMsgReq
+	(*CsSendMsgReq)(nil),             // 11: pb.CsSendMsgReq
+	(*structpb.Struct)(nil),          // 12: google.protobuf.Struct
+}
+var file_pb_cmd_proto_depIdxs = []int32{
+	12, // 0: pb.CmdResp.data:type_name -> google.protobuf.Struct
+	1,  // 1: pb.Cmd.playerFetchCsInfo:input_type -> pb.PlayerFetchCsInfoReq
+	2,  // 2: pb.Cmd.playerFetchHistoryMsg:input_type -> pb.PlayerFetchHistoryMsgReq
+	3,  // 3: pb.Cmd.playerFetchMsg:input_type -> pb.PlayerFetchMsgReq
+	4,  // 4: pb.Cmd.playerSendMsg:input_type -> pb.PlayerSendMsgReq
+	5,  // 5: pb.Cmd.playerDisconnect:input_type -> pb.PlayerDisconnectReq
+	6,  // 6: pb.Cmd.csFetchPlayerQueue:input_type -> pb.CsFetchPlayerQueueReq
+	7,  // 7: pb.Cmd.csConnectPlayer:input_type -> pb.CsConnectPlayerReq
+	8,  // 8: pb.Cmd.csFetchHistoryChat:input_type -> pb.CsFetchHistoryChatReq
+	9,  // 9: pb.Cmd.csFetchHistoryMsg:input_type -> pb.CsFetchHistoryMsgReq
+	10, // 10: pb.Cmd.csFetchMsg:input_type -> pb.CsFetchMsgReq
+	11, // 11: pb.Cmd.csSendMsg:input_type -> pb.CsSendMsgReq
+	0,  // 12: pb.Cmd.playerFetchCsInfo:output_type -> pb.CmdResp
+	0,  // 13: pb.Cmd.playerFetchHistoryMsg:output_type -> pb.CmdResp
+	0,  // 14: pb.Cmd.playerFetchMsg:output_type -> pb.CmdResp
+	0,  // 15: pb.Cmd.playerSendMsg:output_type -> pb.CmdResp
+	0,  // 16: pb.Cmd.playerDisconnect:output_type -> pb.CmdResp
+	0,  // 17: pb.Cmd.csFetchPlayerQueue:output_type -> pb.CmdResp
+	0,  // 18: pb.Cmd.csConnectPlayer:output_type -> pb.CmdResp
+	0,  // 19: pb.Cmd.csFetchHistoryChat:output_type -> pb.CmdResp
+	0,  // 20: pb.Cmd.csFetchHistoryMsg:output_type -> pb.CmdResp
+	0,  // 21: pb.Cmd.csFetchMsg:output_type -> pb.CmdResp
+	0,  // 22: pb.Cmd.csSendMsg:output_type -> pb.CmdResp
+	12, // [12:23] is the sub-list for method output_type
+	1,  // [1:12] is the sub-list for method input_type
+	1,  // [1:1] is the sub-list for extension type_name
+	1,  // [1:1] is the sub-list for extension extendee
+	0,  // [0:1] is the sub-list for field type_name
+}
+
+func init() { file_pb_cmd_proto_init() }
+func file_pb_cmd_proto_init() {
+	if File_pb_cmd_proto != nil {
+		return
+	}
+	if !protoimpl.UnsafeEnabled {
+		file_pb_cmd_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*CmdResp); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_pb_cmd_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*PlayerFetchCsInfoReq); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_pb_cmd_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*PlayerFetchHistoryMsgReq); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_pb_cmd_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*PlayerFetchMsgReq); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_pb_cmd_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*PlayerSendMsgReq); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_pb_cmd_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*PlayerDisconnectReq); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_pb_cmd_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*CsFetchPlayerQueueReq); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_pb_cmd_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*CsConnectPlayerReq); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_pb_cmd_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*CsFetchHistoryChatReq); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_pb_cmd_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*CsFetchHistoryMsgReq); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_pb_cmd_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*CsFetchMsgReq); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_pb_cmd_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*CsSendMsgReq); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+	}
+	type x struct{}
+	out := protoimpl.TypeBuilder{
+		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+			RawDescriptor: file_pb_cmd_proto_rawDesc,
+			NumEnums:      0,
+			NumMessages:   12,
+			NumExtensions: 0,
+			NumServices:   1,
+		},
+		GoTypes:           file_pb_cmd_proto_goTypes,
+		DependencyIndexes: file_pb_cmd_proto_depIdxs,
+		MessageInfos:      file_pb_cmd_proto_msgTypes,
+	}.Build()
+	File_pb_cmd_proto = out.File
+	file_pb_cmd_proto_rawDesc = nil
+	file_pb_cmd_proto_goTypes = nil
+	file_pb_cmd_proto_depIdxs = nil
+}

+ 69 - 17
apis/cmd/pb/cmd.proto

@@ -6,28 +6,80 @@ package pb;
 
 import "google/protobuf/struct.proto";
 
-message CmdReq{
-  google.protobuf.Struct data = 1;
-}
-
 message CmdResp{
   int64 code = 1;
   string msg = 2;
   google.protobuf.Struct data = 3;
 }
 
+/**
+Player Command Request Bean
+ */
+message PlayerFetchCsInfoReq{
+  string cs_id = 1;
+}
+
+message PlayerFetchHistoryMsgReq{
+  int64 page = 1;
+  int64 limit = 2;
+}
+
+message PlayerFetchMsgReq{}
+
+message PlayerSendMsgReq{
+  string content = 1;
+  string pic = 2;
+}
+
+message PlayerDisconnectReq{}
+
+/**
+Cs Command Request Bean
+ */
+message CsFetchPlayerQueueReq{
+  int64 limit = 1;
+}
+
+message CsConnectPlayerReq{
+  string player_id = 1;
+  string game_id = 2;
+}
+
+message CsFetchHistoryChatReq{
+  int64 page = 1;
+  int64 limit = 2;
+}
+
+message CsFetchHistoryMsgReq{
+  string player_id = 1;
+  string game_id = 2;
+  int64 page = 3;
+  int64 limit = 4;
+}
+
+message CsFetchMsgReq{
+  string player_id = 1;
+  string game_id = 2;
+}
+
+message CsSendMsgReq{
+  string player_id = 1;
+  string game_id = 2;
+  string content = 3;
+  string pic = 4;
+}
+
 service Cmd {
-  rpc playerFetchCsInfo (CmdReq) returns (CmdResp);
-  rpc playerFetchHistoryMsg (CmdReq) returns (CmdResp);
-  rpc playerFetchMsg (CmdReq) returns (CmdResp);
-  rpc playerSendMsg (CmdReq) returns (CmdResp);
-  rpc playerDisconnect (CmdReq) returns (CmdResp);
-
-  rpc csFetchPlayerInfo (CmdReq) returns (CmdResp);
-  rpc csFetchPlayerQueue (CmdReq) returns (CmdResp);
-  rpc csConnectPlayer (CmdReq) returns (CmdResp);
-  rpc csFetchHistoryChat (CmdReq) returns (CmdResp);
-  rpc csFetchHistoryMsg (CmdReq) returns (CmdResp);
-  rpc csFetchMsg (CmdReq) returns (CmdResp);
-  rpc csSendMsg (CmdReq) returns (CmdResp);
+  rpc playerFetchCsInfo (PlayerFetchCsInfoReq) returns (CmdResp);
+  rpc playerFetchHistoryMsg (PlayerFetchHistoryMsgReq) returns (CmdResp);
+  rpc playerFetchMsg (PlayerFetchMsgReq) returns (CmdResp);
+  rpc playerSendMsg (PlayerSendMsgReq) returns (CmdResp);
+  rpc playerDisconnect (PlayerDisconnectReq) returns (CmdResp);
+
+  rpc csFetchPlayerQueue (CsFetchPlayerQueueReq) returns (CmdResp);
+  rpc csConnectPlayer (CsConnectPlayerReq) returns (CmdResp);
+  rpc csFetchHistoryChat (CsFetchHistoryChatReq) returns (CmdResp);
+  rpc csFetchHistoryMsg (CsFetchHistoryMsgReq) returns (CmdResp);
+  rpc csFetchMsg (CsFetchMsgReq) returns (CmdResp);
+  rpc csSendMsg (CsSendMsgReq) returns (CmdResp);
 }

+ 465 - 0
apis/cmd/pb/cmd_grpc.pb.go

@@ -0,0 +1,465 @@
+// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
+// versions:
+// - protoc-gen-go-grpc v1.2.0
+// - protoc             v3.19.4
+// source: pb/cmd.proto
+
+package pb
+
+import (
+	context "context"
+	grpc "google.golang.org/grpc"
+	codes "google.golang.org/grpc/codes"
+	status "google.golang.org/grpc/status"
+)
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the grpc package it is being compiled against.
+// Requires gRPC-Go v1.32.0 or later.
+const _ = grpc.SupportPackageIsVersion7
+
+// CmdClient is the client API for Cmd service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
+type CmdClient interface {
+	PlayerFetchCsInfo(ctx context.Context, in *PlayerFetchCsInfoReq, opts ...grpc.CallOption) (*CmdResp, error)
+	PlayerFetchHistoryMsg(ctx context.Context, in *PlayerFetchHistoryMsgReq, opts ...grpc.CallOption) (*CmdResp, error)
+	PlayerFetchMsg(ctx context.Context, in *PlayerFetchMsgReq, opts ...grpc.CallOption) (*CmdResp, error)
+	PlayerSendMsg(ctx context.Context, in *PlayerSendMsgReq, opts ...grpc.CallOption) (*CmdResp, error)
+	PlayerDisconnect(ctx context.Context, in *PlayerDisconnectReq, opts ...grpc.CallOption) (*CmdResp, error)
+	CsFetchPlayerQueue(ctx context.Context, in *CsFetchPlayerQueueReq, opts ...grpc.CallOption) (*CmdResp, error)
+	CsConnectPlayer(ctx context.Context, in *CsConnectPlayerReq, opts ...grpc.CallOption) (*CmdResp, error)
+	CsFetchHistoryChat(ctx context.Context, in *CsFetchHistoryChatReq, opts ...grpc.CallOption) (*CmdResp, error)
+	CsFetchHistoryMsg(ctx context.Context, in *CsFetchHistoryMsgReq, opts ...grpc.CallOption) (*CmdResp, error)
+	CsFetchMsg(ctx context.Context, in *CsFetchMsgReq, opts ...grpc.CallOption) (*CmdResp, error)
+	CsSendMsg(ctx context.Context, in *CsSendMsgReq, opts ...grpc.CallOption) (*CmdResp, error)
+}
+
+type cmdClient struct {
+	cc grpc.ClientConnInterface
+}
+
+func NewCmdClient(cc grpc.ClientConnInterface) CmdClient {
+	return &cmdClient{cc}
+}
+
+func (c *cmdClient) PlayerFetchCsInfo(ctx context.Context, in *PlayerFetchCsInfoReq, opts ...grpc.CallOption) (*CmdResp, error) {
+	out := new(CmdResp)
+	err := c.cc.Invoke(ctx, "/pb.Cmd/playerFetchCsInfo", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *cmdClient) PlayerFetchHistoryMsg(ctx context.Context, in *PlayerFetchHistoryMsgReq, opts ...grpc.CallOption) (*CmdResp, error) {
+	out := new(CmdResp)
+	err := c.cc.Invoke(ctx, "/pb.Cmd/playerFetchHistoryMsg", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *cmdClient) PlayerFetchMsg(ctx context.Context, in *PlayerFetchMsgReq, opts ...grpc.CallOption) (*CmdResp, error) {
+	out := new(CmdResp)
+	err := c.cc.Invoke(ctx, "/pb.Cmd/playerFetchMsg", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *cmdClient) PlayerSendMsg(ctx context.Context, in *PlayerSendMsgReq, opts ...grpc.CallOption) (*CmdResp, error) {
+	out := new(CmdResp)
+	err := c.cc.Invoke(ctx, "/pb.Cmd/playerSendMsg", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *cmdClient) PlayerDisconnect(ctx context.Context, in *PlayerDisconnectReq, opts ...grpc.CallOption) (*CmdResp, error) {
+	out := new(CmdResp)
+	err := c.cc.Invoke(ctx, "/pb.Cmd/playerDisconnect", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *cmdClient) CsFetchPlayerQueue(ctx context.Context, in *CsFetchPlayerQueueReq, opts ...grpc.CallOption) (*CmdResp, error) {
+	out := new(CmdResp)
+	err := c.cc.Invoke(ctx, "/pb.Cmd/csFetchPlayerQueue", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *cmdClient) CsConnectPlayer(ctx context.Context, in *CsConnectPlayerReq, opts ...grpc.CallOption) (*CmdResp, error) {
+	out := new(CmdResp)
+	err := c.cc.Invoke(ctx, "/pb.Cmd/csConnectPlayer", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *cmdClient) CsFetchHistoryChat(ctx context.Context, in *CsFetchHistoryChatReq, opts ...grpc.CallOption) (*CmdResp, error) {
+	out := new(CmdResp)
+	err := c.cc.Invoke(ctx, "/pb.Cmd/csFetchHistoryChat", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *cmdClient) CsFetchHistoryMsg(ctx context.Context, in *CsFetchHistoryMsgReq, opts ...grpc.CallOption) (*CmdResp, error) {
+	out := new(CmdResp)
+	err := c.cc.Invoke(ctx, "/pb.Cmd/csFetchHistoryMsg", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *cmdClient) CsFetchMsg(ctx context.Context, in *CsFetchMsgReq, opts ...grpc.CallOption) (*CmdResp, error) {
+	out := new(CmdResp)
+	err := c.cc.Invoke(ctx, "/pb.Cmd/csFetchMsg", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *cmdClient) CsSendMsg(ctx context.Context, in *CsSendMsgReq, opts ...grpc.CallOption) (*CmdResp, error) {
+	out := new(CmdResp)
+	err := c.cc.Invoke(ctx, "/pb.Cmd/csSendMsg", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+// CmdServer is the server API for Cmd service.
+// All implementations must embed UnimplementedCmdServer
+// for forward compatibility
+type CmdServer interface {
+	PlayerFetchCsInfo(context.Context, *PlayerFetchCsInfoReq) (*CmdResp, error)
+	PlayerFetchHistoryMsg(context.Context, *PlayerFetchHistoryMsgReq) (*CmdResp, error)
+	PlayerFetchMsg(context.Context, *PlayerFetchMsgReq) (*CmdResp, error)
+	PlayerSendMsg(context.Context, *PlayerSendMsgReq) (*CmdResp, error)
+	PlayerDisconnect(context.Context, *PlayerDisconnectReq) (*CmdResp, error)
+	CsFetchPlayerQueue(context.Context, *CsFetchPlayerQueueReq) (*CmdResp, error)
+	CsConnectPlayer(context.Context, *CsConnectPlayerReq) (*CmdResp, error)
+	CsFetchHistoryChat(context.Context, *CsFetchHistoryChatReq) (*CmdResp, error)
+	CsFetchHistoryMsg(context.Context, *CsFetchHistoryMsgReq) (*CmdResp, error)
+	CsFetchMsg(context.Context, *CsFetchMsgReq) (*CmdResp, error)
+	CsSendMsg(context.Context, *CsSendMsgReq) (*CmdResp, error)
+	mustEmbedUnimplementedCmdServer()
+}
+
+// UnimplementedCmdServer must be embedded to have forward compatible implementations.
+type UnimplementedCmdServer struct {
+}
+
+func (UnimplementedCmdServer) PlayerFetchCsInfo(context.Context, *PlayerFetchCsInfoReq) (*CmdResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method PlayerFetchCsInfo not implemented")
+}
+func (UnimplementedCmdServer) PlayerFetchHistoryMsg(context.Context, *PlayerFetchHistoryMsgReq) (*CmdResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method PlayerFetchHistoryMsg not implemented")
+}
+func (UnimplementedCmdServer) PlayerFetchMsg(context.Context, *PlayerFetchMsgReq) (*CmdResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method PlayerFetchMsg not implemented")
+}
+func (UnimplementedCmdServer) PlayerSendMsg(context.Context, *PlayerSendMsgReq) (*CmdResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method PlayerSendMsg not implemented")
+}
+func (UnimplementedCmdServer) PlayerDisconnect(context.Context, *PlayerDisconnectReq) (*CmdResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method PlayerDisconnect not implemented")
+}
+func (UnimplementedCmdServer) CsFetchPlayerQueue(context.Context, *CsFetchPlayerQueueReq) (*CmdResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method CsFetchPlayerQueue not implemented")
+}
+func (UnimplementedCmdServer) CsConnectPlayer(context.Context, *CsConnectPlayerReq) (*CmdResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method CsConnectPlayer not implemented")
+}
+func (UnimplementedCmdServer) CsFetchHistoryChat(context.Context, *CsFetchHistoryChatReq) (*CmdResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method CsFetchHistoryChat not implemented")
+}
+func (UnimplementedCmdServer) CsFetchHistoryMsg(context.Context, *CsFetchHistoryMsgReq) (*CmdResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method CsFetchHistoryMsg not implemented")
+}
+func (UnimplementedCmdServer) CsFetchMsg(context.Context, *CsFetchMsgReq) (*CmdResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method CsFetchMsg not implemented")
+}
+func (UnimplementedCmdServer) CsSendMsg(context.Context, *CsSendMsgReq) (*CmdResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method CsSendMsg not implemented")
+}
+func (UnimplementedCmdServer) mustEmbedUnimplementedCmdServer() {}
+
+// UnsafeCmdServer may be embedded to opt out of forward compatibility for this service.
+// Use of this interface is not recommended, as added methods to CmdServer will
+// result in compilation errors.
+type UnsafeCmdServer interface {
+	mustEmbedUnimplementedCmdServer()
+}
+
+func RegisterCmdServer(s grpc.ServiceRegistrar, srv CmdServer) {
+	s.RegisterService(&Cmd_ServiceDesc, srv)
+}
+
+func _Cmd_PlayerFetchCsInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(PlayerFetchCsInfoReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(CmdServer).PlayerFetchCsInfo(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/pb.Cmd/playerFetchCsInfo",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(CmdServer).PlayerFetchCsInfo(ctx, req.(*PlayerFetchCsInfoReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _Cmd_PlayerFetchHistoryMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(PlayerFetchHistoryMsgReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(CmdServer).PlayerFetchHistoryMsg(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/pb.Cmd/playerFetchHistoryMsg",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(CmdServer).PlayerFetchHistoryMsg(ctx, req.(*PlayerFetchHistoryMsgReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _Cmd_PlayerFetchMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(PlayerFetchMsgReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(CmdServer).PlayerFetchMsg(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/pb.Cmd/playerFetchMsg",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(CmdServer).PlayerFetchMsg(ctx, req.(*PlayerFetchMsgReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _Cmd_PlayerSendMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(PlayerSendMsgReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(CmdServer).PlayerSendMsg(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/pb.Cmd/playerSendMsg",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(CmdServer).PlayerSendMsg(ctx, req.(*PlayerSendMsgReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _Cmd_PlayerDisconnect_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(PlayerDisconnectReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(CmdServer).PlayerDisconnect(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/pb.Cmd/playerDisconnect",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(CmdServer).PlayerDisconnect(ctx, req.(*PlayerDisconnectReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _Cmd_CsFetchPlayerQueue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(CsFetchPlayerQueueReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(CmdServer).CsFetchPlayerQueue(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/pb.Cmd/csFetchPlayerQueue",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(CmdServer).CsFetchPlayerQueue(ctx, req.(*CsFetchPlayerQueueReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _Cmd_CsConnectPlayer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(CsConnectPlayerReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(CmdServer).CsConnectPlayer(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/pb.Cmd/csConnectPlayer",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(CmdServer).CsConnectPlayer(ctx, req.(*CsConnectPlayerReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _Cmd_CsFetchHistoryChat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(CsFetchHistoryChatReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(CmdServer).CsFetchHistoryChat(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/pb.Cmd/csFetchHistoryChat",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(CmdServer).CsFetchHistoryChat(ctx, req.(*CsFetchHistoryChatReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _Cmd_CsFetchHistoryMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(CsFetchHistoryMsgReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(CmdServer).CsFetchHistoryMsg(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/pb.Cmd/csFetchHistoryMsg",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(CmdServer).CsFetchHistoryMsg(ctx, req.(*CsFetchHistoryMsgReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _Cmd_CsFetchMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(CsFetchMsgReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(CmdServer).CsFetchMsg(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/pb.Cmd/csFetchMsg",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(CmdServer).CsFetchMsg(ctx, req.(*CsFetchMsgReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _Cmd_CsSendMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(CsSendMsgReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(CmdServer).CsSendMsg(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/pb.Cmd/csSendMsg",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(CmdServer).CsSendMsg(ctx, req.(*CsSendMsgReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+// Cmd_ServiceDesc is the grpc.ServiceDesc for Cmd service.
+// It's only intended for direct use with grpc.RegisterService,
+// and not to be introspected or modified (even as a copy)
+var Cmd_ServiceDesc = grpc.ServiceDesc{
+	ServiceName: "pb.Cmd",
+	HandlerType: (*CmdServer)(nil),
+	Methods: []grpc.MethodDesc{
+		{
+			MethodName: "playerFetchCsInfo",
+			Handler:    _Cmd_PlayerFetchCsInfo_Handler,
+		},
+		{
+			MethodName: "playerFetchHistoryMsg",
+			Handler:    _Cmd_PlayerFetchHistoryMsg_Handler,
+		},
+		{
+			MethodName: "playerFetchMsg",
+			Handler:    _Cmd_PlayerFetchMsg_Handler,
+		},
+		{
+			MethodName: "playerSendMsg",
+			Handler:    _Cmd_PlayerSendMsg_Handler,
+		},
+		{
+			MethodName: "playerDisconnect",
+			Handler:    _Cmd_PlayerDisconnect_Handler,
+		},
+		{
+			MethodName: "csFetchPlayerQueue",
+			Handler:    _Cmd_CsFetchPlayerQueue_Handler,
+		},
+		{
+			MethodName: "csConnectPlayer",
+			Handler:    _Cmd_CsConnectPlayer_Handler,
+		},
+		{
+			MethodName: "csFetchHistoryChat",
+			Handler:    _Cmd_CsFetchHistoryChat_Handler,
+		},
+		{
+			MethodName: "csFetchHistoryMsg",
+			Handler:    _Cmd_CsFetchHistoryMsg_Handler,
+		},
+		{
+			MethodName: "csFetchMsg",
+			Handler:    _Cmd_CsFetchMsg_Handler,
+		},
+		{
+			MethodName: "csSendMsg",
+			Handler:    _Cmd_CsSendMsg_Handler,
+		},
+	},
+	Streams:  []grpc.StreamDesc{},
+	Metadata: "pb/cmd.proto",
+}

+ 2 - 26
bff/apibff/desc/apibff.api

@@ -11,20 +11,10 @@ import (
 	"bean.api"
 )
 
-@server(
-	group: player/auth
-	prefix: api/v1
-)
-service apibff {
-	@doc "玩家登录"
-	@handler playerAuth
-	post /player/auth (PlayerAuthReq) returns (CommResp)
-}
-
 @server(
 	group: player/cmd
 	prefix: api/v1
-	jwt: Auth
+	jwt: JwtAuth
 )
 service apibff {
 	@doc "玩家获取客服信息"
@@ -48,26 +38,12 @@ service apibff {
 	post /player/disconnect returns (CommResp)
 }
 
-@server(
-	group : cs/auth
-	prefix : api/v1
-)
-service apibff {
-	@doc "客服登录"
-	@handler csAuth
-	post /cs/auth (CsAuthReq) returns (CommResp)
-}
-
 @server(
 	group : cs/cmd
 	prefix : api/v1
-	jwt : Auth
+	jwt : JwtAuth
 )
 service apibff {
-	@doc "客服获取玩家信息"
-	@handler csFetchPlayerInfo
-	post /cs/fetch_player_info (CsFetchPlayerInfoReq) returns (CommResp)
-	
 	@doc "客服获取玩家等待队列"
 	@handler csFetchPlayerQueue
 	post /cs/fetch_player_queue (CsFetchPlayerQueueReq) returns (CommResp)

+ 0 - 15
bff/apibff/desc/bean.api

@@ -14,11 +14,6 @@ type CommResp {
 }
 
 type (
-    PlayerAuthReq {
-        PlayerId string `json:"player_id"`
-        GameId string `json:"game_id"`
-    }
-
     PlayerFetchCsInfoReq {
         CsId string `json:"cs_id"`
     }
@@ -35,16 +30,6 @@ type (
 )
 
 type (
-    CsAuthReq {
-        Uname string `json:"uname"`
-        Password string `json:"password"`
-    }
-
-    CsFetchPlayerInfoReq {
-        PlayerId string `json:"palyer_id"`
-        GameId string `json:"game_id"`
-    }
-
     CsFetchPlayerQueueReq {
         Limit int `json:"limit"`
     }

+ 4 - 10
bff/apibff/etc/apibff.yaml

@@ -2,18 +2,12 @@ Name: apibff
 Host: 0.0.0.0
 Port: 10001
 
-AuthRpc:
+CmdRpc:
   Etcd:
     Hosts:
       - 127.0.0.1:2379
-    Key: auth.rpc
+    Key: cmd.rpc
 
-#CmdRpc:
-#  Etcd:
-#    Hosts:
-#      - 127.0.0.1:2379
-#    Key: cmd.rpc
-
-Auth:
+JwtAuth:
   AccessSecret: ylink2022
-  AccessExpire: 259200
+  AccessExpire: 86400

+ 2 - 2
bff/apibff/internal/config/config.go

@@ -7,9 +7,9 @@ import (
 
 type Config struct {
 	rest.RestConf
-	Auth struct {
+	JwtAuth struct {
 		AccessSecret string
 		AccessExpire int64
 	}
-	AuthRpc zrpc.RpcClientConf
+	CmdRpc zrpc.RpcClientConf
 }

+ 0 - 28
bff/apibff/internal/handler/cs/auth/csauthhandler.go

@@ -1,28 +0,0 @@
-package auth
-
-import (
-	"net/http"
-
-	"github.com/zeromicro/go-zero/rest/httpx"
-	"ylink/bff/apibff/internal/logic/cs/auth"
-	"ylink/bff/apibff/internal/svc"
-	"ylink/bff/apibff/internal/types"
-)
-
-func CsAuthHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
-	return func(w http.ResponseWriter, r *http.Request) {
-		var req types.CsAuthReq
-		if err := httpx.Parse(r, &req); err != nil {
-			httpx.Error(w, err)
-			return
-		}
-
-		l := auth.NewCsAuthLogic(r.Context(), svcCtx)
-		resp, err := l.CsAuth(&req)
-		if err != nil {
-			httpx.Error(w, err)
-		} else {
-			httpx.OkJson(w, resp)
-		}
-	}
-}

+ 0 - 28
bff/apibff/internal/handler/cs/cmd/csfetchplayerinfohandler.go

@@ -1,28 +0,0 @@
-package cmd
-
-import (
-	"net/http"
-
-	"github.com/zeromicro/go-zero/rest/httpx"
-	"ylink/bff/apibff/internal/logic/cs/cmd"
-	"ylink/bff/apibff/internal/svc"
-	"ylink/bff/apibff/internal/types"
-)
-
-func CsFetchPlayerInfoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
-	return func(w http.ResponseWriter, r *http.Request) {
-		var req types.CsFetchPlayerInfoReq
-		if err := httpx.Parse(r, &req); err != nil {
-			httpx.Error(w, err)
-			return
-		}
-
-		l := cmd.NewCsFetchPlayerInfoLogic(r.Context(), svcCtx)
-		resp, err := l.CsFetchPlayerInfo(&req)
-		if err != nil {
-			httpx.Error(w, err)
-		} else {
-			httpx.OkJson(w, resp)
-		}
-	}
-}

+ 0 - 28
bff/apibff/internal/handler/player/auth/playerauthhandler.go

@@ -1,28 +0,0 @@
-package auth
-
-import (
-	"net/http"
-
-	"github.com/zeromicro/go-zero/rest/httpx"
-	"ylink/bff/apibff/internal/logic/player/auth"
-	"ylink/bff/apibff/internal/svc"
-	"ylink/bff/apibff/internal/types"
-)
-
-func PlayerAuthHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
-	return func(w http.ResponseWriter, r *http.Request) {
-		var req types.PlayerAuthReq
-		if err := httpx.Parse(r, &req); err != nil {
-			httpx.Error(w, err)
-			return
-		}
-
-		l := auth.NewPlayerAuthLogic(r.Context(), svcCtx)
-		resp, err := l.PlayerAuth(&req)
-		if err != nil {
-			httpx.Error(w, err)
-		} else {
-			httpx.OkJson(w, resp)
-		}
-	}
-}

+ 2 - 31
bff/apibff/internal/handler/routes.go

@@ -4,9 +4,7 @@ package handler
 import (
 	"net/http"
 
-	csauth "ylink/bff/apibff/internal/handler/cs/auth"
 	cscmd "ylink/bff/apibff/internal/handler/cs/cmd"
-	playerauth "ylink/bff/apibff/internal/handler/player/auth"
 	playercmd "ylink/bff/apibff/internal/handler/player/cmd"
 	"ylink/bff/apibff/internal/svc"
 
@@ -14,17 +12,6 @@ import (
 )
 
 func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
-	server.AddRoutes(
-		[]rest.Route{
-			{
-				Method:  http.MethodPost,
-				Path:    "/player/auth",
-				Handler: playerauth.PlayerAuthHandler(serverCtx),
-			},
-		},
-		rest.WithPrefix("/api/v1"),
-	)
-
 	server.AddRoutes(
 		[]rest.Route{
 			{
@@ -53,28 +40,12 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 				Handler: playercmd.PlayerDisconnectHandler(serverCtx),
 			},
 		},
-		rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
+		rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret),
 		rest.WithPrefix("/api/v1"),
 	)
 
 	server.AddRoutes(
 		[]rest.Route{
-			{
-				Method:  http.MethodPost,
-				Path:    "/cs/auth",
-				Handler: csauth.CsAuthHandler(serverCtx),
-			},
-		},
-		rest.WithPrefix("/api/v1"),
-	)
-
-	server.AddRoutes(
-		[]rest.Route{
-			{
-				Method:  http.MethodPost,
-				Path:    "/cs/fetch_player_info",
-				Handler: cscmd.CsFetchPlayerInfoHandler(serverCtx),
-			},
 			{
 				Method:  http.MethodPost,
 				Path:    "/cs/fetch_player_queue",
@@ -106,7 +77,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 				Handler: cscmd.CsSendMsgHandler(serverCtx),
 			},
 		},
-		rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
+		rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret),
 		rest.WithPrefix("/api/v1"),
 	)
 }

+ 0 - 44
bff/apibff/internal/logic/cs/auth/csauthlogic.go

@@ -1,44 +0,0 @@
-package auth
-
-import (
-	"context"
-	"ylink/apis/auth/pb"
-
-	"ylink/bff/apibff/internal/svc"
-	"ylink/bff/apibff/internal/types"
-
-	"github.com/zeromicro/go-zero/core/logx"
-)
-
-type CsAuthLogic struct {
-	logx.Logger
-	ctx    context.Context
-	svcCtx *svc.ServiceContext
-}
-
-func NewCsAuthLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CsAuthLogic {
-	return &CsAuthLogic{
-		Logger: logx.WithContext(ctx),
-		ctx:    ctx,
-		svcCtx: svcCtx,
-	}
-}
-
-func (l *CsAuthLogic) CsAuth(req *types.CsAuthReq) (resp *types.CommResp, err error) {
-	if authResp, err := l.svcCtx.AuthRpc.CsAuth(l.ctx, &pb.CsAuthReq{
-		Uname:    req.Uname,
-		Password: req.Password,
-	}); err != nil {
-		return &types.CommResp{
-			Code: authResp.Code,
-			Msg:  "success",
-			Data: map[string]interface{}{},
-		}, err
-	} else {
-		return &types.CommResp{
-			Code: 0,
-			Msg:  "success",
-			Data: authResp.Data,
-		}, nil
-	}
-}

+ 0 - 30
bff/apibff/internal/logic/cs/cmd/csfetchplayerinfologic.go

@@ -1,30 +0,0 @@
-package cmd
-
-import (
-	"context"
-
-	"ylink/bff/apibff/internal/svc"
-	"ylink/bff/apibff/internal/types"
-
-	"github.com/zeromicro/go-zero/core/logx"
-)
-
-type CsFetchPlayerInfoLogic struct {
-	logx.Logger
-	ctx    context.Context
-	svcCtx *svc.ServiceContext
-}
-
-func NewCsFetchPlayerInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CsFetchPlayerInfoLogic {
-	return &CsFetchPlayerInfoLogic{
-		Logger: logx.WithContext(ctx),
-		ctx:    ctx,
-		svcCtx: svcCtx,
-	}
-}
-
-func (l *CsFetchPlayerInfoLogic) CsFetchPlayerInfo(req *types.CsFetchPlayerInfoReq) (resp *types.CommResp, err error) {
-	// todo: add your logic here and delete this line
-
-	return
-}

+ 0 - 44
bff/apibff/internal/logic/player/auth/playerauthlogic.go

@@ -1,44 +0,0 @@
-package auth
-
-import (
-	"context"
-	"ylink/apis/auth/pb"
-
-	"ylink/bff/apibff/internal/svc"
-	"ylink/bff/apibff/internal/types"
-
-	"github.com/zeromicro/go-zero/core/logx"
-)
-
-type PlayerAuthLogic struct {
-	logx.Logger
-	ctx    context.Context
-	svcCtx *svc.ServiceContext
-}
-
-func NewPlayerAuthLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PlayerAuthLogic {
-	return &PlayerAuthLogic{
-		Logger: logx.WithContext(ctx),
-		ctx:    ctx,
-		svcCtx: svcCtx,
-	}
-}
-
-func (l *PlayerAuthLogic) PlayerAuth(req *types.PlayerAuthReq) (resp *types.CommResp, err error) {
-	if authResp, err := l.svcCtx.AuthRpc.PlayerAuth(l.ctx, &pb.PlayerAuthReq{
-		PlayerId: req.PlayerId,
-		GameId:   req.GameId,
-	}); err != nil {
-		return &types.CommResp{
-			Code: authResp.Code,
-			Msg:  "success",
-			Data: map[string]interface{}{},
-		}, err
-	} else {
-		return &types.CommResp{
-			Code: 0,
-			Msg:  "success",
-			Data: authResp.Data,
-		}, nil
-	}
-}

+ 12 - 2
bff/apibff/internal/logic/player/cmd/playerfetchcsinfologic.go

@@ -2,6 +2,7 @@ package cmd
 
 import (
 	"context"
+	"ylink/apis/cmd/pb"
 
 	"ylink/bff/apibff/internal/svc"
 	"ylink/bff/apibff/internal/types"
@@ -24,7 +25,16 @@ func NewPlayerFetchCsInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext)
 }
 
 func (l *PlayerFetchCsInfoLogic) PlayerFetchCsInfo(req *types.PlayerFetchCsInfoReq) (resp *types.CommResp, err error) {
-	// todo: add your logic here and delete this line
+	cmdResp, err := l.svcCtx.CmdRpc.PlayerFetchCsInfo(l.ctx, &pb.PlayerFetchCsInfoReq{
+		CsId: req.CsId,
+	})
+	if err != nil {
+		return nil, err
+	}
 
-	return
+	return &types.CommResp{
+		Code: cmdResp.Code,
+		Msg:  cmdResp.Msg,
+		Data: cmdResp.Data,
+	}, nil
 }

+ 5 - 5
bff/apibff/internal/svc/servicecontext.go

@@ -2,18 +2,18 @@ package svc
 
 import (
 	"github.com/zeromicro/go-zero/zrpc"
-	"ylink/apis/auth/auth"
+	"ylink/apis/cmd/cmd"
 	"ylink/bff/apibff/internal/config"
 )
 
 type ServiceContext struct {
-	Config  config.Config
-	AuthRpc auth.Auth
+	Config config.Config
+	CmdRpc cmd.Cmd
 }
 
 func NewServiceContext(c config.Config) *ServiceContext {
 	return &ServiceContext{
-		Config:  c,
-		AuthRpc: auth.NewAuth(zrpc.MustNewClient(c.AuthRpc)),
+		Config: c,
+		CmdRpc: cmd.NewCmd(zrpc.MustNewClient(c.CmdRpc)),
 	}
 }

+ 0 - 15
bff/apibff/internal/types/types.go

@@ -7,11 +7,6 @@ type CommResp struct {
 	Data interface{} `json:"data"`
 }
 
-type PlayerAuthReq struct {
-	PlayerId string `json:"player_id"`
-	GameId   string `json:"game_id"`
-}
-
 type PlayerFetchCsInfoReq struct {
 	CsId string `json:"cs_id"`
 }
@@ -26,16 +21,6 @@ type PlayerSendMsgReq struct {
 	Pic     string `json:"pic"`
 }
 
-type CsAuthReq struct {
-	Uname    string `json:"uname"`
-	Password string `json:"password"`
-}
-
-type CsFetchPlayerInfoReq struct {
-	PlayerId string `json:"palyer_id"`
-	GameId   string `json:"game_id"`
-}
-
 type CsFetchPlayerQueueReq struct {
 	Limit int `json:"limit"`
 }

+ 1 - 1
bff/authbff/desc/authbff.api

@@ -17,7 +17,7 @@ type CsAuthReq {
 }
 
 type CheckAuthReq {
-	Token string `json:"token"`
+	AccessToken string `json:"access_token"`
 }
 
 type AuthResp {

+ 1 - 1
bff/authbff/internal/logic/checkauthlogic.go

@@ -26,7 +26,7 @@ func NewCheckAuthLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CheckAu
 
 func (l *CheckAuthLogic) CheckAuth(req *types.CheckAuthReq) (resp *types.AuthResp, err error) {
 	if authResp, err := l.svcCtx.AuthRpc.CheckAuth(l.ctx, &pb.CheckAuthReq{
-		Token: req.Token,
+		AccessToken: req.AccessToken,
 	}); err != nil {
 		return &types.AuthResp{
 			Code: authResp.Code,

+ 1 - 1
bff/authbff/internal/types/types.go

@@ -11,7 +11,7 @@ type CsAuthReq struct {
 }
 
 type CheckAuthReq struct {
-	Token string `json:"token"`
+	AccessToken string `json:"access_token"`
 }
 
 type AuthResp struct {

+ 9 - 2
bff/rpcbff/etc/rpcbff.yaml

@@ -1,6 +1,13 @@
 Name: rpcbff.rpc
-ListenOn: 0.0.0.0:10002
+ListenOn: 0.0.0.0:10100
+
 Etcd:
   Hosts:
-  - 127.0.0.1:2379
+    - 127.0.0.1:2379
   Key: rpcbff.rpc
+
+AuthRpc:
+  Etcd:
+    Hosts:
+      - 127.0.0.1:2379
+    Key: auth.rpc

+ 1 - 0
bff/rpcbff/internal/config/config.go

@@ -4,4 +4,5 @@ import "github.com/zeromicro/go-zero/zrpc"
 
 type Config struct {
 	zrpc.RpcServerConf
+	AuthRpc zrpc.RpcClientConf
 }

+ 11 - 5
bff/rpcbff/internal/logic/connectlogic.go

@@ -3,11 +3,11 @@ package logic
 import (
 	"context"
 	"google.golang.org/protobuf/types/known/structpb"
+	"ylink/apis/auth/auth"
 
+	"github.com/zeromicro/go-zero/core/logx"
 	"ylink/bff/rpcbff/internal/svc"
 	"ylink/bff/rpcbff/pb"
-
-	"github.com/zeromicro/go-zero/core/logx"
 )
 
 type ConnectLogic struct {
@@ -27,9 +27,15 @@ func NewConnectLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ConnectLo
 func (l *ConnectLogic) Connect(in *pb.CommandReq, stream pb.Rpcbff_ConnectServer) error {
 	// todo: 验证token
 	// todo: 把stream放入资源pool
-
-	l.Logger.Info("invoke func connect")
-	l.Logger.Infof("%s", in.Token)
+	if authResp, err := l.svcCtx.AuthRpc.CheckAuth(l.ctx, &auth.CheckAuthReq{
+		AccessToken: in.AccessToken,
+	}); err != nil {
+		return stream.Send(&pb.CommandResp{
+			CommandCode: authResp.Code,
+			CommandMsg:  authResp.Msg,
+			CommandData: authResp.Data,
+		})
+	}
 
 	data, _ := structpb.NewStruct(map[string]interface{}{})
 

+ 1 - 1
bff/rpcbff/internal/logic/disconnectlogic.go

@@ -29,7 +29,7 @@ func (l *DisconnectLogic) Disconnect(in *pb.CommandReq) (*pb.CommandResp, error)
 	// todo: 把关联的stream从资源pool中移除
 
 	l.Logger.Info("invoke func disconnect")
-	l.Logger.Infof("%s", in.Token)
+	l.Logger.Infof("%s", in.AccessToken)
 
 	data, _ := structpb.NewStruct(map[string]interface{}{})
 	return &pb.CommandResp{

+ 9 - 3
bff/rpcbff/internal/svc/servicecontext.go

@@ -1,13 +1,19 @@
 package svc
 
-import "ylink/bff/rpcbff/internal/config"
+import (
+	"github.com/zeromicro/go-zero/zrpc"
+	"ylink/apis/auth/auth"
+	"ylink/bff/rpcbff/internal/config"
+)
 
 type ServiceContext struct {
-	Config config.Config
+	Config  config.Config
+	AuthRpc auth.Auth
 }
 
 func NewServiceContext(c config.Config) *ServiceContext {
 	return &ServiceContext{
-		Config: c,
+		Config:  c,
+		AuthRpc: auth.NewAuth(zrpc.MustNewClient(c.AuthRpc)),
 	}
 }

+ 14 - 13
bff/rpcbff/pb/rpcbff.pb.go

@@ -89,7 +89,7 @@ type CommandReq struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
+	AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`
 }
 
 func (x *CommandReq) Reset() {
@@ -124,9 +124,9 @@ func (*CommandReq) Descriptor() ([]byte, []int) {
 	return file_pb_rpcbff_proto_rawDescGZIP(), []int{1}
 }
 
-func (x *CommandReq) GetToken() string {
+func (x *CommandReq) GetAccessToken() string {
 	if x != nil {
-		return x.Token
+		return x.AccessToken
 	}
 	return ""
 }
@@ -146,16 +146,17 @@ var file_pb_rpcbff_proto_rawDesc = []byte{
 	0x6e, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e,
 	0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
 	0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x44,
-	0x61, 0x74, 0x61, 0x22, 0x22, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65,
-	0x71, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
-	0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x32, 0x65, 0x0a, 0x06, 0x52, 0x70, 0x63, 0x62, 0x66,
-	0x66, 0x12, 0x2c, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x0e, 0x2e, 0x70,
-	0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x70,
-	0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x30, 0x01, 0x12,
-	0x2d, 0x0a, 0x0a, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x0e, 0x2e,
-	0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e,
-	0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06,
-	0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x61, 0x74, 0x61, 0x22, 0x2f, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65,
+	0x71, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65,
+	0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54,
+	0x6f, 0x6b, 0x65, 0x6e, 0x32, 0x65, 0x0a, 0x06, 0x52, 0x70, 0x63, 0x62, 0x66, 0x66, 0x12, 0x2c,
+	0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x43,
+	0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x43,
+	0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x30, 0x01, 0x12, 0x2d, 0x0a, 0x0a,
+	0x64, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x0e, 0x2e, 0x70, 0x62, 0x2e,
+	0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x70, 0x62, 0x2e,
+	0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e,
+	0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (

+ 1 - 1
bff/rpcbff/pb/rpcbff.proto

@@ -13,7 +13,7 @@ message CommandResp {
 }
 
 message CommandReq {
-  string token = 1;
+  string access_token = 1;
 }
 
 service Rpcbff {