feat 修改usn类型为string

This commit is contained in:
2026-01-11 15:58:16 +08:00
parent 63c8fb678c
commit 6bc9f18199
36 changed files with 2054 additions and 702 deletions

View File

@@ -1,6 +1,6 @@
syntax = "proto3";
option go_package = "common/proto/ss/grpc_pb";
option go_package = "git.hlsq.asia/mmorpg/service-common/proto/ss/grpc_pb";
import "ss_common.proto";
service Gateway {
@@ -10,7 +10,7 @@ service Gateway {
}
message ToClientReq {
int64 USN = 1;
string USN = 1;
int32 MessageID = 2;
bytes Payload = 3;
}
@@ -19,7 +19,7 @@ message ToClientResp {
}
message KickUserReq {
int64 USN = 1;
string USN = 1;
}
message KickUserResp {

View File

@@ -1,6 +1,6 @@
syntax = "proto3";
option go_package = "common/proto/ss/grpc_pb";
option go_package = "git.hlsq.asia/mmorpg/service-common/proto/ss/grpc_pb";
import "ss_common.proto";
service Scene {
@@ -10,29 +10,29 @@ service Scene {
}
message EnterReq {
int64 USN = 1; // 用户ID
int64 GatewaySID = 2; // 网关服务ID
string USN = 1; // 用户ID
string GatewaySID = 2; // 网关服务ID
int32 InstanceID = 3; // 副本ID
}
message EnterResp {
int64 SceneSID = 1; // 场景服务ID
int64 UniqueNo = 2; // 副本唯一编号
string SceneSID = 1; // 场景服务ID
string UniqueNo = 2; // 副本唯一编号
int32 MessageID = 3; // 发送给客户端的消息ID
bytes Payload = 4; // 消息负载
}
message LeaveReq {
int64 USN = 1; // 用户ID
int64 UniqueNo = 2; // 副本唯一编号
string USN = 1; // 用户ID
string UniqueNo = 2; // 副本唯一编号
}
message LeaveResp {
}
message ActionReq {
int64 UniqueNo = 1; // 副本唯一编号
int64 USN = 2; // 用户ID
string UniqueNo = 1; // 副本唯一编号
string USN = 2; // 用户ID
int32 Action = 3; // 指令ID
sint32 DirX = 4; // 移动-X方向×1000 缩放)
sint32 DirY = 5; // 移动-Y方向×1000 缩放)

View File

@@ -1,6 +1,6 @@
syntax = "proto3";
option go_package = "common/proto/ss/grpc_pb";
option go_package = "git.hlsq.asia/mmorpg/service-common/proto/ss/grpc_pb";
import "ss_common.proto";
import "google/api/annotations.proto";
@@ -12,23 +12,68 @@ service User {
body: "*"
};
}
rpc GenerateQuestion(GenerateQuestionReq) returns (GenerateQuestionResp) {
option (google.api.http) = {
post: "/user/generate_question"
body: "*"
};
}
rpc GetQuestion(GetQuestionReq) returns (GetQuestionResp) {
option (google.api.http) = {
post: "/user/get_question"
body: "*"
};
}
rpc AnswerQuestion(AnswerQuestionReq) returns (AnswerQuestionResp) {
option (google.api.http) = {
post: "/user/answer_question"
body: "*"
};
}
}
// ---------- Login ----------
message LoginReq {
string Phone = 1 [json_name = "phone"]; // 手机号
string Code = 2 [json_name = "code"]; // 验证码
}
message LoginResp {
int64 USN = 1 [json_name = "usn"]; // 用户ID
string USN = 1 [json_name = "usn"]; // 用户ID
string Name = 2 [json_name = "name"]; // 用户名
}
// ---------- GetUserInfo ----------
message GetUserInfoReq {
int64 USN = 1 [json_name = "usn"];
string USN = 1 [json_name = "usn"];
}
message GetUserInfoResp {
string USN = 1 [json_name = "usn"];
string Name = 2 [json_name = "name"];
}
message GetUserInfoResp {
int64 USN = 1 [json_name = "usn"];
string Name = 2 [json_name = "name"];
// ---------- GenerateQuestion ----------
message GenerateQuestionReq {
int32 Num = 1 [json_name = "num"]; // 生成数量
string Category = 2 [json_name = "Category"]; // 题目类型
}
message GenerateQuestionResp {
}
// ---------- GetQuestion ----------
message GetQuestionReq {
}
message GetQuestionResp {
string Sn = 1 [json_name = "sn"]; // 题目唯一标识
string Question = 2 [json_name = "question"]; // 题干
repeated string Options = 3 [json_name = "options"]; // 选项
}
// ---------- AnswerQuestion ----------
message AnswerQuestionReq {
string Sn = 1 [json_name = "sn"]; // 题目唯一标识
string Answer = 2 [json_name = "answer"]; // 答案
}
message AnswerQuestionResp {
string Answer = 1 [json_name = "answer"]; // 答案
string Explanation = 2 [json_name = "explanation"]; // 解析
}

View File

@@ -1,6 +1,6 @@
syntax = "proto3";
option go_package = "common/proto/ss/ss_common";
option go_package = "git.hlsq.asia/mmorpg/service-common/proto/ss/ss_common";
message ErrorInfo {
int32 Code = 1;