feat 网关鉴权
This commit is contained in:
@@ -4,14 +4,15 @@ option go_package = "common/proto/ss/grpc_pb";
|
||||
import "ss_common.proto";
|
||||
|
||||
service Gateway {
|
||||
// 发送消息到客户端
|
||||
rpc ToClient(stream ToClientReq) returns (ToClientResp) {}
|
||||
}
|
||||
|
||||
message ToClientReq {
|
||||
int32 UID = 1;
|
||||
int64 USN = 1;
|
||||
int32 MessageID = 2;
|
||||
bytes Payload = 3;
|
||||
}
|
||||
|
||||
message ToClientResp {
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@ service Scene {
|
||||
}
|
||||
|
||||
message EnterReq {
|
||||
int32 UID = 1; // 用户ID
|
||||
int64 USN = 1; // 用户ID
|
||||
int64 GatewaySID = 2; // 网关服务ID
|
||||
int32 InstanceID = 3; // 副本ID
|
||||
}
|
||||
@@ -23,7 +23,7 @@ message EnterResp {
|
||||
}
|
||||
|
||||
message LeaveReq {
|
||||
int32 UID = 1; // 用户ID
|
||||
int64 USN = 1; // 用户ID
|
||||
int64 GatewaySID = 2; // 网关服务ID
|
||||
int32 InstanceID = 3; // 副本ID
|
||||
int64 UniqueNo = 4; // 副本唯一编号
|
||||
@@ -34,7 +34,7 @@ message LeaveResp {
|
||||
|
||||
message ActionReq {
|
||||
int64 UniqueNo = 1; // 副本唯一编号
|
||||
int32 UID = 2; // 用户ID
|
||||
int64 USN = 2; // 用户ID
|
||||
int32 Action = 3; // 指令ID
|
||||
sint32 DirX = 4; // 移动-X方向(×1000 缩放)
|
||||
sint32 DirY = 5; // 移动-Y方向(×1000 缩放)
|
||||
|
||||
@@ -5,9 +5,10 @@ import "ss_common.proto";
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
service User {
|
||||
rpc Login(LoginReq) returns (LoginResp) {
|
||||
rpc Login(LoginReq) returns (LoginResp) {}
|
||||
rpc GetUserInfo(GetUserInfoReq) returns (GetUserInfoResp) {
|
||||
option (google.api.http) = {
|
||||
post: "/user/login"
|
||||
post: "/user/info"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
@@ -19,5 +20,15 @@ message LoginReq {
|
||||
}
|
||||
|
||||
message LoginResp {
|
||||
int32 UID = 1 [json_name = "uid"]; // 用户ID
|
||||
int64 USN = 1 [json_name = "usn"]; // 用户ID
|
||||
string Name = 2 [json_name = "name"]; // 用户名
|
||||
}
|
||||
|
||||
message GetUserInfoReq {
|
||||
int64 USN = 1 [json_name = "usn"];
|
||||
}
|
||||
|
||||
message GetUserInfoResp {
|
||||
int64 USN = 1 [json_name = "usn"];
|
||||
string Name = 2 [json_name = "name"];
|
||||
}
|
||||
@@ -3,6 +3,6 @@ syntax = "proto3";
|
||||
option go_package = "common/proto/ss/ss_common";
|
||||
|
||||
message ErrorInfo {
|
||||
int32 code = 1;
|
||||
string msg = 2;
|
||||
int32 Code = 1;
|
||||
string Msg = 2;
|
||||
}
|
||||
Reference in New Issue
Block a user