feat usn 类型改成int64
This commit is contained in:
@@ -6,47 +6,33 @@ import "google/api/annotations.proto";
|
||||
|
||||
service Qgdzs {
|
||||
// 生成题目
|
||||
rpc GenerateQuestion(GenerateQuestionReq) returns (GenerateQuestionResp) {
|
||||
option (google.api.http) = {
|
||||
post: "/qgdzs/auth/generate_question"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
rpc GenerateQuestion(GenerateQuestionReq) returns (GenerateQuestionResp) {option (google.api.http) = {post: "/qgdzs/auth/generate_question" body: "*"};}
|
||||
|
||||
// ---------- 随机答题 ----------
|
||||
// 获取题目
|
||||
rpc GetQuestion(GetQuestionReq) returns (GetQuestionResp) {
|
||||
option (google.api.http) = {
|
||||
post: "/qgdzs/open/get_question"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
// 获取具体的题目
|
||||
rpc GetQuestionInfo(GetQuestionInfoReq) returns (GetQuestionInfoResp) {
|
||||
option (google.api.http) = {
|
||||
post: "/qgdzs/open/get_question_info"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
rpc RandomGetQuestion(RandomGetQuestionReq) returns (RandomGetQuestionResp) {option (google.api.http) = {post: "/qgdzs/open/random/question" body: "*"};}
|
||||
// 回答题目
|
||||
rpc AnswerQuestion(AnswerQuestionReq) returns (AnswerQuestionResp) {
|
||||
option (google.api.http) = {
|
||||
post: "/qgdzs/open/answer_question"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
rpc RandomAnswerQuestion(RandomAnswerQuestionReq) returns (RandomAnswerQuestionResp) {option (google.api.http) = {post: "/qgdzs/open/random/answer" body: "*"};}
|
||||
|
||||
// ---------- 类目答题 ----------
|
||||
// 获取所有类目
|
||||
rpc GetAllCategory(GetAllCategoryReq) returns (GetAllCategoryResp) {
|
||||
option (google.api.http) = {
|
||||
post: "/qgdzs/open/get_all_category"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
rpc GetAllCategory(GetAllCategoryReq) returns (GetAllCategoryResp) {option (google.api.http) = {post: "/qgdzs/open/category/get_category" body: "*"};}
|
||||
// 获取题目
|
||||
rpc CategoryGetQuestion(CategoryGetQuestionReq) returns (CategoryGetQuestionResp) {option (google.api.http) = {post: "/qgdzs/open/category/question" body: "*"};}
|
||||
// 回答题目
|
||||
rpc CategoryAnswerQuestion(CategoryAnswerQuestionReq) returns (CategoryAnswerQuestionResp) {option (google.api.http) = {post: "/qgdzs/open/category/answer" body: "*"};}
|
||||
|
||||
// ---------- 快速答题 ----------
|
||||
// 获取题目
|
||||
rpc QuicklyGetQuestion(QuicklyGetQuestionReq) returns (QuicklyGetQuestionResp) {option (google.api.http) = {post: "/qgdzs/open/quickly/question" body: "*"};}
|
||||
// 回答题目
|
||||
rpc QuicklyAnswerQuestion(QuicklyAnswerQuestionReq) returns (QuicklyAnswerQuestionResp) {option (google.api.http) = {post: "/qgdzs/open/quickly/answer" body: "*"};}
|
||||
|
||||
// ---------- 答题记录 ----------
|
||||
// 获取答题记录
|
||||
rpc GetRecord(GetRecordReq) returns (GetRecordResp) {
|
||||
option (google.api.http) = {
|
||||
post: "/qgdzs/auth/get_record"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
rpc GetRecord(GetRecordReq) returns (GetRecordResp) {option (google.api.http) = {post: "/qgdzs/auth/get_record" body: "*"};}
|
||||
// 获取具体的题目
|
||||
rpc GetQuestionInfo(GetQuestionInfoReq) returns (GetQuestionInfoResp) {option (google.api.http) = {post: "/qgdzs/open/get_question_info" body: "*"};}
|
||||
}
|
||||
|
||||
// ---------- GenerateQuestion ----------
|
||||
@@ -56,37 +42,24 @@ message GenerateQuestionReq {
|
||||
message GenerateQuestionResp {
|
||||
}
|
||||
|
||||
// ---------- GetQuestion ----------
|
||||
message GetQuestionReq {
|
||||
string CategorySn = 1 [json_name = "category_sn"]; // 类目唯一标识
|
||||
// ---------- RandomGetQuestion ----------
|
||||
message RandomGetQuestionReq {
|
||||
}
|
||||
message GetQuestionResp {
|
||||
string Sn = 1 [json_name = "sn"]; // 题目唯一标识
|
||||
message RandomGetQuestionResp {
|
||||
int64 Sn = 1 [json_name = "sn"]; // 题目唯一标识
|
||||
string Question = 2 [json_name = "question"]; // 题干
|
||||
repeated string Options = 3 [json_name = "options"]; // 选项
|
||||
string Category = 4 [json_name = "category"]; // 题目类型
|
||||
int32 Difficulty = 5 [json_name = "difficulty"]; // 难度
|
||||
}
|
||||
|
||||
// ---------- GetQuestionInfo ----------
|
||||
message GetQuestionInfoReq {
|
||||
string QuestionSn = 1 [json_name = "question_sn"]; // 题目唯一标识
|
||||
}
|
||||
message GetQuestionInfoResp {
|
||||
string Question = 1 [json_name = "question"]; // 题干
|
||||
repeated string Options = 2 [json_name = "options"]; // 选项
|
||||
string Category = 3 [json_name = "category"]; // 类目
|
||||
int32 Difficulty = 4 [json_name = "difficulty"]; // 难度
|
||||
string Explanation = 5 [json_name = "explanation"]; // 解析
|
||||
}
|
||||
|
||||
// ---------- AnswerQuestion ----------
|
||||
message AnswerQuestionReq {
|
||||
string USN = 1 [json_name = "usn"];
|
||||
string Sn = 2 [json_name = "sn"]; // 题目唯一标识
|
||||
// ---------- RandomAnswerQuestion ----------
|
||||
message RandomAnswerQuestionReq {
|
||||
int64 USN = 1 [json_name = "usn"];
|
||||
int64 Sn = 2 [json_name = "sn"]; // 题目唯一标识
|
||||
string Answer = 3 [json_name = "answer"]; // 答案
|
||||
}
|
||||
message AnswerQuestionResp {
|
||||
message RandomAnswerQuestionResp {
|
||||
string Answer = 1 [json_name = "answer"]; // 答案
|
||||
string Explanation = 2 [json_name = "explanation"]; // 解析
|
||||
}
|
||||
@@ -98,13 +71,58 @@ message GetAllCategoryResp {
|
||||
repeated GetAllCategoryItem Categories = 1 [json_name = "categories"]; // 类目
|
||||
}
|
||||
message GetAllCategoryItem {
|
||||
string Sn = 1 [json_name = "sn"]; // 唯一标识
|
||||
int64 Sn = 1 [json_name = "sn"]; // 唯一标识
|
||||
string Category = 2 [json_name = "category"]; // 类目
|
||||
}
|
||||
|
||||
// ---------- CategoryGetQuestion ----------
|
||||
message CategoryGetQuestionReq {
|
||||
int64 CategorySn = 1 [json_name = "category_sn"]; // 类目唯一标识
|
||||
}
|
||||
message CategoryGetQuestionResp {
|
||||
int64 Sn = 1 [json_name = "sn"]; // 题目唯一标识
|
||||
string Question = 2 [json_name = "question"]; // 题干
|
||||
repeated string Options = 3 [json_name = "options"]; // 选项
|
||||
string Category = 4 [json_name = "category"]; // 题目类型
|
||||
int32 Difficulty = 5 [json_name = "difficulty"]; // 难度
|
||||
}
|
||||
|
||||
// ---------- CategoryAnswerQuestion ----------
|
||||
message CategoryAnswerQuestionReq {
|
||||
int64 USN = 1 [json_name = "usn"];
|
||||
int64 Sn = 2 [json_name = "sn"]; // 题目唯一标识
|
||||
string Answer = 3 [json_name = "answer"]; // 答案
|
||||
}
|
||||
message CategoryAnswerQuestionResp {
|
||||
string Answer = 1 [json_name = "answer"]; // 答案
|
||||
string Explanation = 2 [json_name = "explanation"]; // 解析
|
||||
}
|
||||
|
||||
// ---------- QuicklyGetQuestion ----------
|
||||
message QuicklyGetQuestionReq {
|
||||
}
|
||||
message QuicklyGetQuestionResp {
|
||||
int64 Sn = 1 [json_name = "sn"]; // 题目唯一标识
|
||||
string Question = 2 [json_name = "question"]; // 题干
|
||||
repeated string Options = 3 [json_name = "options"]; // 选项
|
||||
string Category = 4 [json_name = "category"]; // 题目类型
|
||||
int32 Difficulty = 5 [json_name = "difficulty"]; // 难度
|
||||
}
|
||||
|
||||
// ---------- QuicklyAnswerQuestion ----------
|
||||
message QuicklyAnswerQuestionReq {
|
||||
int64 USN = 1 [json_name = "usn"];
|
||||
int64 Sn = 2 [json_name = "sn"]; // 题目唯一标识
|
||||
string Answer = 3 [json_name = "answer"]; // 答案
|
||||
}
|
||||
message QuicklyAnswerQuestionResp {
|
||||
string Answer = 1 [json_name = "answer"]; // 答案
|
||||
string Explanation = 2 [json_name = "explanation"]; // 解析
|
||||
}
|
||||
|
||||
// ---------- GetRecord ----------
|
||||
message GetRecordReq {
|
||||
string USN = 1 [json_name = "usn"];
|
||||
int64 USN = 1 [json_name = "usn"];
|
||||
int32 Page = 2 [json_name = "page"];
|
||||
int32 PageSize = 3 [json_name = "page_size"];
|
||||
}
|
||||
@@ -113,11 +131,23 @@ message GetRecordResp {
|
||||
repeated GetRecordItem Records = 2 [json_name = "records"]; // 记录
|
||||
}
|
||||
message GetRecordItem {
|
||||
string QuestionSn = 1 [json_name = "question_sn"]; // 题目唯一标识
|
||||
int64 QuestionSn = 1 [json_name = "question_sn"]; // 题目唯一标识
|
||||
string Question = 2 [json_name = "question"]; // 题干
|
||||
int32 Difficulty = 3 [json_name = "difficulty"]; // 难度
|
||||
string Category = 4 [json_name = "category"]; // 题目类型
|
||||
string QuestionAnswer = 5 [json_name = "question_answer"]; // 题目答案
|
||||
string Answer = 6 [json_name = "answer"]; // 用户答案
|
||||
int64 CreateTime = 7 [json_name = "create_time"]; // 创建时间
|
||||
}
|
||||
|
||||
// ---------- GetQuestionInfo ----------
|
||||
message GetQuestionInfoReq {
|
||||
int64 QuestionSn = 1 [json_name = "question_sn"]; // 题目唯一标识
|
||||
}
|
||||
message GetQuestionInfoResp {
|
||||
string Question = 1 [json_name = "question"]; // 题干
|
||||
repeated string Options = 2 [json_name = "options"]; // 选项
|
||||
string Category = 3 [json_name = "category"]; // 类目
|
||||
int32 Difficulty = 4 [json_name = "difficulty"]; // 难度
|
||||
string Explanation = 5 [json_name = "explanation"]; // 解析
|
||||
}
|
||||
Reference in New Issue
Block a user