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";
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"]; // 解析
}