feat 网关鉴权

This commit is contained in:
2025-12-22 18:04:36 +08:00
parent 69cc960fe5
commit 670140e7d3
68 changed files with 1424 additions and 492 deletions

View File

@@ -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 {
}
}

View File

@@ -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 缩放)

View File

@@ -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"];
}

View File

@@ -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;
}