From 30864dbc4016ad32af9755127671bac8aa4fd80c Mon Sep 17 00:00:00 2001 From: "DESKTOP-V763RJ7\\Administrator" <835606593@qq.com> Date: Fri, 30 Jan 2026 14:48:38 +0800 Subject: [PATCH] =?UTF-8?q?feat=20usn=20=E7=B1=BB=E5=9E=8B=E6=94=B9?= =?UTF-8?q?=E6=88=90int64?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Proto/RpcServer/gen/api.swagger.json | 368 ++++- .../proto/rs/grpc_pb/service_gateway.pb.go | 16 +- .../proto/rs/grpc_pb/service_qgdzs.pb.go | 1466 ++++++++++++----- .../proto/rs/grpc_pb/service_qgdzs.pb.gw.go | 458 +++-- .../proto/rs/grpc_pb/service_qgdzs_grpc.pb.go | 292 +++- .../proto/rs/grpc_pb/service_scene.pb.go | 74 +- .../proto/rs/grpc_pb/service_user.pb.go | 32 +- Proto/RpcServer/sources/service_gateway.proto | 4 +- Proto/RpcServer/sources/service_qgdzs.proto | 154 +- Proto/RpcServer/sources/service_scene.proto | 16 +- Proto/RpcServer/sources/service_user.proto | 15 +- Proto/SocketServer/gen/client/Action.cs | 36 +- .../proto/ss/ss_pb/action.pb.go | 12 +- Proto/SocketServer/sources/action.proto | 2 +- Publish/docker-compose-dns.yml | 10 + Tools/mysql_model/gen.ps1 | 4 +- .../qgdzs_db/model/categories.gen.go | 6 +- .../qgdzs_db/model/point_card.gen.go | 38 + .../qgdzs_db/model/point_records.gen.go | 46 + .../qgdzs_db/model/questions.gen.go | 8 +- .../mysql_model/qgdzs_db/model/records.gen.go | 10 +- .../qgdzs_db/query/categories.gen.go | 6 +- Tools/mysql_model/qgdzs_db/query/gen.go | 54 +- .../qgdzs_db/query/point_card.gen.go | 353 ++++ .../qgdzs_db/query/point_records.gen.go | 364 ++++ .../qgdzs_db/query/questions.gen.go | 12 +- .../mysql_model/qgdzs_db/query/records.gen.go | 18 +- Tools/mysql_model/user_db/model/users.gen.go | 6 +- Tools/mysql_model/user_db/query/users.gen.go | 6 +- 29 files changed, 3032 insertions(+), 854 deletions(-) create mode 100644 Publish/docker-compose-dns.yml create mode 100644 Tools/mysql_model/qgdzs_db/model/point_card.gen.go create mode 100644 Tools/mysql_model/qgdzs_db/model/point_records.gen.go create mode 100644 Tools/mysql_model/qgdzs_db/query/point_card.gen.go create mode 100644 Tools/mysql_model/qgdzs_db/query/point_records.gen.go diff --git a/Proto/RpcServer/gen/api.swagger.json b/Proto/RpcServer/gen/api.swagger.json index 9bb4e67..acec34d 100644 --- a/Proto/RpcServer/gen/api.swagger.json +++ b/Proto/RpcServer/gen/api.swagger.json @@ -54,7 +54,7 @@ }, "/qgdzs/auth/get_record": { "post": { - "summary": "获取答题记录", + "summary": "---------- 答题记录 ----------\n获取答题记录", "operationId": "Qgdzs_GetRecord", "responses": { "200": { @@ -79,15 +79,15 @@ ] } }, - "/qgdzs/open/answer_question": { + "/qgdzs/open/category/answer": { "post": { "summary": "回答题目", - "operationId": "Qgdzs_AnswerQuestion", + "operationId": "Qgdzs_CategoryAnswerQuestion", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/AnswerQuestionResp" + "$ref": "#/definitions/CategoryAnswerQuestionResp" } } }, @@ -97,7 +97,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/AnswerQuestionReq" + "$ref": "#/definitions/CategoryAnswerQuestionReq" } } ], @@ -106,9 +106,9 @@ ] } }, - "/qgdzs/open/get_all_category": { + "/qgdzs/open/category/get_category": { "post": { - "summary": "获取所有类目", + "summary": "---------- 类目答题 ----------\n获取所有类目", "operationId": "Qgdzs_GetAllCategory", "responses": { "200": { @@ -133,15 +133,15 @@ ] } }, - "/qgdzs/open/get_question": { + "/qgdzs/open/category/question": { "post": { "summary": "获取题目", - "operationId": "Qgdzs_GetQuestion", + "operationId": "Qgdzs_CategoryGetQuestion", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/GetQuestionResp" + "$ref": "#/definitions/CategoryGetQuestionResp" } } }, @@ -151,7 +151,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/GetQuestionReq" + "$ref": "#/definitions/CategoryGetQuestionReq" } } ], @@ -187,6 +187,114 @@ ] } }, + "/qgdzs/open/quickly/answer": { + "post": { + "summary": "回答题目", + "operationId": "Qgdzs_QuicklyAnswerQuestion", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/QuicklyAnswerQuestionResp" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/QuicklyAnswerQuestionReq" + } + } + ], + "tags": [ + "Qgdzs" + ] + } + }, + "/qgdzs/open/quickly/question": { + "post": { + "summary": "---------- 快速答题 ----------\n获取题目", + "operationId": "Qgdzs_QuicklyGetQuestion", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/QuicklyGetQuestionResp" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/QuicklyGetQuestionReq" + } + } + ], + "tags": [ + "Qgdzs" + ] + } + }, + "/qgdzs/open/random/answer": { + "post": { + "summary": "回答题目", + "operationId": "Qgdzs_RandomAnswerQuestion", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/RandomAnswerQuestionResp" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RandomAnswerQuestionReq" + } + } + ], + "tags": [ + "Qgdzs" + ] + } + }, + "/qgdzs/open/random/question": { + "post": { + "summary": "---------- 随机答题 ----------\n获取题目", + "operationId": "Qgdzs_RandomGetQuestion", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/RandomGetQuestionResp" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RandomGetQuestionReq" + } + } + ], + "tags": [ + "Qgdzs" + ] + } + }, "/user/auth/info": { "post": { "summary": "获取用户信息", @@ -219,14 +327,16 @@ "ActionResp": { "type": "object" }, - "AnswerQuestionReq": { + "CategoryAnswerQuestionReq": { "type": "object", "properties": { "usn": { - "type": "string" + "type": "string", + "format": "int64" }, "sn": { "type": "string", + "format": "int64", "title": "题目唯一标识" }, "answer": { @@ -234,9 +344,9 @@ "title": "答案" } }, - "title": "---------- AnswerQuestion ----------" + "title": "---------- CategoryAnswerQuestion ----------" }, - "AnswerQuestionResp": { + "CategoryAnswerQuestionResp": { "type": "object", "properties": { "answer": { @@ -249,15 +359,58 @@ } } }, + "CategoryGetQuestionReq": { + "type": "object", + "properties": { + "category_sn": { + "type": "string", + "format": "int64", + "title": "类目唯一标识" + } + }, + "title": "---------- CategoryGetQuestion ----------" + }, + "CategoryGetQuestionResp": { + "type": "object", + "properties": { + "sn": { + "type": "string", + "format": "int64", + "title": "题目唯一标识" + }, + "question": { + "type": "string", + "title": "题干" + }, + "options": { + "type": "array", + "items": { + "type": "string" + }, + "title": "选项" + }, + "category": { + "type": "string", + "title": "题目类型" + }, + "difficulty": { + "type": "integer", + "format": "int32", + "title": "难度" + } + } + }, "EnterResp": { "type": "object", "properties": { "SceneSID": { "type": "string", + "format": "int64", "title": "场景服务ID" }, "UniqueNo": { "type": "string", + "format": "int64", "title": "副本唯一编号" }, "MessageID": { @@ -291,6 +444,7 @@ "properties": { "sn": { "type": "string", + "format": "int64", "title": "唯一标识" }, "category": { @@ -321,6 +475,7 @@ "properties": { "question_sn": { "type": "string", + "format": "int64", "title": "题目唯一标识" } }, @@ -355,50 +510,12 @@ } } }, - "GetQuestionReq": { - "type": "object", - "properties": { - "category_sn": { - "type": "string", - "title": "类目唯一标识" - } - }, - "title": "---------- GetQuestion ----------" - }, - "GetQuestionResp": { - "type": "object", - "properties": { - "sn": { - "type": "string", - "title": "题目唯一标识" - }, - "question": { - "type": "string", - "title": "题干" - }, - "options": { - "type": "array", - "items": { - "type": "string" - }, - "title": "选项" - }, - "category": { - "type": "string", - "title": "题目类型" - }, - "difficulty": { - "type": "integer", - "format": "int32", - "title": "难度" - } - } - }, "GetRecordItem": { "type": "object", "properties": { "question_sn": { "type": "string", + "format": "int64", "title": "题目唯一标识" }, "question": { @@ -433,7 +550,8 @@ "type": "object", "properties": { "usn": { - "type": "string" + "type": "string", + "format": "int64" }, "page": { "type": "integer", @@ -468,7 +586,8 @@ "type": "object", "properties": { "usn": { - "type": "string" + "type": "string", + "format": "int64" } }, "title": "---------- GetUserInfo ----------" @@ -477,7 +596,8 @@ "type": "object", "properties": { "usn": { - "type": "string" + "type": "string", + "format": "int64" }, "name": { "type": "string" @@ -495,6 +615,7 @@ "properties": { "usn": { "type": "string", + "format": "int64", "title": "用户ID" }, "name": { @@ -503,6 +624,138 @@ } } }, + "QuicklyAnswerQuestionReq": { + "type": "object", + "properties": { + "usn": { + "type": "string", + "format": "int64" + }, + "sn": { + "type": "string", + "format": "int64", + "title": "题目唯一标识" + }, + "answer": { + "type": "string", + "title": "答案" + } + }, + "title": "---------- QuicklyAnswerQuestion ----------" + }, + "QuicklyAnswerQuestionResp": { + "type": "object", + "properties": { + "answer": { + "type": "string", + "title": "答案" + }, + "explanation": { + "type": "string", + "title": "解析" + } + } + }, + "QuicklyGetQuestionReq": { + "type": "object", + "title": "---------- QuicklyGetQuestion ----------" + }, + "QuicklyGetQuestionResp": { + "type": "object", + "properties": { + "sn": { + "type": "string", + "format": "int64", + "title": "题目唯一标识" + }, + "question": { + "type": "string", + "title": "题干" + }, + "options": { + "type": "array", + "items": { + "type": "string" + }, + "title": "选项" + }, + "category": { + "type": "string", + "title": "题目类型" + }, + "difficulty": { + "type": "integer", + "format": "int32", + "title": "难度" + } + } + }, + "RandomAnswerQuestionReq": { + "type": "object", + "properties": { + "usn": { + "type": "string", + "format": "int64" + }, + "sn": { + "type": "string", + "format": "int64", + "title": "题目唯一标识" + }, + "answer": { + "type": "string", + "title": "答案" + } + }, + "title": "---------- RandomAnswerQuestion ----------" + }, + "RandomAnswerQuestionResp": { + "type": "object", + "properties": { + "answer": { + "type": "string", + "title": "答案" + }, + "explanation": { + "type": "string", + "title": "解析" + } + } + }, + "RandomGetQuestionReq": { + "type": "object", + "title": "---------- RandomGetQuestion ----------" + }, + "RandomGetQuestionResp": { + "type": "object", + "properties": { + "sn": { + "type": "string", + "format": "int64", + "title": "题目唯一标识" + }, + "question": { + "type": "string", + "title": "题干" + }, + "options": { + "type": "array", + "items": { + "type": "string" + }, + "title": "选项" + }, + "category": { + "type": "string", + "title": "题目类型" + }, + "difficulty": { + "type": "integer", + "format": "int32", + "title": "难度" + } + } + }, "ToClientResp": { "type": "object" }, @@ -511,6 +764,7 @@ "properties": { "usn": { "type": "string", + "format": "int64", "title": "用户ID" }, "name": { diff --git a/Proto/RpcServer/gen/git.hlsq.asia/mmorpg/service-common/proto/rs/grpc_pb/service_gateway.pb.go b/Proto/RpcServer/gen/git.hlsq.asia/mmorpg/service-common/proto/rs/grpc_pb/service_gateway.pb.go index 4a5b323..2ff1e0c 100644 --- a/Proto/RpcServer/gen/git.hlsq.asia/mmorpg/service-common/proto/rs/grpc_pb/service_gateway.pb.go +++ b/Proto/RpcServer/gen/git.hlsq.asia/mmorpg/service-common/proto/rs/grpc_pb/service_gateway.pb.go @@ -26,7 +26,7 @@ type ToClientReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - USN string `protobuf:"bytes,1,opt,name=USN,proto3" json:"USN,omitempty"` + USN int64 `protobuf:"varint,1,opt,name=USN,proto3" json:"USN,omitempty"` MessageID int32 `protobuf:"varint,2,opt,name=MessageID,proto3" json:"MessageID,omitempty"` Payload []byte `protobuf:"bytes,3,opt,name=Payload,proto3" json:"Payload,omitempty"` } @@ -63,11 +63,11 @@ func (*ToClientReq) Descriptor() ([]byte, []int) { return file_service_gateway_proto_rawDescGZIP(), []int{0} } -func (x *ToClientReq) GetUSN() string { +func (x *ToClientReq) GetUSN() int64 { if x != nil { return x.USN } - return "" + return 0 } func (x *ToClientReq) GetMessageID() int32 { @@ -127,7 +127,7 @@ type KickUserReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - USN string `protobuf:"bytes,1,opt,name=USN,proto3" json:"USN,omitempty"` + USN int64 `protobuf:"varint,1,opt,name=USN,proto3" json:"USN,omitempty"` } func (x *KickUserReq) Reset() { @@ -162,11 +162,11 @@ func (*KickUserReq) Descriptor() ([]byte, []int) { return file_service_gateway_proto_rawDescGZIP(), []int{2} } -func (x *KickUserReq) GetUSN() string { +func (x *KickUserReq) GetUSN() int64 { if x != nil { return x.USN } - return "" + return 0 } type KickUserResp struct { @@ -214,13 +214,13 @@ var file_service_gateway_proto_rawDesc = []byte{ 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x72, 0x73, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x57, 0x0a, 0x0b, 0x54, 0x6f, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x53, 0x4e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x55, 0x53, 0x4e, 0x12, 0x1c, 0x0a, 0x09, 0x4d, 0x65, 0x73, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x55, 0x53, 0x4e, 0x12, 0x1c, 0x0a, 0x09, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x0e, 0x0a, 0x0c, 0x54, 0x6f, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x1f, 0x0a, 0x0b, 0x4b, 0x69, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x12, 0x10, 0x0a, 0x03, 0x55, 0x53, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x55, + 0x12, 0x10, 0x0a, 0x03, 0x55, 0x53, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x55, 0x53, 0x4e, 0x22, 0x0e, 0x0a, 0x0c, 0x4b, 0x69, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x32, 0x61, 0x0a, 0x07, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x2b, 0x0a, 0x08, 0x54, 0x6f, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x0c, 0x2e, 0x54, 0x6f, 0x43, 0x6c, diff --git a/Proto/RpcServer/gen/git.hlsq.asia/mmorpg/service-common/proto/rs/grpc_pb/service_qgdzs.pb.go b/Proto/RpcServer/gen/git.hlsq.asia/mmorpg/service-common/proto/rs/grpc_pb/service_qgdzs.pb.go index 9ecf4d9..73d9306 100644 --- a/Proto/RpcServer/gen/git.hlsq.asia/mmorpg/service-common/proto/rs/grpc_pb/service_qgdzs.pb.go +++ b/Proto/RpcServer/gen/git.hlsq.asia/mmorpg/service-common/proto/rs/grpc_pb/service_qgdzs.pb.go @@ -108,17 +108,15 @@ func (*GenerateQuestionResp) Descriptor() ([]byte, []int) { return file_service_qgdzs_proto_rawDescGZIP(), []int{1} } -// ---------- GetQuestion ---------- -type GetQuestionReq struct { +// ---------- RandomGetQuestion ---------- +type RandomGetQuestionReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - CategorySn string `protobuf:"bytes,1,opt,name=CategorySn,json=category_sn,proto3" json:"CategorySn,omitempty"` // 类目唯一标识 } -func (x *GetQuestionReq) Reset() { - *x = GetQuestionReq{} +func (x *RandomGetQuestionReq) Reset() { + *x = RandomGetQuestionReq{} if protoimpl.UnsafeEnabled { mi := &file_service_qgdzs_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -126,13 +124,13 @@ func (x *GetQuestionReq) Reset() { } } -func (x *GetQuestionReq) String() string { +func (x *RandomGetQuestionReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetQuestionReq) ProtoMessage() {} +func (*RandomGetQuestionReq) ProtoMessage() {} -func (x *GetQuestionReq) ProtoReflect() protoreflect.Message { +func (x *RandomGetQuestionReq) ProtoReflect() protoreflect.Message { mi := &file_service_qgdzs_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -144,32 +142,25 @@ func (x *GetQuestionReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetQuestionReq.ProtoReflect.Descriptor instead. -func (*GetQuestionReq) Descriptor() ([]byte, []int) { +// Deprecated: Use RandomGetQuestionReq.ProtoReflect.Descriptor instead. +func (*RandomGetQuestionReq) Descriptor() ([]byte, []int) { return file_service_qgdzs_proto_rawDescGZIP(), []int{2} } -func (x *GetQuestionReq) GetCategorySn() string { - if x != nil { - return x.CategorySn - } - return "" -} - -type GetQuestionResp struct { +type RandomGetQuestionResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Sn string `protobuf:"bytes,1,opt,name=Sn,json=sn,proto3" json:"Sn,omitempty"` // 题目唯一标识 + Sn int64 `protobuf:"varint,1,opt,name=Sn,json=sn,proto3" json:"Sn,omitempty"` // 题目唯一标识 Question string `protobuf:"bytes,2,opt,name=Question,json=question,proto3" json:"Question,omitempty"` // 题干 Options []string `protobuf:"bytes,3,rep,name=Options,json=options,proto3" json:"Options,omitempty"` // 选项 Category string `protobuf:"bytes,4,opt,name=Category,json=category,proto3" json:"Category,omitempty"` // 题目类型 Difficulty int32 `protobuf:"varint,5,opt,name=Difficulty,json=difficulty,proto3" json:"Difficulty,omitempty"` // 难度 } -func (x *GetQuestionResp) Reset() { - *x = GetQuestionResp{} +func (x *RandomGetQuestionResp) Reset() { + *x = RandomGetQuestionResp{} if protoimpl.UnsafeEnabled { mi := &file_service_qgdzs_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -177,13 +168,13 @@ func (x *GetQuestionResp) Reset() { } } -func (x *GetQuestionResp) String() string { +func (x *RandomGetQuestionResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetQuestionResp) ProtoMessage() {} +func (*RandomGetQuestionResp) ProtoMessage() {} -func (x *GetQuestionResp) ProtoReflect() protoreflect.Message { +func (x *RandomGetQuestionResp) ProtoReflect() protoreflect.Message { mi := &file_service_qgdzs_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -195,57 +186,59 @@ func (x *GetQuestionResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetQuestionResp.ProtoReflect.Descriptor instead. -func (*GetQuestionResp) Descriptor() ([]byte, []int) { +// Deprecated: Use RandomGetQuestionResp.ProtoReflect.Descriptor instead. +func (*RandomGetQuestionResp) Descriptor() ([]byte, []int) { return file_service_qgdzs_proto_rawDescGZIP(), []int{3} } -func (x *GetQuestionResp) GetSn() string { +func (x *RandomGetQuestionResp) GetSn() int64 { if x != nil { return x.Sn } - return "" + return 0 } -func (x *GetQuestionResp) GetQuestion() string { +func (x *RandomGetQuestionResp) GetQuestion() string { if x != nil { return x.Question } return "" } -func (x *GetQuestionResp) GetOptions() []string { +func (x *RandomGetQuestionResp) GetOptions() []string { if x != nil { return x.Options } return nil } -func (x *GetQuestionResp) GetCategory() string { +func (x *RandomGetQuestionResp) GetCategory() string { if x != nil { return x.Category } return "" } -func (x *GetQuestionResp) GetDifficulty() int32 { +func (x *RandomGetQuestionResp) GetDifficulty() int32 { if x != nil { return x.Difficulty } return 0 } -// ---------- GetQuestionInfo ---------- -type GetQuestionInfoReq struct { +// ---------- RandomAnswerQuestion ---------- +type RandomAnswerQuestionReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - QuestionSn string `protobuf:"bytes,1,opt,name=QuestionSn,json=question_sn,proto3" json:"QuestionSn,omitempty"` // 题目唯一标识 + USN int64 `protobuf:"varint,1,opt,name=USN,json=usn,proto3" json:"USN,omitempty"` + Sn int64 `protobuf:"varint,2,opt,name=Sn,json=sn,proto3" json:"Sn,omitempty"` // 题目唯一标识 + Answer string `protobuf:"bytes,3,opt,name=Answer,json=answer,proto3" json:"Answer,omitempty"` // 答案 } -func (x *GetQuestionInfoReq) Reset() { - *x = GetQuestionInfoReq{} +func (x *RandomAnswerQuestionReq) Reset() { + *x = RandomAnswerQuestionReq{} if protoimpl.UnsafeEnabled { mi := &file_service_qgdzs_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -253,13 +246,13 @@ func (x *GetQuestionInfoReq) Reset() { } } -func (x *GetQuestionInfoReq) String() string { +func (x *RandomAnswerQuestionReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetQuestionInfoReq) ProtoMessage() {} +func (*RandomAnswerQuestionReq) ProtoMessage() {} -func (x *GetQuestionInfoReq) ProtoReflect() protoreflect.Message { +func (x *RandomAnswerQuestionReq) ProtoReflect() protoreflect.Message { mi := &file_service_qgdzs_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -271,32 +264,43 @@ func (x *GetQuestionInfoReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetQuestionInfoReq.ProtoReflect.Descriptor instead. -func (*GetQuestionInfoReq) Descriptor() ([]byte, []int) { +// Deprecated: Use RandomAnswerQuestionReq.ProtoReflect.Descriptor instead. +func (*RandomAnswerQuestionReq) Descriptor() ([]byte, []int) { return file_service_qgdzs_proto_rawDescGZIP(), []int{4} } -func (x *GetQuestionInfoReq) GetQuestionSn() string { +func (x *RandomAnswerQuestionReq) GetUSN() int64 { if x != nil { - return x.QuestionSn + return x.USN + } + return 0 +} + +func (x *RandomAnswerQuestionReq) GetSn() int64 { + if x != nil { + return x.Sn + } + return 0 +} + +func (x *RandomAnswerQuestionReq) GetAnswer() string { + if x != nil { + return x.Answer } return "" } -type GetQuestionInfoResp struct { +type RandomAnswerQuestionResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Question string `protobuf:"bytes,1,opt,name=Question,json=question,proto3" json:"Question,omitempty"` // 题干 - Options []string `protobuf:"bytes,2,rep,name=Options,json=options,proto3" json:"Options,omitempty"` // 选项 - Category string `protobuf:"bytes,3,opt,name=Category,json=category,proto3" json:"Category,omitempty"` // 类目 - Difficulty int32 `protobuf:"varint,4,opt,name=Difficulty,json=difficulty,proto3" json:"Difficulty,omitempty"` // 难度 - Explanation string `protobuf:"bytes,5,opt,name=Explanation,json=explanation,proto3" json:"Explanation,omitempty"` // 解析 + Answer string `protobuf:"bytes,1,opt,name=Answer,json=answer,proto3" json:"Answer,omitempty"` // 答案 + Explanation string `protobuf:"bytes,2,opt,name=Explanation,json=explanation,proto3" json:"Explanation,omitempty"` // 解析 } -func (x *GetQuestionInfoResp) Reset() { - *x = GetQuestionInfoResp{} +func (x *RandomAnswerQuestionResp) Reset() { + *x = RandomAnswerQuestionResp{} if protoimpl.UnsafeEnabled { mi := &file_service_qgdzs_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -304,13 +308,13 @@ func (x *GetQuestionInfoResp) Reset() { } } -func (x *GetQuestionInfoResp) String() string { +func (x *RandomAnswerQuestionResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetQuestionInfoResp) ProtoMessage() {} +func (*RandomAnswerQuestionResp) ProtoMessage() {} -func (x *GetQuestionInfoResp) ProtoReflect() protoreflect.Message { +func (x *RandomAnswerQuestionResp) ProtoReflect() protoreflect.Message { mi := &file_service_qgdzs_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -322,159 +326,19 @@ func (x *GetQuestionInfoResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetQuestionInfoResp.ProtoReflect.Descriptor instead. -func (*GetQuestionInfoResp) Descriptor() ([]byte, []int) { +// Deprecated: Use RandomAnswerQuestionResp.ProtoReflect.Descriptor instead. +func (*RandomAnswerQuestionResp) Descriptor() ([]byte, []int) { return file_service_qgdzs_proto_rawDescGZIP(), []int{5} } -func (x *GetQuestionInfoResp) GetQuestion() string { - if x != nil { - return x.Question - } - return "" -} - -func (x *GetQuestionInfoResp) GetOptions() []string { - if x != nil { - return x.Options - } - return nil -} - -func (x *GetQuestionInfoResp) GetCategory() string { - if x != nil { - return x.Category - } - return "" -} - -func (x *GetQuestionInfoResp) GetDifficulty() int32 { - if x != nil { - return x.Difficulty - } - return 0 -} - -func (x *GetQuestionInfoResp) GetExplanation() string { - if x != nil { - return x.Explanation - } - return "" -} - -// ---------- AnswerQuestion ---------- -type AnswerQuestionReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - USN string `protobuf:"bytes,1,opt,name=USN,json=usn,proto3" json:"USN,omitempty"` - Sn string `protobuf:"bytes,2,opt,name=Sn,json=sn,proto3" json:"Sn,omitempty"` // 题目唯一标识 - Answer string `protobuf:"bytes,3,opt,name=Answer,json=answer,proto3" json:"Answer,omitempty"` // 答案 -} - -func (x *AnswerQuestionReq) Reset() { - *x = AnswerQuestionReq{} - if protoimpl.UnsafeEnabled { - mi := &file_service_qgdzs_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AnswerQuestionReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AnswerQuestionReq) ProtoMessage() {} - -func (x *AnswerQuestionReq) ProtoReflect() protoreflect.Message { - mi := &file_service_qgdzs_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AnswerQuestionReq.ProtoReflect.Descriptor instead. -func (*AnswerQuestionReq) Descriptor() ([]byte, []int) { - return file_service_qgdzs_proto_rawDescGZIP(), []int{6} -} - -func (x *AnswerQuestionReq) GetUSN() string { - if x != nil { - return x.USN - } - return "" -} - -func (x *AnswerQuestionReq) GetSn() string { - if x != nil { - return x.Sn - } - return "" -} - -func (x *AnswerQuestionReq) GetAnswer() string { +func (x *RandomAnswerQuestionResp) GetAnswer() string { if x != nil { return x.Answer } return "" } -type AnswerQuestionResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Answer string `protobuf:"bytes,1,opt,name=Answer,json=answer,proto3" json:"Answer,omitempty"` // 答案 - Explanation string `protobuf:"bytes,2,opt,name=Explanation,json=explanation,proto3" json:"Explanation,omitempty"` // 解析 -} - -func (x *AnswerQuestionResp) Reset() { - *x = AnswerQuestionResp{} - if protoimpl.UnsafeEnabled { - mi := &file_service_qgdzs_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AnswerQuestionResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AnswerQuestionResp) ProtoMessage() {} - -func (x *AnswerQuestionResp) ProtoReflect() protoreflect.Message { - mi := &file_service_qgdzs_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AnswerQuestionResp.ProtoReflect.Descriptor instead. -func (*AnswerQuestionResp) Descriptor() ([]byte, []int) { - return file_service_qgdzs_proto_rawDescGZIP(), []int{7} -} - -func (x *AnswerQuestionResp) GetAnswer() string { - if x != nil { - return x.Answer - } - return "" -} - -func (x *AnswerQuestionResp) GetExplanation() string { +func (x *RandomAnswerQuestionResp) GetExplanation() string { if x != nil { return x.Explanation } @@ -491,7 +355,7 @@ type GetAllCategoryReq struct { func (x *GetAllCategoryReq) Reset() { *x = GetAllCategoryReq{} if protoimpl.UnsafeEnabled { - mi := &file_service_qgdzs_proto_msgTypes[8] + mi := &file_service_qgdzs_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -504,7 +368,7 @@ func (x *GetAllCategoryReq) String() string { func (*GetAllCategoryReq) ProtoMessage() {} func (x *GetAllCategoryReq) ProtoReflect() protoreflect.Message { - mi := &file_service_qgdzs_proto_msgTypes[8] + mi := &file_service_qgdzs_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -517,7 +381,7 @@ func (x *GetAllCategoryReq) ProtoReflect() protoreflect.Message { // Deprecated: Use GetAllCategoryReq.ProtoReflect.Descriptor instead. func (*GetAllCategoryReq) Descriptor() ([]byte, []int) { - return file_service_qgdzs_proto_rawDescGZIP(), []int{8} + return file_service_qgdzs_proto_rawDescGZIP(), []int{6} } type GetAllCategoryResp struct { @@ -531,7 +395,7 @@ type GetAllCategoryResp struct { func (x *GetAllCategoryResp) Reset() { *x = GetAllCategoryResp{} if protoimpl.UnsafeEnabled { - mi := &file_service_qgdzs_proto_msgTypes[9] + mi := &file_service_qgdzs_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -544,7 +408,7 @@ func (x *GetAllCategoryResp) String() string { func (*GetAllCategoryResp) ProtoMessage() {} func (x *GetAllCategoryResp) ProtoReflect() protoreflect.Message { - mi := &file_service_qgdzs_proto_msgTypes[9] + mi := &file_service_qgdzs_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -557,7 +421,7 @@ func (x *GetAllCategoryResp) ProtoReflect() protoreflect.Message { // Deprecated: Use GetAllCategoryResp.ProtoReflect.Descriptor instead. func (*GetAllCategoryResp) Descriptor() ([]byte, []int) { - return file_service_qgdzs_proto_rawDescGZIP(), []int{9} + return file_service_qgdzs_proto_rawDescGZIP(), []int{7} } func (x *GetAllCategoryResp) GetCategories() []*GetAllCategoryItem { @@ -572,14 +436,14 @@ type GetAllCategoryItem struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Sn string `protobuf:"bytes,1,opt,name=Sn,json=sn,proto3" json:"Sn,omitempty"` // 唯一标识 + Sn int64 `protobuf:"varint,1,opt,name=Sn,json=sn,proto3" json:"Sn,omitempty"` // 唯一标识 Category string `protobuf:"bytes,2,opt,name=Category,json=category,proto3" json:"Category,omitempty"` // 类目 } func (x *GetAllCategoryItem) Reset() { *x = GetAllCategoryItem{} if protoimpl.UnsafeEnabled { - mi := &file_service_qgdzs_proto_msgTypes[10] + mi := &file_service_qgdzs_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -592,7 +456,7 @@ func (x *GetAllCategoryItem) String() string { func (*GetAllCategoryItem) ProtoMessage() {} func (x *GetAllCategoryItem) ProtoReflect() protoreflect.Message { - mi := &file_service_qgdzs_proto_msgTypes[10] + mi := &file_service_qgdzs_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -605,14 +469,14 @@ func (x *GetAllCategoryItem) ProtoReflect() protoreflect.Message { // Deprecated: Use GetAllCategoryItem.ProtoReflect.Descriptor instead. func (*GetAllCategoryItem) Descriptor() ([]byte, []int) { - return file_service_qgdzs_proto_rawDescGZIP(), []int{10} + return file_service_qgdzs_proto_rawDescGZIP(), []int{8} } -func (x *GetAllCategoryItem) GetSn() string { +func (x *GetAllCategoryItem) GetSn() int64 { if x != nil { return x.Sn } - return "" + return 0 } func (x *GetAllCategoryItem) GetCategory() string { @@ -622,21 +486,504 @@ func (x *GetAllCategoryItem) GetCategory() string { return "" } +// ---------- CategoryGetQuestion ---------- +type CategoryGetQuestionReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CategorySn int64 `protobuf:"varint,1,opt,name=CategorySn,json=category_sn,proto3" json:"CategorySn,omitempty"` // 类目唯一标识 +} + +func (x *CategoryGetQuestionReq) Reset() { + *x = CategoryGetQuestionReq{} + if protoimpl.UnsafeEnabled { + mi := &file_service_qgdzs_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CategoryGetQuestionReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CategoryGetQuestionReq) ProtoMessage() {} + +func (x *CategoryGetQuestionReq) ProtoReflect() protoreflect.Message { + mi := &file_service_qgdzs_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CategoryGetQuestionReq.ProtoReflect.Descriptor instead. +func (*CategoryGetQuestionReq) Descriptor() ([]byte, []int) { + return file_service_qgdzs_proto_rawDescGZIP(), []int{9} +} + +func (x *CategoryGetQuestionReq) GetCategorySn() int64 { + if x != nil { + return x.CategorySn + } + return 0 +} + +type CategoryGetQuestionResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Sn int64 `protobuf:"varint,1,opt,name=Sn,json=sn,proto3" json:"Sn,omitempty"` // 题目唯一标识 + Question string `protobuf:"bytes,2,opt,name=Question,json=question,proto3" json:"Question,omitempty"` // 题干 + Options []string `protobuf:"bytes,3,rep,name=Options,json=options,proto3" json:"Options,omitempty"` // 选项 + Category string `protobuf:"bytes,4,opt,name=Category,json=category,proto3" json:"Category,omitempty"` // 题目类型 + Difficulty int32 `protobuf:"varint,5,opt,name=Difficulty,json=difficulty,proto3" json:"Difficulty,omitempty"` // 难度 +} + +func (x *CategoryGetQuestionResp) Reset() { + *x = CategoryGetQuestionResp{} + if protoimpl.UnsafeEnabled { + mi := &file_service_qgdzs_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CategoryGetQuestionResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CategoryGetQuestionResp) ProtoMessage() {} + +func (x *CategoryGetQuestionResp) ProtoReflect() protoreflect.Message { + mi := &file_service_qgdzs_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CategoryGetQuestionResp.ProtoReflect.Descriptor instead. +func (*CategoryGetQuestionResp) Descriptor() ([]byte, []int) { + return file_service_qgdzs_proto_rawDescGZIP(), []int{10} +} + +func (x *CategoryGetQuestionResp) GetSn() int64 { + if x != nil { + return x.Sn + } + return 0 +} + +func (x *CategoryGetQuestionResp) GetQuestion() string { + if x != nil { + return x.Question + } + return "" +} + +func (x *CategoryGetQuestionResp) GetOptions() []string { + if x != nil { + return x.Options + } + return nil +} + +func (x *CategoryGetQuestionResp) GetCategory() string { + if x != nil { + return x.Category + } + return "" +} + +func (x *CategoryGetQuestionResp) GetDifficulty() int32 { + if x != nil { + return x.Difficulty + } + return 0 +} + +// ---------- CategoryAnswerQuestion ---------- +type CategoryAnswerQuestionReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + USN int64 `protobuf:"varint,1,opt,name=USN,json=usn,proto3" json:"USN,omitempty"` + Sn int64 `protobuf:"varint,2,opt,name=Sn,json=sn,proto3" json:"Sn,omitempty"` // 题目唯一标识 + Answer string `protobuf:"bytes,3,opt,name=Answer,json=answer,proto3" json:"Answer,omitempty"` // 答案 +} + +func (x *CategoryAnswerQuestionReq) Reset() { + *x = CategoryAnswerQuestionReq{} + if protoimpl.UnsafeEnabled { + mi := &file_service_qgdzs_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CategoryAnswerQuestionReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CategoryAnswerQuestionReq) ProtoMessage() {} + +func (x *CategoryAnswerQuestionReq) ProtoReflect() protoreflect.Message { + mi := &file_service_qgdzs_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CategoryAnswerQuestionReq.ProtoReflect.Descriptor instead. +func (*CategoryAnswerQuestionReq) Descriptor() ([]byte, []int) { + return file_service_qgdzs_proto_rawDescGZIP(), []int{11} +} + +func (x *CategoryAnswerQuestionReq) GetUSN() int64 { + if x != nil { + return x.USN + } + return 0 +} + +func (x *CategoryAnswerQuestionReq) GetSn() int64 { + if x != nil { + return x.Sn + } + return 0 +} + +func (x *CategoryAnswerQuestionReq) GetAnswer() string { + if x != nil { + return x.Answer + } + return "" +} + +type CategoryAnswerQuestionResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Answer string `protobuf:"bytes,1,opt,name=Answer,json=answer,proto3" json:"Answer,omitempty"` // 答案 + Explanation string `protobuf:"bytes,2,opt,name=Explanation,json=explanation,proto3" json:"Explanation,omitempty"` // 解析 +} + +func (x *CategoryAnswerQuestionResp) Reset() { + *x = CategoryAnswerQuestionResp{} + if protoimpl.UnsafeEnabled { + mi := &file_service_qgdzs_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CategoryAnswerQuestionResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CategoryAnswerQuestionResp) ProtoMessage() {} + +func (x *CategoryAnswerQuestionResp) ProtoReflect() protoreflect.Message { + mi := &file_service_qgdzs_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CategoryAnswerQuestionResp.ProtoReflect.Descriptor instead. +func (*CategoryAnswerQuestionResp) Descriptor() ([]byte, []int) { + return file_service_qgdzs_proto_rawDescGZIP(), []int{12} +} + +func (x *CategoryAnswerQuestionResp) GetAnswer() string { + if x != nil { + return x.Answer + } + return "" +} + +func (x *CategoryAnswerQuestionResp) GetExplanation() string { + if x != nil { + return x.Explanation + } + return "" +} + +// ---------- QuicklyGetQuestion ---------- +type QuicklyGetQuestionReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QuicklyGetQuestionReq) Reset() { + *x = QuicklyGetQuestionReq{} + if protoimpl.UnsafeEnabled { + mi := &file_service_qgdzs_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QuicklyGetQuestionReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuicklyGetQuestionReq) ProtoMessage() {} + +func (x *QuicklyGetQuestionReq) ProtoReflect() protoreflect.Message { + mi := &file_service_qgdzs_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QuicklyGetQuestionReq.ProtoReflect.Descriptor instead. +func (*QuicklyGetQuestionReq) Descriptor() ([]byte, []int) { + return file_service_qgdzs_proto_rawDescGZIP(), []int{13} +} + +type QuicklyGetQuestionResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Sn int64 `protobuf:"varint,1,opt,name=Sn,json=sn,proto3" json:"Sn,omitempty"` // 题目唯一标识 + Question string `protobuf:"bytes,2,opt,name=Question,json=question,proto3" json:"Question,omitempty"` // 题干 + Options []string `protobuf:"bytes,3,rep,name=Options,json=options,proto3" json:"Options,omitempty"` // 选项 + Category string `protobuf:"bytes,4,opt,name=Category,json=category,proto3" json:"Category,omitempty"` // 题目类型 + Difficulty int32 `protobuf:"varint,5,opt,name=Difficulty,json=difficulty,proto3" json:"Difficulty,omitempty"` // 难度 +} + +func (x *QuicklyGetQuestionResp) Reset() { + *x = QuicklyGetQuestionResp{} + if protoimpl.UnsafeEnabled { + mi := &file_service_qgdzs_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QuicklyGetQuestionResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuicklyGetQuestionResp) ProtoMessage() {} + +func (x *QuicklyGetQuestionResp) ProtoReflect() protoreflect.Message { + mi := &file_service_qgdzs_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QuicklyGetQuestionResp.ProtoReflect.Descriptor instead. +func (*QuicklyGetQuestionResp) Descriptor() ([]byte, []int) { + return file_service_qgdzs_proto_rawDescGZIP(), []int{14} +} + +func (x *QuicklyGetQuestionResp) GetSn() int64 { + if x != nil { + return x.Sn + } + return 0 +} + +func (x *QuicklyGetQuestionResp) GetQuestion() string { + if x != nil { + return x.Question + } + return "" +} + +func (x *QuicklyGetQuestionResp) GetOptions() []string { + if x != nil { + return x.Options + } + return nil +} + +func (x *QuicklyGetQuestionResp) GetCategory() string { + if x != nil { + return x.Category + } + return "" +} + +func (x *QuicklyGetQuestionResp) GetDifficulty() int32 { + if x != nil { + return x.Difficulty + } + return 0 +} + +// ---------- QuicklyAnswerQuestion ---------- +type QuicklyAnswerQuestionReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + USN int64 `protobuf:"varint,1,opt,name=USN,json=usn,proto3" json:"USN,omitempty"` + Sn int64 `protobuf:"varint,2,opt,name=Sn,json=sn,proto3" json:"Sn,omitempty"` // 题目唯一标识 + Answer string `protobuf:"bytes,3,opt,name=Answer,json=answer,proto3" json:"Answer,omitempty"` // 答案 +} + +func (x *QuicklyAnswerQuestionReq) Reset() { + *x = QuicklyAnswerQuestionReq{} + if protoimpl.UnsafeEnabled { + mi := &file_service_qgdzs_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QuicklyAnswerQuestionReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuicklyAnswerQuestionReq) ProtoMessage() {} + +func (x *QuicklyAnswerQuestionReq) ProtoReflect() protoreflect.Message { + mi := &file_service_qgdzs_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QuicklyAnswerQuestionReq.ProtoReflect.Descriptor instead. +func (*QuicklyAnswerQuestionReq) Descriptor() ([]byte, []int) { + return file_service_qgdzs_proto_rawDescGZIP(), []int{15} +} + +func (x *QuicklyAnswerQuestionReq) GetUSN() int64 { + if x != nil { + return x.USN + } + return 0 +} + +func (x *QuicklyAnswerQuestionReq) GetSn() int64 { + if x != nil { + return x.Sn + } + return 0 +} + +func (x *QuicklyAnswerQuestionReq) GetAnswer() string { + if x != nil { + return x.Answer + } + return "" +} + +type QuicklyAnswerQuestionResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Answer string `protobuf:"bytes,1,opt,name=Answer,json=answer,proto3" json:"Answer,omitempty"` // 答案 + Explanation string `protobuf:"bytes,2,opt,name=Explanation,json=explanation,proto3" json:"Explanation,omitempty"` // 解析 +} + +func (x *QuicklyAnswerQuestionResp) Reset() { + *x = QuicklyAnswerQuestionResp{} + if protoimpl.UnsafeEnabled { + mi := &file_service_qgdzs_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QuicklyAnswerQuestionResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuicklyAnswerQuestionResp) ProtoMessage() {} + +func (x *QuicklyAnswerQuestionResp) ProtoReflect() protoreflect.Message { + mi := &file_service_qgdzs_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QuicklyAnswerQuestionResp.ProtoReflect.Descriptor instead. +func (*QuicklyAnswerQuestionResp) Descriptor() ([]byte, []int) { + return file_service_qgdzs_proto_rawDescGZIP(), []int{16} +} + +func (x *QuicklyAnswerQuestionResp) GetAnswer() string { + if x != nil { + return x.Answer + } + return "" +} + +func (x *QuicklyAnswerQuestionResp) GetExplanation() string { + if x != nil { + return x.Explanation + } + return "" +} + // ---------- GetRecord ---------- type GetRecordReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - USN string `protobuf:"bytes,1,opt,name=USN,json=usn,proto3" json:"USN,omitempty"` - Page int32 `protobuf:"varint,2,opt,name=Page,json=page,proto3" json:"Page,omitempty"` - PageSize int32 `protobuf:"varint,3,opt,name=PageSize,json=page_size,proto3" json:"PageSize,omitempty"` + USN int64 `protobuf:"varint,1,opt,name=USN,json=usn,proto3" json:"USN,omitempty"` + Page int32 `protobuf:"varint,2,opt,name=Page,json=page,proto3" json:"Page,omitempty"` + PageSize int32 `protobuf:"varint,3,opt,name=PageSize,json=page_size,proto3" json:"PageSize,omitempty"` } func (x *GetRecordReq) Reset() { *x = GetRecordReq{} if protoimpl.UnsafeEnabled { - mi := &file_service_qgdzs_proto_msgTypes[11] + mi := &file_service_qgdzs_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -649,7 +996,7 @@ func (x *GetRecordReq) String() string { func (*GetRecordReq) ProtoMessage() {} func (x *GetRecordReq) ProtoReflect() protoreflect.Message { - mi := &file_service_qgdzs_proto_msgTypes[11] + mi := &file_service_qgdzs_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -662,14 +1009,14 @@ func (x *GetRecordReq) ProtoReflect() protoreflect.Message { // Deprecated: Use GetRecordReq.ProtoReflect.Descriptor instead. func (*GetRecordReq) Descriptor() ([]byte, []int) { - return file_service_qgdzs_proto_rawDescGZIP(), []int{11} + return file_service_qgdzs_proto_rawDescGZIP(), []int{17} } -func (x *GetRecordReq) GetUSN() string { +func (x *GetRecordReq) GetUSN() int64 { if x != nil { return x.USN } - return "" + return 0 } func (x *GetRecordReq) GetPage() int32 { @@ -698,7 +1045,7 @@ type GetRecordResp struct { func (x *GetRecordResp) Reset() { *x = GetRecordResp{} if protoimpl.UnsafeEnabled { - mi := &file_service_qgdzs_proto_msgTypes[12] + mi := &file_service_qgdzs_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -711,7 +1058,7 @@ func (x *GetRecordResp) String() string { func (*GetRecordResp) ProtoMessage() {} func (x *GetRecordResp) ProtoReflect() protoreflect.Message { - mi := &file_service_qgdzs_proto_msgTypes[12] + mi := &file_service_qgdzs_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -724,7 +1071,7 @@ func (x *GetRecordResp) ProtoReflect() protoreflect.Message { // Deprecated: Use GetRecordResp.ProtoReflect.Descriptor instead. func (*GetRecordResp) Descriptor() ([]byte, []int) { - return file_service_qgdzs_proto_rawDescGZIP(), []int{12} + return file_service_qgdzs_proto_rawDescGZIP(), []int{18} } func (x *GetRecordResp) GetCount() int32 { @@ -746,7 +1093,7 @@ type GetRecordItem struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - QuestionSn string `protobuf:"bytes,1,opt,name=QuestionSn,json=question_sn,proto3" json:"QuestionSn,omitempty"` // 题目唯一标识 + QuestionSn int64 `protobuf:"varint,1,opt,name=QuestionSn,json=question_sn,proto3" json:"QuestionSn,omitempty"` // 题目唯一标识 Question string `protobuf:"bytes,2,opt,name=Question,json=question,proto3" json:"Question,omitempty"` // 题干 Difficulty int32 `protobuf:"varint,3,opt,name=Difficulty,json=difficulty,proto3" json:"Difficulty,omitempty"` // 难度 Category string `protobuf:"bytes,4,opt,name=Category,json=category,proto3" json:"Category,omitempty"` // 题目类型 @@ -758,7 +1105,7 @@ type GetRecordItem struct { func (x *GetRecordItem) Reset() { *x = GetRecordItem{} if protoimpl.UnsafeEnabled { - mi := &file_service_qgdzs_proto_msgTypes[13] + mi := &file_service_qgdzs_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -771,7 +1118,7 @@ func (x *GetRecordItem) String() string { func (*GetRecordItem) ProtoMessage() {} func (x *GetRecordItem) ProtoReflect() protoreflect.Message { - mi := &file_service_qgdzs_proto_msgTypes[13] + mi := &file_service_qgdzs_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -784,14 +1131,14 @@ func (x *GetRecordItem) ProtoReflect() protoreflect.Message { // Deprecated: Use GetRecordItem.ProtoReflect.Descriptor instead. func (*GetRecordItem) Descriptor() ([]byte, []int) { - return file_service_qgdzs_proto_rawDescGZIP(), []int{13} + return file_service_qgdzs_proto_rawDescGZIP(), []int{19} } -func (x *GetRecordItem) GetQuestionSn() string { +func (x *GetRecordItem) GetQuestionSn() int64 { if x != nil { return x.QuestionSn } - return "" + return 0 } func (x *GetRecordItem) GetQuestion() string { @@ -836,6 +1183,133 @@ func (x *GetRecordItem) GetCreateTime() int64 { return 0 } +// ---------- GetQuestionInfo ---------- +type GetQuestionInfoReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + QuestionSn int64 `protobuf:"varint,1,opt,name=QuestionSn,json=question_sn,proto3" json:"QuestionSn,omitempty"` // 题目唯一标识 +} + +func (x *GetQuestionInfoReq) Reset() { + *x = GetQuestionInfoReq{} + if protoimpl.UnsafeEnabled { + mi := &file_service_qgdzs_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetQuestionInfoReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetQuestionInfoReq) ProtoMessage() {} + +func (x *GetQuestionInfoReq) ProtoReflect() protoreflect.Message { + mi := &file_service_qgdzs_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetQuestionInfoReq.ProtoReflect.Descriptor instead. +func (*GetQuestionInfoReq) Descriptor() ([]byte, []int) { + return file_service_qgdzs_proto_rawDescGZIP(), []int{20} +} + +func (x *GetQuestionInfoReq) GetQuestionSn() int64 { + if x != nil { + return x.QuestionSn + } + return 0 +} + +type GetQuestionInfoResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Question string `protobuf:"bytes,1,opt,name=Question,json=question,proto3" json:"Question,omitempty"` // 题干 + Options []string `protobuf:"bytes,2,rep,name=Options,json=options,proto3" json:"Options,omitempty"` // 选项 + Category string `protobuf:"bytes,3,opt,name=Category,json=category,proto3" json:"Category,omitempty"` // 类目 + Difficulty int32 `protobuf:"varint,4,opt,name=Difficulty,json=difficulty,proto3" json:"Difficulty,omitempty"` // 难度 + Explanation string `protobuf:"bytes,5,opt,name=Explanation,json=explanation,proto3" json:"Explanation,omitempty"` // 解析 +} + +func (x *GetQuestionInfoResp) Reset() { + *x = GetQuestionInfoResp{} + if protoimpl.UnsafeEnabled { + mi := &file_service_qgdzs_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetQuestionInfoResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetQuestionInfoResp) ProtoMessage() {} + +func (x *GetQuestionInfoResp) ProtoReflect() protoreflect.Message { + mi := &file_service_qgdzs_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetQuestionInfoResp.ProtoReflect.Descriptor instead. +func (*GetQuestionInfoResp) Descriptor() ([]byte, []int) { + return file_service_qgdzs_proto_rawDescGZIP(), []int{21} +} + +func (x *GetQuestionInfoResp) GetQuestion() string { + if x != nil { + return x.Question + } + return "" +} + +func (x *GetQuestionInfoResp) GetOptions() []string { + if x != nil { + return x.Options + } + return nil +} + +func (x *GetQuestionInfoResp) GetCategory() string { + if x != nil { + return x.Category + } + return "" +} + +func (x *GetQuestionInfoResp) GetDifficulty() int32 { + if x != nil { + return x.Difficulty + } + return 0 +} + +func (x *GetQuestionInfoResp) GetExplanation() string { + if x != nil { + return x.Explanation + } + return "" +} + var File_service_qgdzs_proto protoreflect.FileDescriptor var file_service_qgdzs_proto_rawDesc = []byte{ @@ -847,119 +1321,197 @@ var file_service_qgdzs_proto_rawDesc = []byte{ 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x4e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x22, 0x16, 0x0a, 0x14, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, 0x31, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, 0x73, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x0a, 0x43, 0x61, 0x74, 0x65, 0x67, - 0x6f, 0x72, 0x79, 0x53, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x61, 0x74, - 0x65, 0x67, 0x6f, 0x72, 0x79, 0x5f, 0x73, 0x6e, 0x22, 0x93, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, - 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, - 0x53, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x73, 0x6e, 0x12, 0x1a, 0x0a, 0x08, - 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x1e, - 0x0a, 0x0a, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x22, 0x35, - 0x0a, 0x12, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x0a, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, - 0x53, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x73, 0x6e, 0x22, 0xa9, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, - 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1a, 0x0a, - 0x08, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, 0x16, 0x0a, 0x14, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x47, + 0x65, 0x74, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x22, 0x99, 0x01, + 0x0a, 0x15, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, 0x73, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x53, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x73, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x51, 0x75, 0x65, 0x73, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1a, 0x0a, + 0x08, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x44, 0x69, 0x66, + 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x64, + 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x22, 0x53, 0x0a, 0x17, 0x52, 0x61, 0x6e, + 0x64, 0x6f, 0x6d, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x53, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x03, 0x75, 0x73, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x53, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x02, 0x73, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x22, 0x54, + 0x0a, 0x18, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x51, 0x75, + 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x6e, + 0x73, 0x77, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x6e, 0x73, 0x77, + 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x45, 0x78, 0x70, 0x6c, 0x61, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x13, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x61, + 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x22, 0x49, 0x0a, 0x12, 0x47, 0x65, 0x74, + 0x41, 0x6c, 0x6c, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x33, 0x0a, 0x0a, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x61, 0x74, 0x65, + 0x67, 0x6f, 0x72, 0x79, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, + 0x72, 0x69, 0x65, 0x73, 0x22, 0x40, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x61, + 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x53, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x73, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x61, + 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, + 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x22, 0x39, 0x0a, 0x16, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, + 0x72, 0x79, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, + 0x12, 0x1f, 0x0a, 0x0a, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x53, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x5f, 0x73, + 0x6e, 0x22, 0x9b, 0x01, 0x0a, 0x17, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x47, 0x65, + 0x74, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, + 0x02, 0x53, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x73, 0x6e, 0x12, 0x1a, 0x0a, + 0x08, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, - 0x1e, 0x0a, 0x0a, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x12, - 0x20, 0x0a, 0x0b, 0x45, 0x78, 0x70, 0x6c, 0x61, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, + 0x1e, 0x0a, 0x0a, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x22, + 0x55, 0x0a, 0x19, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x41, 0x6e, 0x73, 0x77, 0x65, + 0x72, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, + 0x55, 0x53, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x73, 0x6e, 0x12, 0x0e, + 0x0a, 0x02, 0x53, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x73, 0x6e, 0x12, 0x16, + 0x0a, 0x06, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x22, 0x56, 0x0a, 0x1a, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, + 0x72, 0x79, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, + 0x45, 0x78, 0x70, 0x6c, 0x61, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x17, + 0x0a, 0x15, 0x51, 0x75, 0x69, 0x63, 0x6b, 0x6c, 0x79, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, 0x73, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x22, 0x9a, 0x01, 0x0a, 0x16, 0x51, 0x75, 0x69, 0x63, + 0x6b, 0x6c, 0x79, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x53, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, + 0x73, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, + 0x0a, 0x07, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x61, 0x74, 0x65, + 0x67, 0x6f, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, + 0x67, 0x6f, 0x72, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, + 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, + 0x75, 0x6c, 0x74, 0x79, 0x22, 0x54, 0x0a, 0x18, 0x51, 0x75, 0x69, 0x63, 0x6b, 0x6c, 0x79, 0x41, + 0x6e, 0x73, 0x77, 0x65, 0x72, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, + 0x12, 0x10, 0x0a, 0x03, 0x55, 0x53, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, + 0x73, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x53, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, + 0x73, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x22, 0x55, 0x0a, 0x19, 0x51, 0x75, + 0x69, 0x63, 0x6b, 0x6c, 0x79, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x51, 0x75, 0x65, 0x73, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x6e, 0x73, 0x77, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x12, + 0x20, 0x0a, 0x0b, 0x45, 0x78, 0x70, 0x6c, 0x61, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x6e, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x22, 0x4d, 0x0a, 0x11, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x51, 0x75, 0x65, 0x73, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x53, 0x4e, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x73, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x53, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x73, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x6e, 0x73, 0x77, - 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, - 0x22, 0x4e, 0x0a, 0x12, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x12, 0x20, - 0x0a, 0x0b, 0x45, 0x78, 0x70, 0x6c, 0x61, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x22, 0x13, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, - 0x72, 0x79, 0x52, 0x65, 0x71, 0x22, 0x49, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, - 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x33, 0x0a, 0x0a, 0x43, - 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x6e, 0x22, 0x51, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, + 0x71, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x53, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, + 0x75, 0x73, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x50, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x1b, 0x0a, 0x08, 0x50, 0x61, 0x67, 0x65, 0x53, + 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, + 0x73, 0x69, 0x7a, 0x65, 0x22, 0x4f, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x28, 0x0a, 0x07, 0x52, + 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x47, + 0x65, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x07, 0x72, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x73, 0x22, 0xea, 0x01, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x52, 0x65, 0x63, + 0x6f, 0x72, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x1f, 0x0a, 0x0a, 0x51, 0x75, 0x65, 0x73, 0x74, + 0x69, 0x6f, 0x6e, 0x53, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x51, 0x75, 0x65, 0x73, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, + 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, + 0x75, 0x6c, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, + 0x12, 0x27, 0x0a, 0x0e, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x73, 0x77, + 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x6e, 0x73, + 0x77, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x6e, 0x73, 0x77, 0x65, + 0x72, 0x12, 0x1f, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x22, 0x35, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x0a, 0x51, 0x75, 0x65, 0x73, + 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x6e, 0x22, 0xa9, 0x01, 0x0a, 0x13, 0x47, 0x65, + 0x74, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, + 0x07, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x61, 0x74, 0x65, 0x67, + 0x6f, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, + 0x6f, 0x72, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, + 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, + 0x6c, 0x74, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x45, 0x78, 0x70, 0x6c, 0x61, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0xc7, 0x08, 0x0a, 0x05, 0x51, 0x67, 0x64, 0x7a, 0x73, 0x12, + 0x69, 0x0a, 0x10, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x51, 0x75, + 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x47, 0x65, 0x6e, 0x65, + 0x72, 0x61, 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x01, 0x2a, 0x22, 0x1d, 0x2f, 0x71, 0x67, + 0x64, 0x7a, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x65, 0x5f, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x6a, 0x0a, 0x11, 0x52, 0x61, + 0x6e, 0x64, 0x6f, 0x6d, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x15, 0x2e, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, 0x73, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x47, + 0x65, 0x74, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, 0x26, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x71, 0x67, 0x64, 0x7a, + 0x73, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x2f, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x2f, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x71, 0x0a, 0x14, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, + 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, + 0x2e, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x51, 0x75, 0x65, + 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x52, 0x61, 0x6e, 0x64, 0x6f, + 0x6d, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x22, 0x24, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a, 0x22, 0x19, + 0x2f, 0x71, 0x67, 0x64, 0x7a, 0x73, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x2f, 0x72, 0x61, 0x6e, 0x64, + 0x6f, 0x6d, 0x2f, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x12, 0x67, 0x0a, 0x0e, 0x47, 0x65, 0x74, + 0x41, 0x6c, 0x6c, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x12, 0x2e, 0x47, 0x65, + 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, - 0x49, 0x74, 0x65, 0x6d, 0x52, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, - 0x22, 0x40, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, - 0x72, 0x79, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x53, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x73, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, - 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, - 0x72, 0x79, 0x22, 0x51, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, - 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x53, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x75, 0x73, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x50, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x1b, 0x0a, 0x08, 0x50, 0x61, 0x67, 0x65, - 0x53, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, - 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x4f, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x52, 0x65, 0x63, 0x6f, - 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x28, 0x0a, 0x07, - 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, - 0x47, 0x65, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x07, 0x72, - 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x22, 0xea, 0x01, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x52, 0x65, - 0x63, 0x6f, 0x72, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x1f, 0x0a, 0x0a, 0x51, 0x75, 0x65, 0x73, - 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x51, 0x75, 0x65, - 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, - 0x6c, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, - 0x63, 0x75, 0x6c, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, - 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, - 0x79, 0x12, 0x27, 0x0a, 0x0e, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x73, - 0x77, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x6e, - 0x73, 0x77, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x6e, 0x73, 0x77, - 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, - 0x69, 0x6d, 0x65, 0x32, 0xc7, 0x04, 0x0a, 0x05, 0x51, 0x67, 0x64, 0x7a, 0x73, 0x12, 0x69, 0x0a, - 0x10, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x14, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, 0x28, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x01, 0x2a, 0x22, 0x1d, 0x2f, 0x71, 0x67, 0x64, 0x7a, - 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x5f, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x55, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x51, - 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0f, 0x2e, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, - 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x47, 0x65, 0x74, 0x51, 0x75, - 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x1d, 0x3a, 0x01, 0x2a, 0x22, 0x18, 0x2f, 0x71, 0x67, 0x64, 0x7a, 0x73, 0x2f, 0x6f, 0x70, - 0x65, 0x6e, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x66, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, - 0x66, 0x6f, 0x12, 0x13, 0x2e, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, - 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, - 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x22, 0x28, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x01, 0x2a, 0x22, 0x1d, 0x2f, 0x71, 0x67, 0x64, 0x7a, 0x73, - 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x61, 0x0a, 0x0e, 0x41, 0x6e, 0x73, 0x77, 0x65, - 0x72, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x2e, 0x41, 0x6e, 0x73, 0x77, - 0x65, 0x72, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, - 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, - 0x71, 0x67, 0x64, 0x7a, 0x73, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x2f, 0x61, 0x6e, 0x73, 0x77, 0x65, - 0x72, 0x5f, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x62, 0x0a, 0x0e, 0x47, 0x65, - 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x12, 0x2e, 0x47, - 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, - 0x1a, 0x13, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, - 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x01, 0x2a, - 0x22, 0x1c, 0x2f, 0x71, 0x67, 0x64, 0x7a, 0x73, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x2f, 0x67, 0x65, - 0x74, 0x5f, 0x61, 0x6c, 0x6c, 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x4d, - 0x0a, 0x09, 0x47, 0x65, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x0d, 0x2e, 0x47, 0x65, - 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x47, 0x65, 0x74, - 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x1b, 0x3a, 0x01, 0x2a, 0x22, 0x16, 0x2f, 0x71, 0x67, 0x64, 0x7a, 0x73, 0x2f, 0x61, 0x75, - 0x74, 0x68, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x42, 0x36, 0x5a, - 0x34, 0x67, 0x69, 0x74, 0x2e, 0x68, 0x6c, 0x73, 0x71, 0x2e, 0x61, 0x73, 0x69, 0x61, 0x2f, 0x6d, - 0x6d, 0x6f, 0x72, 0x70, 0x67, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2d, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x73, 0x2f, 0x67, 0x72, - 0x70, 0x63, 0x5f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x65, 0x73, 0x70, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x3a, 0x01, 0x2a, 0x22, + 0x21, 0x2f, 0x71, 0x67, 0x64, 0x7a, 0x73, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x2f, 0x63, 0x61, 0x74, + 0x65, 0x67, 0x6f, 0x72, 0x79, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, + 0x72, 0x79, 0x12, 0x72, 0x0a, 0x13, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x47, 0x65, + 0x74, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x43, 0x61, 0x74, 0x65, + 0x67, 0x6f, 0x72, 0x79, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x47, 0x65, 0x74, + 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, 0x28, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x01, 0x2a, 0x22, 0x1d, 0x2f, 0x71, 0x67, 0x64, 0x7a, 0x73, 0x2f, + 0x6f, 0x70, 0x65, 0x6e, 0x2f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x2f, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x79, 0x0a, 0x16, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, + 0x72, 0x79, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x1a, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x41, 0x6e, 0x73, 0x77, 0x65, + 0x72, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x43, + 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x51, 0x75, 0x65, + 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x71, 0x67, 0x64, 0x7a, 0x73, 0x2f, 0x6f, 0x70, 0x65, + 0x6e, 0x2f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x2f, 0x61, 0x6e, 0x73, 0x77, 0x65, + 0x72, 0x12, 0x6e, 0x0a, 0x12, 0x51, 0x75, 0x69, 0x63, 0x6b, 0x6c, 0x79, 0x47, 0x65, 0x74, 0x51, + 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x2e, 0x51, 0x75, 0x69, 0x63, 0x6b, 0x6c, + 0x79, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, + 0x17, 0x2e, 0x51, 0x75, 0x69, 0x63, 0x6b, 0x6c, 0x79, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, 0x73, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, + 0x3a, 0x01, 0x2a, 0x22, 0x1c, 0x2f, 0x71, 0x67, 0x64, 0x7a, 0x73, 0x2f, 0x6f, 0x70, 0x65, 0x6e, + 0x2f, 0x71, 0x75, 0x69, 0x63, 0x6b, 0x6c, 0x79, 0x2f, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x75, 0x0a, 0x15, 0x51, 0x75, 0x69, 0x63, 0x6b, 0x6c, 0x79, 0x41, 0x6e, 0x73, 0x77, + 0x65, 0x72, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x2e, 0x51, 0x75, 0x69, + 0x63, 0x6b, 0x6c, 0x79, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x51, 0x75, 0x69, 0x63, 0x6b, 0x6c, 0x79, 0x41, + 0x6e, 0x73, 0x77, 0x65, 0x72, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x22, 0x1a, 0x2f, 0x71, + 0x67, 0x64, 0x7a, 0x73, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x2f, 0x71, 0x75, 0x69, 0x63, 0x6b, 0x6c, + 0x79, 0x2f, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x12, 0x4d, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x52, + 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x0d, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, + 0x52, 0x65, 0x73, 0x70, 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x3a, 0x01, 0x2a, 0x22, + 0x16, 0x2f, 0x71, 0x67, 0x64, 0x7a, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x67, 0x65, 0x74, + 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x66, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x51, 0x75, + 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x13, 0x2e, 0x47, 0x65, 0x74, + 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, + 0x14, 0x2e, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x65, 0x73, 0x70, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x01, 0x2a, + 0x22, 0x1d, 0x2f, 0x71, 0x67, 0x64, 0x7a, 0x73, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x2f, 0x67, 0x65, + 0x74, 0x5f, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x42, + 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x2e, 0x68, 0x6c, 0x73, 0x71, 0x2e, 0x61, 0x73, 0x69, 0x61, + 0x2f, 0x6d, 0x6d, 0x6f, 0x72, 0x70, 0x67, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2d, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x73, 0x2f, + 0x67, 0x72, 0x70, 0x63, 0x5f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -974,40 +1526,56 @@ func file_service_qgdzs_proto_rawDescGZIP() []byte { return file_service_qgdzs_proto_rawDescData } -var file_service_qgdzs_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_service_qgdzs_proto_msgTypes = make([]protoimpl.MessageInfo, 22) var file_service_qgdzs_proto_goTypes = []interface{}{ - (*GenerateQuestionReq)(nil), // 0: GenerateQuestionReq - (*GenerateQuestionResp)(nil), // 1: GenerateQuestionResp - (*GetQuestionReq)(nil), // 2: GetQuestionReq - (*GetQuestionResp)(nil), // 3: GetQuestionResp - (*GetQuestionInfoReq)(nil), // 4: GetQuestionInfoReq - (*GetQuestionInfoResp)(nil), // 5: GetQuestionInfoResp - (*AnswerQuestionReq)(nil), // 6: AnswerQuestionReq - (*AnswerQuestionResp)(nil), // 7: AnswerQuestionResp - (*GetAllCategoryReq)(nil), // 8: GetAllCategoryReq - (*GetAllCategoryResp)(nil), // 9: GetAllCategoryResp - (*GetAllCategoryItem)(nil), // 10: GetAllCategoryItem - (*GetRecordReq)(nil), // 11: GetRecordReq - (*GetRecordResp)(nil), // 12: GetRecordResp - (*GetRecordItem)(nil), // 13: GetRecordItem + (*GenerateQuestionReq)(nil), // 0: GenerateQuestionReq + (*GenerateQuestionResp)(nil), // 1: GenerateQuestionResp + (*RandomGetQuestionReq)(nil), // 2: RandomGetQuestionReq + (*RandomGetQuestionResp)(nil), // 3: RandomGetQuestionResp + (*RandomAnswerQuestionReq)(nil), // 4: RandomAnswerQuestionReq + (*RandomAnswerQuestionResp)(nil), // 5: RandomAnswerQuestionResp + (*GetAllCategoryReq)(nil), // 6: GetAllCategoryReq + (*GetAllCategoryResp)(nil), // 7: GetAllCategoryResp + (*GetAllCategoryItem)(nil), // 8: GetAllCategoryItem + (*CategoryGetQuestionReq)(nil), // 9: CategoryGetQuestionReq + (*CategoryGetQuestionResp)(nil), // 10: CategoryGetQuestionResp + (*CategoryAnswerQuestionReq)(nil), // 11: CategoryAnswerQuestionReq + (*CategoryAnswerQuestionResp)(nil), // 12: CategoryAnswerQuestionResp + (*QuicklyGetQuestionReq)(nil), // 13: QuicklyGetQuestionReq + (*QuicklyGetQuestionResp)(nil), // 14: QuicklyGetQuestionResp + (*QuicklyAnswerQuestionReq)(nil), // 15: QuicklyAnswerQuestionReq + (*QuicklyAnswerQuestionResp)(nil), // 16: QuicklyAnswerQuestionResp + (*GetRecordReq)(nil), // 17: GetRecordReq + (*GetRecordResp)(nil), // 18: GetRecordResp + (*GetRecordItem)(nil), // 19: GetRecordItem + (*GetQuestionInfoReq)(nil), // 20: GetQuestionInfoReq + (*GetQuestionInfoResp)(nil), // 21: GetQuestionInfoResp } var file_service_qgdzs_proto_depIdxs = []int32{ - 10, // 0: GetAllCategoryResp.Categories:type_name -> GetAllCategoryItem - 13, // 1: GetRecordResp.Records:type_name -> GetRecordItem + 8, // 0: GetAllCategoryResp.Categories:type_name -> GetAllCategoryItem + 19, // 1: GetRecordResp.Records:type_name -> GetRecordItem 0, // 2: Qgdzs.GenerateQuestion:input_type -> GenerateQuestionReq - 2, // 3: Qgdzs.GetQuestion:input_type -> GetQuestionReq - 4, // 4: Qgdzs.GetQuestionInfo:input_type -> GetQuestionInfoReq - 6, // 5: Qgdzs.AnswerQuestion:input_type -> AnswerQuestionReq - 8, // 6: Qgdzs.GetAllCategory:input_type -> GetAllCategoryReq - 11, // 7: Qgdzs.GetRecord:input_type -> GetRecordReq - 1, // 8: Qgdzs.GenerateQuestion:output_type -> GenerateQuestionResp - 3, // 9: Qgdzs.GetQuestion:output_type -> GetQuestionResp - 5, // 10: Qgdzs.GetQuestionInfo:output_type -> GetQuestionInfoResp - 7, // 11: Qgdzs.AnswerQuestion:output_type -> AnswerQuestionResp - 9, // 12: Qgdzs.GetAllCategory:output_type -> GetAllCategoryResp - 12, // 13: Qgdzs.GetRecord:output_type -> GetRecordResp - 8, // [8:14] is the sub-list for method output_type - 2, // [2:8] is the sub-list for method input_type + 2, // 3: Qgdzs.RandomGetQuestion:input_type -> RandomGetQuestionReq + 4, // 4: Qgdzs.RandomAnswerQuestion:input_type -> RandomAnswerQuestionReq + 6, // 5: Qgdzs.GetAllCategory:input_type -> GetAllCategoryReq + 9, // 6: Qgdzs.CategoryGetQuestion:input_type -> CategoryGetQuestionReq + 11, // 7: Qgdzs.CategoryAnswerQuestion:input_type -> CategoryAnswerQuestionReq + 13, // 8: Qgdzs.QuicklyGetQuestion:input_type -> QuicklyGetQuestionReq + 15, // 9: Qgdzs.QuicklyAnswerQuestion:input_type -> QuicklyAnswerQuestionReq + 17, // 10: Qgdzs.GetRecord:input_type -> GetRecordReq + 20, // 11: Qgdzs.GetQuestionInfo:input_type -> GetQuestionInfoReq + 1, // 12: Qgdzs.GenerateQuestion:output_type -> GenerateQuestionResp + 3, // 13: Qgdzs.RandomGetQuestion:output_type -> RandomGetQuestionResp + 5, // 14: Qgdzs.RandomAnswerQuestion:output_type -> RandomAnswerQuestionResp + 7, // 15: Qgdzs.GetAllCategory:output_type -> GetAllCategoryResp + 10, // 16: Qgdzs.CategoryGetQuestion:output_type -> CategoryGetQuestionResp + 12, // 17: Qgdzs.CategoryAnswerQuestion:output_type -> CategoryAnswerQuestionResp + 14, // 18: Qgdzs.QuicklyGetQuestion:output_type -> QuicklyGetQuestionResp + 16, // 19: Qgdzs.QuicklyAnswerQuestion:output_type -> QuicklyAnswerQuestionResp + 18, // 20: Qgdzs.GetRecord:output_type -> GetRecordResp + 21, // 21: Qgdzs.GetQuestionInfo:output_type -> GetQuestionInfoResp + 12, // [12:22] is the sub-list for method output_type + 2, // [2:12] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name 2, // [2:2] is the sub-list for extension extendee 0, // [0:2] is the sub-list for field type_name @@ -1044,7 +1612,7 @@ func file_service_qgdzs_proto_init() { } } file_service_qgdzs_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetQuestionReq); i { + switch v := v.(*RandomGetQuestionReq); i { case 0: return &v.state case 1: @@ -1056,7 +1624,7 @@ func file_service_qgdzs_proto_init() { } } file_service_qgdzs_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetQuestionResp); i { + switch v := v.(*RandomGetQuestionResp); i { case 0: return &v.state case 1: @@ -1068,7 +1636,7 @@ func file_service_qgdzs_proto_init() { } } file_service_qgdzs_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetQuestionInfoReq); i { + switch v := v.(*RandomAnswerQuestionReq); i { case 0: return &v.state case 1: @@ -1080,7 +1648,7 @@ func file_service_qgdzs_proto_init() { } } file_service_qgdzs_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetQuestionInfoResp); i { + switch v := v.(*RandomAnswerQuestionResp); i { case 0: return &v.state case 1: @@ -1092,30 +1660,6 @@ func file_service_qgdzs_proto_init() { } } file_service_qgdzs_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AnswerQuestionReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_qgdzs_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AnswerQuestionResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_qgdzs_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetAllCategoryReq); i { case 0: return &v.state @@ -1127,7 +1671,7 @@ func file_service_qgdzs_proto_init() { return nil } } - file_service_qgdzs_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_service_qgdzs_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetAllCategoryResp); i { case 0: return &v.state @@ -1139,7 +1683,7 @@ func file_service_qgdzs_proto_init() { return nil } } - file_service_qgdzs_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_service_qgdzs_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetAllCategoryItem); i { case 0: return &v.state @@ -1151,8 +1695,32 @@ func file_service_qgdzs_proto_init() { return nil } } + file_service_qgdzs_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CategoryGetQuestionReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_qgdzs_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CategoryGetQuestionResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } file_service_qgdzs_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRecordReq); i { + switch v := v.(*CategoryAnswerQuestionReq); i { case 0: return &v.state case 1: @@ -1164,7 +1732,7 @@ func file_service_qgdzs_proto_init() { } } file_service_qgdzs_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRecordResp); i { + switch v := v.(*CategoryAnswerQuestionResp); i { case 0: return &v.state case 1: @@ -1176,6 +1744,78 @@ func file_service_qgdzs_proto_init() { } } file_service_qgdzs_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QuicklyGetQuestionReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_qgdzs_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QuicklyGetQuestionResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_qgdzs_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QuicklyAnswerQuestionReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_qgdzs_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QuicklyAnswerQuestionResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_qgdzs_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRecordReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_qgdzs_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRecordResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_qgdzs_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetRecordItem); i { case 0: return &v.state @@ -1187,6 +1827,30 @@ func file_service_qgdzs_proto_init() { return nil } } + file_service_qgdzs_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetQuestionInfoReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_qgdzs_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetQuestionInfoResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -1194,7 +1858,7 @@ func file_service_qgdzs_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_service_qgdzs_proto_rawDesc, NumEnums: 0, - NumMessages: 14, + NumMessages: 22, NumExtensions: 0, NumServices: 1, }, diff --git a/Proto/RpcServer/gen/git.hlsq.asia/mmorpg/service-common/proto/rs/grpc_pb/service_qgdzs.pb.gw.go b/Proto/RpcServer/gen/git.hlsq.asia/mmorpg/service-common/proto/rs/grpc_pb/service_qgdzs.pb.gw.go index 870d313..184dfa9 100644 --- a/Proto/RpcServer/gen/git.hlsq.asia/mmorpg/service-common/proto/rs/grpc_pb/service_qgdzs.pb.gw.go +++ b/Proto/RpcServer/gen/git.hlsq.asia/mmorpg/service-common/proto/rs/grpc_pb/service_qgdzs.pb.gw.go @@ -59,75 +59,51 @@ func local_request_Qgdzs_GenerateQuestion_0(ctx context.Context, marshaler runti return msg, metadata, err } -func request_Qgdzs_GetQuestion_0(ctx context.Context, marshaler runtime.Marshaler, client QgdzsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { +func request_Qgdzs_RandomGetQuestion_0(ctx context.Context, marshaler runtime.Marshaler, client QgdzsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var ( - protoReq GetQuestionReq + protoReq RandomGetQuestionReq metadata runtime.ServerMetadata ) if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.GetQuestion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.RandomGetQuestion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Qgdzs_GetQuestion_0(ctx context.Context, marshaler runtime.Marshaler, server QgdzsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { +func local_request_Qgdzs_RandomGetQuestion_0(ctx context.Context, marshaler runtime.Marshaler, server QgdzsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var ( - protoReq GetQuestionReq + protoReq RandomGetQuestionReq metadata runtime.ServerMetadata ) if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.GetQuestion(ctx, &protoReq) + msg, err := server.RandomGetQuestion(ctx, &protoReq) return msg, metadata, err } -func request_Qgdzs_GetQuestionInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QgdzsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { +func request_Qgdzs_RandomAnswerQuestion_0(ctx context.Context, marshaler runtime.Marshaler, client QgdzsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var ( - protoReq GetQuestionInfoReq + protoReq RandomAnswerQuestionReq metadata runtime.ServerMetadata ) if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.GetQuestionInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.RandomAnswerQuestion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Qgdzs_GetQuestionInfo_0(ctx context.Context, marshaler runtime.Marshaler, server QgdzsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { +func local_request_Qgdzs_RandomAnswerQuestion_0(ctx context.Context, marshaler runtime.Marshaler, server QgdzsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var ( - protoReq GetQuestionInfoReq + protoReq RandomAnswerQuestionReq metadata runtime.ServerMetadata ) if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.GetQuestionInfo(ctx, &protoReq) - return msg, metadata, err -} - -func request_Qgdzs_AnswerQuestion_0(ctx context.Context, marshaler runtime.Marshaler, client QgdzsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq AnswerQuestionReq - metadata runtime.ServerMetadata - ) - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := client.AnswerQuestion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_Qgdzs_AnswerQuestion_0(ctx context.Context, marshaler runtime.Marshaler, server QgdzsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var ( - protoReq AnswerQuestionReq - metadata runtime.ServerMetadata - ) - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := server.AnswerQuestion(ctx, &protoReq) + msg, err := server.RandomAnswerQuestion(ctx, &protoReq) return msg, metadata, err } @@ -155,6 +131,102 @@ func local_request_Qgdzs_GetAllCategory_0(ctx context.Context, marshaler runtime return msg, metadata, err } +func request_Qgdzs_CategoryGetQuestion_0(ctx context.Context, marshaler runtime.Marshaler, client QgdzsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq CategoryGetQuestionReq + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := client.CategoryGetQuestion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_Qgdzs_CategoryGetQuestion_0(ctx context.Context, marshaler runtime.Marshaler, server QgdzsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq CategoryGetQuestionReq + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := server.CategoryGetQuestion(ctx, &protoReq) + return msg, metadata, err +} + +func request_Qgdzs_CategoryAnswerQuestion_0(ctx context.Context, marshaler runtime.Marshaler, client QgdzsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq CategoryAnswerQuestionReq + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := client.CategoryAnswerQuestion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_Qgdzs_CategoryAnswerQuestion_0(ctx context.Context, marshaler runtime.Marshaler, server QgdzsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq CategoryAnswerQuestionReq + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := server.CategoryAnswerQuestion(ctx, &protoReq) + return msg, metadata, err +} + +func request_Qgdzs_QuicklyGetQuestion_0(ctx context.Context, marshaler runtime.Marshaler, client QgdzsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq QuicklyGetQuestionReq + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := client.QuicklyGetQuestion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_Qgdzs_QuicklyGetQuestion_0(ctx context.Context, marshaler runtime.Marshaler, server QgdzsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq QuicklyGetQuestionReq + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := server.QuicklyGetQuestion(ctx, &protoReq) + return msg, metadata, err +} + +func request_Qgdzs_QuicklyAnswerQuestion_0(ctx context.Context, marshaler runtime.Marshaler, client QgdzsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq QuicklyAnswerQuestionReq + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := client.QuicklyAnswerQuestion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_Qgdzs_QuicklyAnswerQuestion_0(ctx context.Context, marshaler runtime.Marshaler, server QgdzsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq QuicklyAnswerQuestionReq + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := server.QuicklyAnswerQuestion(ctx, &protoReq) + return msg, metadata, err +} + func request_Qgdzs_GetRecord_0(ctx context.Context, marshaler runtime.Marshaler, client QgdzsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var ( protoReq GetRecordReq @@ -179,6 +251,30 @@ func local_request_Qgdzs_GetRecord_0(ctx context.Context, marshaler runtime.Mars return msg, metadata, err } +func request_Qgdzs_GetQuestionInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QgdzsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq GetQuestionInfoReq + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := client.GetQuestionInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_Qgdzs_GetQuestionInfo_0(ctx context.Context, marshaler runtime.Marshaler, server QgdzsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq GetQuestionInfoReq + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := server.GetQuestionInfo(ctx, &protoReq) + return msg, metadata, err +} + // RegisterQgdzsHandlerServer registers the http handlers for service Qgdzs to "mux". // UnaryRPC :call QgdzsServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -205,65 +301,45 @@ func RegisterQgdzsHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv } forward_Qgdzs_GenerateQuestion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle(http.MethodPost, pattern_Qgdzs_GetQuestion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Qgdzs_RandomGetQuestion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/.Qgdzs/GetQuestion", runtime.WithHTTPPathPattern("/qgdzs/open/get_question")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/.Qgdzs/RandomGetQuestion", runtime.WithHTTPPathPattern("/qgdzs/open/random/question")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Qgdzs_GetQuestion_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Qgdzs_RandomGetQuestion_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Qgdzs_GetQuestion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Qgdzs_RandomGetQuestion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle(http.MethodPost, pattern_Qgdzs_GetQuestionInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Qgdzs_RandomAnswerQuestion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/.Qgdzs/GetQuestionInfo", runtime.WithHTTPPathPattern("/qgdzs/open/get_question_info")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/.Qgdzs/RandomAnswerQuestion", runtime.WithHTTPPathPattern("/qgdzs/open/random/answer")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Qgdzs_GetQuestionInfo_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Qgdzs_RandomAnswerQuestion_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Qgdzs_GetQuestionInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_Qgdzs_AnswerQuestion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/.Qgdzs/AnswerQuestion", runtime.WithHTTPPathPattern("/qgdzs/open/answer_question")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Qgdzs_AnswerQuestion_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_Qgdzs_AnswerQuestion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Qgdzs_RandomAnswerQuestion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) mux.Handle(http.MethodPost, pattern_Qgdzs_GetAllCategory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) @@ -271,7 +347,7 @@ func RegisterQgdzsHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/.Qgdzs/GetAllCategory", runtime.WithHTTPPathPattern("/qgdzs/open/get_all_category")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/.Qgdzs/GetAllCategory", runtime.WithHTTPPathPattern("/qgdzs/open/category/get_category")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -285,6 +361,86 @@ func RegisterQgdzsHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv } forward_Qgdzs_GetAllCategory_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) + mux.Handle(http.MethodPost, pattern_Qgdzs_CategoryGetQuestion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/.Qgdzs/CategoryGetQuestion", runtime.WithHTTPPathPattern("/qgdzs/open/category/question")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Qgdzs_CategoryGetQuestion_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_Qgdzs_CategoryGetQuestion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_Qgdzs_CategoryAnswerQuestion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/.Qgdzs/CategoryAnswerQuestion", runtime.WithHTTPPathPattern("/qgdzs/open/category/answer")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Qgdzs_CategoryAnswerQuestion_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_Qgdzs_CategoryAnswerQuestion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_Qgdzs_QuicklyGetQuestion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/.Qgdzs/QuicklyGetQuestion", runtime.WithHTTPPathPattern("/qgdzs/open/quickly/question")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Qgdzs_QuicklyGetQuestion_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_Qgdzs_QuicklyGetQuestion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_Qgdzs_QuicklyAnswerQuestion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/.Qgdzs/QuicklyAnswerQuestion", runtime.WithHTTPPathPattern("/qgdzs/open/quickly/answer")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Qgdzs_QuicklyAnswerQuestion_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_Qgdzs_QuicklyAnswerQuestion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) mux.Handle(http.MethodPost, pattern_Qgdzs_GetRecord_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -305,6 +461,26 @@ func RegisterQgdzsHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv } forward_Qgdzs_GetRecord_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) + mux.Handle(http.MethodPost, pattern_Qgdzs_GetQuestionInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/.Qgdzs/GetQuestionInfo", runtime.WithHTTPPathPattern("/qgdzs/open/get_question_info")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Qgdzs_GetQuestionInfo_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_Qgdzs_GetQuestionInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) return nil } @@ -362,62 +538,45 @@ func RegisterQgdzsHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } forward_Qgdzs_GenerateQuestion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle(http.MethodPost, pattern_Qgdzs_GetQuestion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Qgdzs_RandomGetQuestion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/.Qgdzs/GetQuestion", runtime.WithHTTPPathPattern("/qgdzs/open/get_question")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/.Qgdzs/RandomGetQuestion", runtime.WithHTTPPathPattern("/qgdzs/open/random/question")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Qgdzs_GetQuestion_0(annotatedContext, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Qgdzs_RandomGetQuestion_0(annotatedContext, inboundMarshaler, client, req, pathParams) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Qgdzs_GetQuestion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Qgdzs_RandomGetQuestion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle(http.MethodPost, pattern_Qgdzs_GetQuestionInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Qgdzs_RandomAnswerQuestion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/.Qgdzs/GetQuestionInfo", runtime.WithHTTPPathPattern("/qgdzs/open/get_question_info")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/.Qgdzs/RandomAnswerQuestion", runtime.WithHTTPPathPattern("/qgdzs/open/random/answer")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Qgdzs_GetQuestionInfo_0(annotatedContext, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Qgdzs_RandomAnswerQuestion_0(annotatedContext, inboundMarshaler, client, req, pathParams) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Qgdzs_GetQuestionInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle(http.MethodPost, pattern_Qgdzs_AnswerQuestion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/.Qgdzs/AnswerQuestion", runtime.WithHTTPPathPattern("/qgdzs/open/answer_question")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Qgdzs_AnswerQuestion_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - forward_Qgdzs_AnswerQuestion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Qgdzs_RandomAnswerQuestion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) mux.Handle(http.MethodPost, pattern_Qgdzs_GetAllCategory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/.Qgdzs/GetAllCategory", runtime.WithHTTPPathPattern("/qgdzs/open/get_all_category")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/.Qgdzs/GetAllCategory", runtime.WithHTTPPathPattern("/qgdzs/open/category/get_category")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -430,6 +589,74 @@ func RegisterQgdzsHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } forward_Qgdzs_GetAllCategory_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) + mux.Handle(http.MethodPost, pattern_Qgdzs_CategoryGetQuestion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/.Qgdzs/CategoryGetQuestion", runtime.WithHTTPPathPattern("/qgdzs/open/category/question")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Qgdzs_CategoryGetQuestion_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_Qgdzs_CategoryGetQuestion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_Qgdzs_CategoryAnswerQuestion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/.Qgdzs/CategoryAnswerQuestion", runtime.WithHTTPPathPattern("/qgdzs/open/category/answer")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Qgdzs_CategoryAnswerQuestion_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_Qgdzs_CategoryAnswerQuestion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_Qgdzs_QuicklyGetQuestion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/.Qgdzs/QuicklyGetQuestion", runtime.WithHTTPPathPattern("/qgdzs/open/quickly/question")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Qgdzs_QuicklyGetQuestion_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_Qgdzs_QuicklyGetQuestion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_Qgdzs_QuicklyAnswerQuestion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/.Qgdzs/QuicklyAnswerQuestion", runtime.WithHTTPPathPattern("/qgdzs/open/quickly/answer")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Qgdzs_QuicklyAnswerQuestion_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_Qgdzs_QuicklyAnswerQuestion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) mux.Handle(http.MethodPost, pattern_Qgdzs_GetRecord_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -447,23 +674,48 @@ func RegisterQgdzsHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } forward_Qgdzs_GetRecord_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) + mux.Handle(http.MethodPost, pattern_Qgdzs_GetQuestionInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/.Qgdzs/GetQuestionInfo", runtime.WithHTTPPathPattern("/qgdzs/open/get_question_info")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Qgdzs_GetQuestionInfo_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_Qgdzs_GetQuestionInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) return nil } var ( - pattern_Qgdzs_GenerateQuestion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"qgdzs", "auth", "generate_question"}, "")) - pattern_Qgdzs_GetQuestion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"qgdzs", "open", "get_question"}, "")) - pattern_Qgdzs_GetQuestionInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"qgdzs", "open", "get_question_info"}, "")) - pattern_Qgdzs_AnswerQuestion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"qgdzs", "open", "answer_question"}, "")) - pattern_Qgdzs_GetAllCategory_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"qgdzs", "open", "get_all_category"}, "")) - pattern_Qgdzs_GetRecord_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"qgdzs", "auth", "get_record"}, "")) + pattern_Qgdzs_GenerateQuestion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"qgdzs", "auth", "generate_question"}, "")) + pattern_Qgdzs_RandomGetQuestion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"qgdzs", "open", "random", "question"}, "")) + pattern_Qgdzs_RandomAnswerQuestion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"qgdzs", "open", "random", "answer"}, "")) + pattern_Qgdzs_GetAllCategory_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"qgdzs", "open", "category", "get_category"}, "")) + pattern_Qgdzs_CategoryGetQuestion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"qgdzs", "open", "category", "question"}, "")) + pattern_Qgdzs_CategoryAnswerQuestion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"qgdzs", "open", "category", "answer"}, "")) + pattern_Qgdzs_QuicklyGetQuestion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"qgdzs", "open", "quickly", "question"}, "")) + pattern_Qgdzs_QuicklyAnswerQuestion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"qgdzs", "open", "quickly", "answer"}, "")) + pattern_Qgdzs_GetRecord_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"qgdzs", "auth", "get_record"}, "")) + pattern_Qgdzs_GetQuestionInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"qgdzs", "open", "get_question_info"}, "")) ) var ( - forward_Qgdzs_GenerateQuestion_0 = runtime.ForwardResponseMessage - forward_Qgdzs_GetQuestion_0 = runtime.ForwardResponseMessage - forward_Qgdzs_GetQuestionInfo_0 = runtime.ForwardResponseMessage - forward_Qgdzs_AnswerQuestion_0 = runtime.ForwardResponseMessage - forward_Qgdzs_GetAllCategory_0 = runtime.ForwardResponseMessage - forward_Qgdzs_GetRecord_0 = runtime.ForwardResponseMessage + forward_Qgdzs_GenerateQuestion_0 = runtime.ForwardResponseMessage + forward_Qgdzs_RandomGetQuestion_0 = runtime.ForwardResponseMessage + forward_Qgdzs_RandomAnswerQuestion_0 = runtime.ForwardResponseMessage + forward_Qgdzs_GetAllCategory_0 = runtime.ForwardResponseMessage + forward_Qgdzs_CategoryGetQuestion_0 = runtime.ForwardResponseMessage + forward_Qgdzs_CategoryAnswerQuestion_0 = runtime.ForwardResponseMessage + forward_Qgdzs_QuicklyGetQuestion_0 = runtime.ForwardResponseMessage + forward_Qgdzs_QuicklyAnswerQuestion_0 = runtime.ForwardResponseMessage + forward_Qgdzs_GetRecord_0 = runtime.ForwardResponseMessage + forward_Qgdzs_GetQuestionInfo_0 = runtime.ForwardResponseMessage ) diff --git a/Proto/RpcServer/gen/git.hlsq.asia/mmorpg/service-common/proto/rs/grpc_pb/service_qgdzs_grpc.pb.go b/Proto/RpcServer/gen/git.hlsq.asia/mmorpg/service-common/proto/rs/grpc_pb/service_qgdzs_grpc.pb.go index 9f8d386..e548fcc 100644 --- a/Proto/RpcServer/gen/git.hlsq.asia/mmorpg/service-common/proto/rs/grpc_pb/service_qgdzs_grpc.pb.go +++ b/Proto/RpcServer/gen/git.hlsq.asia/mmorpg/service-common/proto/rs/grpc_pb/service_qgdzs_grpc.pb.go @@ -24,16 +24,28 @@ const _ = grpc.SupportPackageIsVersion7 type QgdzsClient interface { // 生成题目 GenerateQuestion(ctx context.Context, in *GenerateQuestionReq, opts ...grpc.CallOption) (*GenerateQuestionResp, error) + // ---------- 随机答题 ---------- // 获取题目 - GetQuestion(ctx context.Context, in *GetQuestionReq, opts ...grpc.CallOption) (*GetQuestionResp, error) - // 获取具体的题目 - GetQuestionInfo(ctx context.Context, in *GetQuestionInfoReq, opts ...grpc.CallOption) (*GetQuestionInfoResp, error) + RandomGetQuestion(ctx context.Context, in *RandomGetQuestionReq, opts ...grpc.CallOption) (*RandomGetQuestionResp, error) // 回答题目 - AnswerQuestion(ctx context.Context, in *AnswerQuestionReq, opts ...grpc.CallOption) (*AnswerQuestionResp, error) + RandomAnswerQuestion(ctx context.Context, in *RandomAnswerQuestionReq, opts ...grpc.CallOption) (*RandomAnswerQuestionResp, error) + // ---------- 类目答题 ---------- // 获取所有类目 GetAllCategory(ctx context.Context, in *GetAllCategoryReq, opts ...grpc.CallOption) (*GetAllCategoryResp, error) + // 获取题目 + CategoryGetQuestion(ctx context.Context, in *CategoryGetQuestionReq, opts ...grpc.CallOption) (*CategoryGetQuestionResp, error) + // 回答题目 + CategoryAnswerQuestion(ctx context.Context, in *CategoryAnswerQuestionReq, opts ...grpc.CallOption) (*CategoryAnswerQuestionResp, error) + // ---------- 快速答题 ---------- + // 获取题目 + QuicklyGetQuestion(ctx context.Context, in *QuicklyGetQuestionReq, opts ...grpc.CallOption) (*QuicklyGetQuestionResp, error) + // 回答题目 + QuicklyAnswerQuestion(ctx context.Context, in *QuicklyAnswerQuestionReq, opts ...grpc.CallOption) (*QuicklyAnswerQuestionResp, error) + // ---------- 答题记录 ---------- // 获取答题记录 GetRecord(ctx context.Context, in *GetRecordReq, opts ...grpc.CallOption) (*GetRecordResp, error) + // 获取具体的题目 + GetQuestionInfo(ctx context.Context, in *GetQuestionInfoReq, opts ...grpc.CallOption) (*GetQuestionInfoResp, error) } type qgdzsClient struct { @@ -53,27 +65,18 @@ func (c *qgdzsClient) GenerateQuestion(ctx context.Context, in *GenerateQuestion return out, nil } -func (c *qgdzsClient) GetQuestion(ctx context.Context, in *GetQuestionReq, opts ...grpc.CallOption) (*GetQuestionResp, error) { - out := new(GetQuestionResp) - err := c.cc.Invoke(ctx, "/Qgdzs/GetQuestion", in, out, opts...) +func (c *qgdzsClient) RandomGetQuestion(ctx context.Context, in *RandomGetQuestionReq, opts ...grpc.CallOption) (*RandomGetQuestionResp, error) { + out := new(RandomGetQuestionResp) + err := c.cc.Invoke(ctx, "/Qgdzs/RandomGetQuestion", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *qgdzsClient) GetQuestionInfo(ctx context.Context, in *GetQuestionInfoReq, opts ...grpc.CallOption) (*GetQuestionInfoResp, error) { - out := new(GetQuestionInfoResp) - err := c.cc.Invoke(ctx, "/Qgdzs/GetQuestionInfo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *qgdzsClient) AnswerQuestion(ctx context.Context, in *AnswerQuestionReq, opts ...grpc.CallOption) (*AnswerQuestionResp, error) { - out := new(AnswerQuestionResp) - err := c.cc.Invoke(ctx, "/Qgdzs/AnswerQuestion", in, out, opts...) +func (c *qgdzsClient) RandomAnswerQuestion(ctx context.Context, in *RandomAnswerQuestionReq, opts ...grpc.CallOption) (*RandomAnswerQuestionResp, error) { + out := new(RandomAnswerQuestionResp) + err := c.cc.Invoke(ctx, "/Qgdzs/RandomAnswerQuestion", in, out, opts...) if err != nil { return nil, err } @@ -89,6 +92,42 @@ func (c *qgdzsClient) GetAllCategory(ctx context.Context, in *GetAllCategoryReq, return out, nil } +func (c *qgdzsClient) CategoryGetQuestion(ctx context.Context, in *CategoryGetQuestionReq, opts ...grpc.CallOption) (*CategoryGetQuestionResp, error) { + out := new(CategoryGetQuestionResp) + err := c.cc.Invoke(ctx, "/Qgdzs/CategoryGetQuestion", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *qgdzsClient) CategoryAnswerQuestion(ctx context.Context, in *CategoryAnswerQuestionReq, opts ...grpc.CallOption) (*CategoryAnswerQuestionResp, error) { + out := new(CategoryAnswerQuestionResp) + err := c.cc.Invoke(ctx, "/Qgdzs/CategoryAnswerQuestion", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *qgdzsClient) QuicklyGetQuestion(ctx context.Context, in *QuicklyGetQuestionReq, opts ...grpc.CallOption) (*QuicklyGetQuestionResp, error) { + out := new(QuicklyGetQuestionResp) + err := c.cc.Invoke(ctx, "/Qgdzs/QuicklyGetQuestion", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *qgdzsClient) QuicklyAnswerQuestion(ctx context.Context, in *QuicklyAnswerQuestionReq, opts ...grpc.CallOption) (*QuicklyAnswerQuestionResp, error) { + out := new(QuicklyAnswerQuestionResp) + err := c.cc.Invoke(ctx, "/Qgdzs/QuicklyAnswerQuestion", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *qgdzsClient) GetRecord(ctx context.Context, in *GetRecordReq, opts ...grpc.CallOption) (*GetRecordResp, error) { out := new(GetRecordResp) err := c.cc.Invoke(ctx, "/Qgdzs/GetRecord", in, out, opts...) @@ -98,22 +137,43 @@ func (c *qgdzsClient) GetRecord(ctx context.Context, in *GetRecordReq, opts ...g return out, nil } +func (c *qgdzsClient) GetQuestionInfo(ctx context.Context, in *GetQuestionInfoReq, opts ...grpc.CallOption) (*GetQuestionInfoResp, error) { + out := new(GetQuestionInfoResp) + err := c.cc.Invoke(ctx, "/Qgdzs/GetQuestionInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QgdzsServer is the server API for Qgdzs service. // All implementations must embed UnimplementedQgdzsServer // for forward compatibility type QgdzsServer interface { // 生成题目 GenerateQuestion(context.Context, *GenerateQuestionReq) (*GenerateQuestionResp, error) + // ---------- 随机答题 ---------- // 获取题目 - GetQuestion(context.Context, *GetQuestionReq) (*GetQuestionResp, error) - // 获取具体的题目 - GetQuestionInfo(context.Context, *GetQuestionInfoReq) (*GetQuestionInfoResp, error) + RandomGetQuestion(context.Context, *RandomGetQuestionReq) (*RandomGetQuestionResp, error) // 回答题目 - AnswerQuestion(context.Context, *AnswerQuestionReq) (*AnswerQuestionResp, error) + RandomAnswerQuestion(context.Context, *RandomAnswerQuestionReq) (*RandomAnswerQuestionResp, error) + // ---------- 类目答题 ---------- // 获取所有类目 GetAllCategory(context.Context, *GetAllCategoryReq) (*GetAllCategoryResp, error) + // 获取题目 + CategoryGetQuestion(context.Context, *CategoryGetQuestionReq) (*CategoryGetQuestionResp, error) + // 回答题目 + CategoryAnswerQuestion(context.Context, *CategoryAnswerQuestionReq) (*CategoryAnswerQuestionResp, error) + // ---------- 快速答题 ---------- + // 获取题目 + QuicklyGetQuestion(context.Context, *QuicklyGetQuestionReq) (*QuicklyGetQuestionResp, error) + // 回答题目 + QuicklyAnswerQuestion(context.Context, *QuicklyAnswerQuestionReq) (*QuicklyAnswerQuestionResp, error) + // ---------- 答题记录 ---------- // 获取答题记录 GetRecord(context.Context, *GetRecordReq) (*GetRecordResp, error) + // 获取具体的题目 + GetQuestionInfo(context.Context, *GetQuestionInfoReq) (*GetQuestionInfoResp, error) mustEmbedUnimplementedQgdzsServer() } @@ -124,21 +184,33 @@ type UnimplementedQgdzsServer struct { func (UnimplementedQgdzsServer) GenerateQuestion(context.Context, *GenerateQuestionReq) (*GenerateQuestionResp, error) { return nil, status.Errorf(codes.Unimplemented, "method GenerateQuestion not implemented") } -func (UnimplementedQgdzsServer) GetQuestion(context.Context, *GetQuestionReq) (*GetQuestionResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetQuestion not implemented") +func (UnimplementedQgdzsServer) RandomGetQuestion(context.Context, *RandomGetQuestionReq) (*RandomGetQuestionResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method RandomGetQuestion not implemented") } -func (UnimplementedQgdzsServer) GetQuestionInfo(context.Context, *GetQuestionInfoReq) (*GetQuestionInfoResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetQuestionInfo not implemented") -} -func (UnimplementedQgdzsServer) AnswerQuestion(context.Context, *AnswerQuestionReq) (*AnswerQuestionResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method AnswerQuestion not implemented") +func (UnimplementedQgdzsServer) RandomAnswerQuestion(context.Context, *RandomAnswerQuestionReq) (*RandomAnswerQuestionResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method RandomAnswerQuestion not implemented") } func (UnimplementedQgdzsServer) GetAllCategory(context.Context, *GetAllCategoryReq) (*GetAllCategoryResp, error) { return nil, status.Errorf(codes.Unimplemented, "method GetAllCategory not implemented") } +func (UnimplementedQgdzsServer) CategoryGetQuestion(context.Context, *CategoryGetQuestionReq) (*CategoryGetQuestionResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method CategoryGetQuestion not implemented") +} +func (UnimplementedQgdzsServer) CategoryAnswerQuestion(context.Context, *CategoryAnswerQuestionReq) (*CategoryAnswerQuestionResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method CategoryAnswerQuestion not implemented") +} +func (UnimplementedQgdzsServer) QuicklyGetQuestion(context.Context, *QuicklyGetQuestionReq) (*QuicklyGetQuestionResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method QuicklyGetQuestion not implemented") +} +func (UnimplementedQgdzsServer) QuicklyAnswerQuestion(context.Context, *QuicklyAnswerQuestionReq) (*QuicklyAnswerQuestionResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method QuicklyAnswerQuestion not implemented") +} func (UnimplementedQgdzsServer) GetRecord(context.Context, *GetRecordReq) (*GetRecordResp, error) { return nil, status.Errorf(codes.Unimplemented, "method GetRecord not implemented") } +func (UnimplementedQgdzsServer) GetQuestionInfo(context.Context, *GetQuestionInfoReq) (*GetQuestionInfoResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetQuestionInfo not implemented") +} func (UnimplementedQgdzsServer) mustEmbedUnimplementedQgdzsServer() {} // UnsafeQgdzsServer may be embedded to opt out of forward compatibility for this service. @@ -170,56 +242,38 @@ func _Qgdzs_GenerateQuestion_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } -func _Qgdzs_GetQuestion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetQuestionReq) +func _Qgdzs_RandomGetQuestion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RandomGetQuestionReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QgdzsServer).GetQuestion(ctx, in) + return srv.(QgdzsServer).RandomGetQuestion(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Qgdzs/GetQuestion", + FullMethod: "/Qgdzs/RandomGetQuestion", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QgdzsServer).GetQuestion(ctx, req.(*GetQuestionReq)) + return srv.(QgdzsServer).RandomGetQuestion(ctx, req.(*RandomGetQuestionReq)) } return interceptor(ctx, in, info, handler) } -func _Qgdzs_GetQuestionInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetQuestionInfoReq) +func _Qgdzs_RandomAnswerQuestion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RandomAnswerQuestionReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QgdzsServer).GetQuestionInfo(ctx, in) + return srv.(QgdzsServer).RandomAnswerQuestion(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Qgdzs/GetQuestionInfo", + FullMethod: "/Qgdzs/RandomAnswerQuestion", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QgdzsServer).GetQuestionInfo(ctx, req.(*GetQuestionInfoReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Qgdzs_AnswerQuestion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AnswerQuestionReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QgdzsServer).AnswerQuestion(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/Qgdzs/AnswerQuestion", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QgdzsServer).AnswerQuestion(ctx, req.(*AnswerQuestionReq)) + return srv.(QgdzsServer).RandomAnswerQuestion(ctx, req.(*RandomAnswerQuestionReq)) } return interceptor(ctx, in, info, handler) } @@ -242,6 +296,78 @@ func _Qgdzs_GetAllCategory_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } +func _Qgdzs_CategoryGetQuestion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CategoryGetQuestionReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QgdzsServer).CategoryGetQuestion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/Qgdzs/CategoryGetQuestion", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QgdzsServer).CategoryGetQuestion(ctx, req.(*CategoryGetQuestionReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Qgdzs_CategoryAnswerQuestion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CategoryAnswerQuestionReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QgdzsServer).CategoryAnswerQuestion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/Qgdzs/CategoryAnswerQuestion", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QgdzsServer).CategoryAnswerQuestion(ctx, req.(*CategoryAnswerQuestionReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Qgdzs_QuicklyGetQuestion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuicklyGetQuestionReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QgdzsServer).QuicklyGetQuestion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/Qgdzs/QuicklyGetQuestion", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QgdzsServer).QuicklyGetQuestion(ctx, req.(*QuicklyGetQuestionReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Qgdzs_QuicklyAnswerQuestion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuicklyAnswerQuestionReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QgdzsServer).QuicklyAnswerQuestion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/Qgdzs/QuicklyAnswerQuestion", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QgdzsServer).QuicklyAnswerQuestion(ctx, req.(*QuicklyAnswerQuestionReq)) + } + return interceptor(ctx, in, info, handler) +} + func _Qgdzs_GetRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetRecordReq) if err := dec(in); err != nil { @@ -260,6 +386,24 @@ func _Qgdzs_GetRecord_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } +func _Qgdzs_GetQuestionInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetQuestionInfoReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QgdzsServer).GetQuestionInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/Qgdzs/GetQuestionInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QgdzsServer).GetQuestionInfo(ctx, req.(*GetQuestionInfoReq)) + } + return interceptor(ctx, in, info, handler) +} + // Qgdzs_ServiceDesc is the grpc.ServiceDesc for Qgdzs service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -272,25 +416,41 @@ var Qgdzs_ServiceDesc = grpc.ServiceDesc{ Handler: _Qgdzs_GenerateQuestion_Handler, }, { - MethodName: "GetQuestion", - Handler: _Qgdzs_GetQuestion_Handler, + MethodName: "RandomGetQuestion", + Handler: _Qgdzs_RandomGetQuestion_Handler, }, { - MethodName: "GetQuestionInfo", - Handler: _Qgdzs_GetQuestionInfo_Handler, - }, - { - MethodName: "AnswerQuestion", - Handler: _Qgdzs_AnswerQuestion_Handler, + MethodName: "RandomAnswerQuestion", + Handler: _Qgdzs_RandomAnswerQuestion_Handler, }, { MethodName: "GetAllCategory", Handler: _Qgdzs_GetAllCategory_Handler, }, + { + MethodName: "CategoryGetQuestion", + Handler: _Qgdzs_CategoryGetQuestion_Handler, + }, + { + MethodName: "CategoryAnswerQuestion", + Handler: _Qgdzs_CategoryAnswerQuestion_Handler, + }, + { + MethodName: "QuicklyGetQuestion", + Handler: _Qgdzs_QuicklyGetQuestion_Handler, + }, + { + MethodName: "QuicklyAnswerQuestion", + Handler: _Qgdzs_QuicklyAnswerQuestion_Handler, + }, { MethodName: "GetRecord", Handler: _Qgdzs_GetRecord_Handler, }, + { + MethodName: "GetQuestionInfo", + Handler: _Qgdzs_GetQuestionInfo_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "service_qgdzs.proto", diff --git a/Proto/RpcServer/gen/git.hlsq.asia/mmorpg/service-common/proto/rs/grpc_pb/service_scene.pb.go b/Proto/RpcServer/gen/git.hlsq.asia/mmorpg/service-common/proto/rs/grpc_pb/service_scene.pb.go index e6c9c0f..cfdc7cf 100644 --- a/Proto/RpcServer/gen/git.hlsq.asia/mmorpg/service-common/proto/rs/grpc_pb/service_scene.pb.go +++ b/Proto/RpcServer/gen/git.hlsq.asia/mmorpg/service-common/proto/rs/grpc_pb/service_scene.pb.go @@ -26,9 +26,9 @@ type EnterReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - USN string `protobuf:"bytes,1,opt,name=USN,proto3" json:"USN,omitempty"` // 用户ID - GatewaySID string `protobuf:"bytes,2,opt,name=GatewaySID,proto3" json:"GatewaySID,omitempty"` // 网关服务ID - InstanceID int32 `protobuf:"varint,3,opt,name=InstanceID,proto3" json:"InstanceID,omitempty"` // 副本ID + USN int64 `protobuf:"varint,1,opt,name=USN,proto3" json:"USN,omitempty"` // 用户ID + GatewaySID int64 `protobuf:"varint,2,opt,name=GatewaySID,proto3" json:"GatewaySID,omitempty"` // 网关服务ID + InstanceID int32 `protobuf:"varint,3,opt,name=InstanceID,proto3" json:"InstanceID,omitempty"` // 副本ID } func (x *EnterReq) Reset() { @@ -63,18 +63,18 @@ func (*EnterReq) Descriptor() ([]byte, []int) { return file_service_scene_proto_rawDescGZIP(), []int{0} } -func (x *EnterReq) GetUSN() string { +func (x *EnterReq) GetUSN() int64 { if x != nil { return x.USN } - return "" + return 0 } -func (x *EnterReq) GetGatewaySID() string { +func (x *EnterReq) GetGatewaySID() int64 { if x != nil { return x.GatewaySID } - return "" + return 0 } func (x *EnterReq) GetInstanceID() int32 { @@ -89,8 +89,8 @@ type EnterResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - SceneSID string `protobuf:"bytes,1,opt,name=SceneSID,proto3" json:"SceneSID,omitempty"` // 场景服务ID - UniqueNo string `protobuf:"bytes,2,opt,name=UniqueNo,proto3" json:"UniqueNo,omitempty"` // 副本唯一编号 + SceneSID int64 `protobuf:"varint,1,opt,name=SceneSID,proto3" json:"SceneSID,omitempty"` // 场景服务ID + UniqueNo int64 `protobuf:"varint,2,opt,name=UniqueNo,proto3" json:"UniqueNo,omitempty"` // 副本唯一编号 MessageID int32 `protobuf:"varint,3,opt,name=MessageID,proto3" json:"MessageID,omitempty"` // 发送给客户端的消息ID Payload []byte `protobuf:"bytes,4,opt,name=Payload,proto3" json:"Payload,omitempty"` // 消息负载 } @@ -127,18 +127,18 @@ func (*EnterResp) Descriptor() ([]byte, []int) { return file_service_scene_proto_rawDescGZIP(), []int{1} } -func (x *EnterResp) GetSceneSID() string { +func (x *EnterResp) GetSceneSID() int64 { if x != nil { return x.SceneSID } - return "" + return 0 } -func (x *EnterResp) GetUniqueNo() string { +func (x *EnterResp) GetUniqueNo() int64 { if x != nil { return x.UniqueNo } - return "" + return 0 } func (x *EnterResp) GetMessageID() int32 { @@ -160,8 +160,8 @@ type LeaveReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - USN string `protobuf:"bytes,1,opt,name=USN,proto3" json:"USN,omitempty"` // 用户ID - UniqueNo string `protobuf:"bytes,2,opt,name=UniqueNo,proto3" json:"UniqueNo,omitempty"` // 副本唯一编号 + USN int64 `protobuf:"varint,1,opt,name=USN,proto3" json:"USN,omitempty"` // 用户ID + UniqueNo int64 `protobuf:"varint,2,opt,name=UniqueNo,proto3" json:"UniqueNo,omitempty"` // 副本唯一编号 } func (x *LeaveReq) Reset() { @@ -196,18 +196,18 @@ func (*LeaveReq) Descriptor() ([]byte, []int) { return file_service_scene_proto_rawDescGZIP(), []int{2} } -func (x *LeaveReq) GetUSN() string { +func (x *LeaveReq) GetUSN() int64 { if x != nil { return x.USN } - return "" + return 0 } -func (x *LeaveReq) GetUniqueNo() string { +func (x *LeaveReq) GetUniqueNo() int64 { if x != nil { return x.UniqueNo } - return "" + return 0 } type LeaveResp struct { @@ -253,12 +253,12 @@ type ActionReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UniqueNo string `protobuf:"bytes,1,opt,name=UniqueNo,proto3" json:"UniqueNo,omitempty"` // 副本唯一编号 - USN string `protobuf:"bytes,2,opt,name=USN,proto3" json:"USN,omitempty"` // 用户ID - Action int32 `protobuf:"varint,3,opt,name=Action,proto3" json:"Action,omitempty"` // 指令ID - DirX int32 `protobuf:"zigzag32,4,opt,name=DirX,proto3" json:"DirX,omitempty"` // 移动-X方向(×1000 缩放) - DirY int32 `protobuf:"zigzag32,5,opt,name=DirY,proto3" json:"DirY,omitempty"` // 移动-Y方向(×1000 缩放) - SkillID int32 `protobuf:"varint,6,opt,name=SkillID,proto3" json:"SkillID,omitempty"` // 攻击-技能ID + UniqueNo int64 `protobuf:"varint,1,opt,name=UniqueNo,proto3" json:"UniqueNo,omitempty"` // 副本唯一编号 + USN int64 `protobuf:"varint,2,opt,name=USN,proto3" json:"USN,omitempty"` // 用户ID + Action int32 `protobuf:"varint,3,opt,name=Action,proto3" json:"Action,omitempty"` // 指令ID + DirX int32 `protobuf:"zigzag32,4,opt,name=DirX,proto3" json:"DirX,omitempty"` // 移动-X方向(×1000 缩放) + DirY int32 `protobuf:"zigzag32,5,opt,name=DirY,proto3" json:"DirY,omitempty"` // 移动-Y方向(×1000 缩放) + SkillID int32 `protobuf:"varint,6,opt,name=SkillID,proto3" json:"SkillID,omitempty"` // 攻击-技能ID } func (x *ActionReq) Reset() { @@ -293,18 +293,18 @@ func (*ActionReq) Descriptor() ([]byte, []int) { return file_service_scene_proto_rawDescGZIP(), []int{4} } -func (x *ActionReq) GetUniqueNo() string { +func (x *ActionReq) GetUniqueNo() int64 { if x != nil { return x.UniqueNo } - return "" + return 0 } -func (x *ActionReq) GetUSN() string { +func (x *ActionReq) GetUSN() int64 { if x != nil { return x.USN } - return "" + return 0 } func (x *ActionReq) GetAction() int32 { @@ -379,27 +379,27 @@ var file_service_scene_proto_rawDesc = []byte{ 0x0a, 0x13, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x73, 0x63, 0x65, 0x6e, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x72, 0x73, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5c, 0x0a, 0x08, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x53, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x53, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x55, 0x53, 0x4e, 0x12, 0x1e, 0x0a, 0x0a, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x53, - 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, + 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x44, 0x22, 0x7b, 0x0a, 0x09, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x63, 0x65, 0x6e, 0x65, 0x53, 0x49, 0x44, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x53, 0x63, 0x65, 0x6e, 0x65, 0x53, 0x49, 0x44, 0x12, 0x1a, 0x0a, - 0x08, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x4e, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x01, 0x28, 0x03, 0x52, 0x08, 0x53, 0x63, 0x65, 0x6e, 0x65, 0x53, 0x49, 0x44, 0x12, 0x1a, 0x0a, + 0x08, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x4e, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x4e, 0x6f, 0x12, 0x1c, 0x0a, 0x09, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x38, 0x0a, 0x08, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, - 0x03, 0x55, 0x53, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x55, 0x53, 0x4e, 0x12, + 0x03, 0x55, 0x53, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x55, 0x53, 0x4e, 0x12, 0x1a, 0x0a, 0x08, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x4e, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x4e, 0x6f, 0x22, 0x0b, 0x0a, 0x09, 0x4c, + 0x03, 0x52, 0x08, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x4e, 0x6f, 0x22, 0x0b, 0x0a, 0x09, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x93, 0x01, 0x0a, 0x09, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, - 0x4e, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, - 0x4e, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x53, 0x4e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x4e, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, + 0x4e, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x53, 0x4e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x55, 0x53, 0x4e, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x44, 0x69, 0x72, 0x58, 0x18, 0x04, 0x20, 0x01, 0x28, 0x11, 0x52, 0x04, 0x44, 0x69, 0x72, 0x58, diff --git a/Proto/RpcServer/gen/git.hlsq.asia/mmorpg/service-common/proto/rs/grpc_pb/service_user.pb.go b/Proto/RpcServer/gen/git.hlsq.asia/mmorpg/service-common/proto/rs/grpc_pb/service_user.pb.go index ff435f2..6d3ee23 100644 --- a/Proto/RpcServer/gen/git.hlsq.asia/mmorpg/service-common/proto/rs/grpc_pb/service_user.pb.go +++ b/Proto/RpcServer/gen/git.hlsq.asia/mmorpg/service-common/proto/rs/grpc_pb/service_user.pb.go @@ -83,7 +83,7 @@ type PhoneLoginResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - USN string `protobuf:"bytes,1,opt,name=USN,json=usn,proto3" json:"USN,omitempty"` // 用户ID + USN int64 `protobuf:"varint,1,opt,name=USN,json=usn,proto3" json:"USN,omitempty"` // 用户ID Name string `protobuf:"bytes,2,opt,name=Name,json=name,proto3" json:"Name,omitempty"` // 用户名 } @@ -119,11 +119,11 @@ func (*PhoneLoginResp) Descriptor() ([]byte, []int) { return file_service_user_proto_rawDescGZIP(), []int{1} } -func (x *PhoneLoginResp) GetUSN() string { +func (x *PhoneLoginResp) GetUSN() int64 { if x != nil { return x.USN } - return "" + return 0 } func (x *PhoneLoginResp) GetName() string { @@ -186,7 +186,7 @@ type WxMiniLoginResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - USN string `protobuf:"bytes,1,opt,name=USN,json=usn,proto3" json:"USN,omitempty"` // 用户ID + USN int64 `protobuf:"varint,1,opt,name=USN,json=usn,proto3" json:"USN,omitempty"` // 用户ID Name string `protobuf:"bytes,2,opt,name=Name,json=name,proto3" json:"Name,omitempty"` // 用户名 } @@ -222,11 +222,11 @@ func (*WxMiniLoginResp) Descriptor() ([]byte, []int) { return file_service_user_proto_rawDescGZIP(), []int{3} } -func (x *WxMiniLoginResp) GetUSN() string { +func (x *WxMiniLoginResp) GetUSN() int64 { if x != nil { return x.USN } - return "" + return 0 } func (x *WxMiniLoginResp) GetName() string { @@ -242,7 +242,7 @@ type GetUserInfoReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - USN string `protobuf:"bytes,1,opt,name=USN,json=usn,proto3" json:"USN,omitempty"` + USN int64 `protobuf:"varint,1,opt,name=USN,json=usn,proto3" json:"USN,omitempty"` } func (x *GetUserInfoReq) Reset() { @@ -277,11 +277,11 @@ func (*GetUserInfoReq) Descriptor() ([]byte, []int) { return file_service_user_proto_rawDescGZIP(), []int{4} } -func (x *GetUserInfoReq) GetUSN() string { +func (x *GetUserInfoReq) GetUSN() int64 { if x != nil { return x.USN } - return "" + return 0 } type GetUserInfoResp struct { @@ -289,7 +289,7 @@ type GetUserInfoResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - USN string `protobuf:"bytes,1,opt,name=USN,json=usn,proto3" json:"USN,omitempty"` + USN int64 `protobuf:"varint,1,opt,name=USN,json=usn,proto3" json:"USN,omitempty"` Name string `protobuf:"bytes,2,opt,name=Name,json=name,proto3" json:"Name,omitempty"` } @@ -325,11 +325,11 @@ func (*GetUserInfoResp) Descriptor() ([]byte, []int) { return file_service_user_proto_rawDescGZIP(), []int{5} } -func (x *GetUserInfoResp) GetUSN() string { +func (x *GetUserInfoResp) GetUSN() int64 { if x != nil { return x.USN } - return "" + return 0 } func (x *GetUserInfoResp) GetName() string { @@ -351,19 +351,19 @@ var file_service_user_proto_rawDesc = []byte{ 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x36, 0x0a, 0x0e, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x12, 0x10, 0x0a, 0x03, 0x55, 0x53, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, + 0x12, 0x10, 0x0a, 0x03, 0x55, 0x53, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x73, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x24, 0x0a, 0x0e, 0x57, 0x78, 0x4d, 0x69, 0x6e, 0x69, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x37, 0x0a, 0x0f, 0x57, 0x78, 0x4d, 0x69, 0x6e, 0x69, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x10, 0x0a, 0x03, 0x55, 0x53, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x73, + 0x10, 0x0a, 0x03, 0x55, 0x53, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x73, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x22, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x53, 0x4e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x73, 0x6e, 0x22, 0x37, 0x0a, 0x0f, 0x47, 0x65, 0x74, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x73, 0x6e, 0x22, 0x37, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, - 0x55, 0x53, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x73, 0x6e, 0x12, 0x12, + 0x55, 0x53, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x73, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x32, 0xb9, 0x01, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x2f, 0x0a, 0x0a, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x0e, 0x2e, 0x50, 0x68, 0x6f, 0x6e, diff --git a/Proto/RpcServer/sources/service_gateway.proto b/Proto/RpcServer/sources/service_gateway.proto index ae8139a..a96a266 100644 --- a/Proto/RpcServer/sources/service_gateway.proto +++ b/Proto/RpcServer/sources/service_gateway.proto @@ -10,7 +10,7 @@ service Gateway { } message ToClientReq { - string USN = 1; + int64 USN = 1; int32 MessageID = 2; bytes Payload = 3; } @@ -19,7 +19,7 @@ message ToClientResp { } message KickUserReq { - string USN = 1; + int64 USN = 1; } message KickUserResp { diff --git a/Proto/RpcServer/sources/service_qgdzs.proto b/Proto/RpcServer/sources/service_qgdzs.proto index 151ce7c..760e093 100644 --- a/Proto/RpcServer/sources/service_qgdzs.proto +++ b/Proto/RpcServer/sources/service_qgdzs.proto @@ -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"]; // 解析 } \ No newline at end of file diff --git a/Proto/RpcServer/sources/service_scene.proto b/Proto/RpcServer/sources/service_scene.proto index e38ef63..20aa026 100644 --- a/Proto/RpcServer/sources/service_scene.proto +++ b/Proto/RpcServer/sources/service_scene.proto @@ -10,29 +10,29 @@ service Scene { } message EnterReq { - string USN = 1; // 用户ID - string GatewaySID = 2; // 网关服务ID + int64 USN = 1; // 用户ID + int64 GatewaySID = 2; // 网关服务ID int32 InstanceID = 3; // 副本ID } message EnterResp { - string SceneSID = 1; // 场景服务ID - string UniqueNo = 2; // 副本唯一编号 + int64 SceneSID = 1; // 场景服务ID + int64 UniqueNo = 2; // 副本唯一编号 int32 MessageID = 3; // 发送给客户端的消息ID bytes Payload = 4; // 消息负载 } message LeaveReq { - string USN = 1; // 用户ID - string UniqueNo = 2; // 副本唯一编号 + int64 USN = 1; // 用户ID + int64 UniqueNo = 2; // 副本唯一编号 } message LeaveResp { } message ActionReq { - string UniqueNo = 1; // 副本唯一编号 - string USN = 2; // 用户ID + int64 UniqueNo = 1; // 副本唯一编号 + int64 USN = 2; // 用户ID int32 Action = 3; // 指令ID sint32 DirX = 4; // 移动-X方向(×1000 缩放) sint32 DirY = 5; // 移动-Y方向(×1000 缩放) diff --git a/Proto/RpcServer/sources/service_user.proto b/Proto/RpcServer/sources/service_user.proto index a250b7b..4e18f74 100644 --- a/Proto/RpcServer/sources/service_user.proto +++ b/Proto/RpcServer/sources/service_user.proto @@ -8,12 +8,7 @@ service User { rpc PhoneLogin(PhoneLoginReq) returns (PhoneLoginResp) {} rpc WxMiniLogin(WxMiniLoginReq) returns (WxMiniLoginResp) {} // 获取用户信息 - rpc GetUserInfo(GetUserInfoReq) returns (GetUserInfoResp) { - option (google.api.http) = { - post: "/user/auth/info" - body: "*" - }; - } + rpc GetUserInfo(GetUserInfoReq) returns (GetUserInfoResp) {option (google.api.http) = {post: "/user/auth/info" body: "*"};} } // ---------- PhoneLogin ---------- @@ -22,7 +17,7 @@ message PhoneLoginReq { string Code = 2 [json_name = "code"]; // 验证码 } message PhoneLoginResp { - string USN = 1 [json_name = "usn"]; // 用户ID + int64 USN = 1 [json_name = "usn"]; // 用户ID string Name = 2 [json_name = "name"]; // 用户名 } @@ -31,15 +26,15 @@ message WxMiniLoginReq { string Code = 1 [json_name = "code"]; // 微信小程序登录凭证 } message WxMiniLoginResp { - string USN = 1 [json_name = "usn"]; // 用户ID + int64 USN = 1 [json_name = "usn"]; // 用户ID string Name = 2 [json_name = "name"]; // 用户名 } // ---------- GetUserInfo ---------- message GetUserInfoReq { - string USN = 1 [json_name = "usn"]; + int64 USN = 1 [json_name = "usn"]; } message GetUserInfoResp { - string USN = 1 [json_name = "usn"]; + int64 USN = 1 [json_name = "usn"]; string Name = 2 [json_name = "name"]; } \ No newline at end of file diff --git a/Proto/SocketServer/gen/client/Action.cs b/Proto/SocketServer/gen/client/Action.cs index 05d649d..65919c0 100644 --- a/Proto/SocketServer/gen/client/Action.cs +++ b/Proto/SocketServer/gen/client/Action.cs @@ -28,7 +28,7 @@ public static partial class ActionReflection { "bhIQCghTZXF1ZW5jZRgBIAEoDRIRCglUaW1lc3RhbXAYAiABKAMSGQoGQWN0", "aW9uGAMgASgOMgkuQWN0aW9uSUQSDAoERGlyWBgEIAEoERIMCgREaXJZGAUg", "ASgREg8KB1NraWxsSUQYBiABKAUiMQoMUG9zaXRpb25JbmZvEgsKA1VTThgB", - "IAEoCRIJCgFYGAIgASgREgkKAVkYAyABKBEiKwoMUzJDX1Bvc2l0aW9uEhsK", + "IAEoAxIJCgFYGAIgASgREgkKAVkYAyABKBEiKwoMUzJDX1Bvc2l0aW9uEhsK", "BEluZm8YASADKAsyDS5Qb3NpdGlvbkluZm8qSwoIQWN0aW9uSUQSFQoRQUNU", "SU9OX0lEX0lOVkFMSUQQABISCg5BQ1RJT05fSURfTU9WRRABEhQKEEFDVElP", "Tl9JRF9BVFRBQ0sQAkI0WjJnaXQuaGxzcS5hc2lhL21tb3JwZy9zZXJ2aWNl", @@ -902,13 +902,13 @@ public sealed partial class PositionInfo : pb::IMessage /// Field number for the "USN" field. public const int USNFieldNumber = 1; - private string uSN_ = ""; + private long uSN_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string USN { + public long USN { get { return uSN_; } set { - uSN_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + uSN_ = value; } } @@ -961,7 +961,7 @@ public sealed partial class PositionInfo : pb::IMessage [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; - if (USN.Length != 0) hash ^= USN.GetHashCode(); + if (USN != 0L) hash ^= USN.GetHashCode(); if (X != 0) hash ^= X.GetHashCode(); if (Y != 0) hash ^= Y.GetHashCode(); if (_unknownFields != null) { @@ -982,9 +982,9 @@ public sealed partial class PositionInfo : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (USN.Length != 0) { - output.WriteRawTag(10); - output.WriteString(USN); + if (USN != 0L) { + output.WriteRawTag(8); + output.WriteInt64(USN); } if (X != 0) { output.WriteRawTag(16); @@ -1004,9 +1004,9 @@ public sealed partial class PositionInfo : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (USN.Length != 0) { - output.WriteRawTag(10); - output.WriteString(USN); + if (USN != 0L) { + output.WriteRawTag(8); + output.WriteInt64(USN); } if (X != 0) { output.WriteRawTag(16); @@ -1026,8 +1026,8 @@ public sealed partial class PositionInfo : pb::IMessage [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (USN.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(USN); + if (USN != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(USN); } if (X != 0) { size += 1 + pb::CodedOutputStream.ComputeSInt32Size(X); @@ -1047,7 +1047,7 @@ public sealed partial class PositionInfo : pb::IMessage if (other == null) { return; } - if (other.USN.Length != 0) { + if (other.USN != 0L) { USN = other.USN; } if (other.X != 0) { @@ -1071,8 +1071,8 @@ public sealed partial class PositionInfo : pb::IMessage default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; - case 10: { - USN = input.ReadString(); + case 8: { + USN = input.ReadInt64(); break; } case 16: { @@ -1098,8 +1098,8 @@ public sealed partial class PositionInfo : pb::IMessage default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; - case 10: { - USN = input.ReadString(); + case 8: { + USN = input.ReadInt64(); break; } case 16: { diff --git a/Proto/SocketServer/gen/git.hlsq.asia/mmorpg/service-common/proto/ss/ss_pb/action.pb.go b/Proto/SocketServer/gen/git.hlsq.asia/mmorpg/service-common/proto/ss/ss_pb/action.pb.go index cf9e13a..c80ae92 100644 --- a/Proto/SocketServer/gen/git.hlsq.asia/mmorpg/service-common/proto/ss/ss_pb/action.pb.go +++ b/Proto/SocketServer/gen/git.hlsq.asia/mmorpg/service-common/proto/ss/ss_pb/action.pb.go @@ -259,9 +259,9 @@ type PositionInfo struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - USN string `protobuf:"bytes,1,opt,name=USN,proto3" json:"USN,omitempty"` - X int32 `protobuf:"zigzag32,2,opt,name=X,proto3" json:"X,omitempty"` - Y int32 `protobuf:"zigzag32,3,opt,name=Y,proto3" json:"Y,omitempty"` + USN int64 `protobuf:"varint,1,opt,name=USN,proto3" json:"USN,omitempty"` + X int32 `protobuf:"zigzag32,2,opt,name=X,proto3" json:"X,omitempty"` + Y int32 `protobuf:"zigzag32,3,opt,name=Y,proto3" json:"Y,omitempty"` } func (x *PositionInfo) Reset() { @@ -296,11 +296,11 @@ func (*PositionInfo) Descriptor() ([]byte, []int) { return file_action_proto_rawDescGZIP(), []int{3} } -func (x *PositionInfo) GetUSN() string { +func (x *PositionInfo) GetUSN() int64 { if x != nil { return x.USN } - return "" + return 0 } func (x *PositionInfo) GetX() int32 { @@ -388,7 +388,7 @@ var file_action_proto_rawDesc = []byte{ 0x12, 0x18, 0x0a, 0x07, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x49, 0x44, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x49, 0x44, 0x22, 0x3c, 0x0a, 0x0c, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x53, - 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x55, 0x53, 0x4e, 0x12, 0x0c, 0x0a, 0x01, + 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x55, 0x53, 0x4e, 0x12, 0x0c, 0x0a, 0x01, 0x58, 0x18, 0x02, 0x20, 0x01, 0x28, 0x11, 0x52, 0x01, 0x58, 0x12, 0x0c, 0x0a, 0x01, 0x59, 0x18, 0x03, 0x20, 0x01, 0x28, 0x11, 0x52, 0x01, 0x59, 0x22, 0x31, 0x0a, 0x0c, 0x53, 0x32, 0x43, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, diff --git a/Proto/SocketServer/sources/action.proto b/Proto/SocketServer/sources/action.proto index 630fca1..c3ee87d 100644 --- a/Proto/SocketServer/sources/action.proto +++ b/Proto/SocketServer/sources/action.proto @@ -28,7 +28,7 @@ message C2S_Action { // MESSAGE_ID_POSITION message PositionInfo { - string USN = 1; + int64 USN = 1; sint32 X = 2; sint32 Y = 3; } diff --git a/Publish/docker-compose-dns.yml b/Publish/docker-compose-dns.yml new file mode 100644 index 0000000..921039f --- /dev/null +++ b/Publish/docker-compose-dns.yml @@ -0,0 +1,10 @@ +services: + dnsmasq: + image: 4km3/dnsmasq:2.90-r3-alpine-3.22.2 + container_name: dnsmasq + restart: unless-stopped + ports: + - "53:53/udp" + - "53:53/tcp" + volumes: + - ./dnsmasq/dnsmasq.conf:/etc/dnsmasq.conf \ No newline at end of file diff --git a/Tools/mysql_model/gen.ps1 b/Tools/mysql_model/gen.ps1 index 5912bba..71bc6d5 100644 --- a/Tools/mysql_model/gen.ps1 +++ b/Tools/mysql_model/gen.ps1 @@ -10,11 +10,11 @@ param( Get-ChildItem ./${dbName}/model/*.gen.go | ForEach-Object { $c = Get-Content $_.FullName -Raw -Encoding UTF8 - if ($c -match '\bSn\s+string\b' -and $c -notmatch 'BeforeCreate') { + if ($c -match '\bSn\s+int64\b' -and $c -notmatch 'BeforeCreate') { $c -match 'type\s+(\w+)\s+struct' | Out-Null $n = $matches[1] $c = $c -replace '(?s)(import\s*\([^)]*)', "`$1`t`"git.hlsq.asia/mmorpg/service-common/utils`"`n" - $hook = "`n`n// Auto sn`nfunc (m *$n) BeforeCreate(_ *gorm.DB) error {`n`tif m.Sn == `"`" {`n`t`tm.Sn = utils.SnowflakeInstance().Generate().String()`n`t}`n`treturn nil`n}" + $hook = "`n`n// Auto sn`nfunc (m *$n) BeforeCreate(_ *gorm.DB) error {`n`tif m.Sn == 0 {`n`t`tm.Sn = utils.SnowflakeInstance().Generate().Int64()`n`t}`n`treturn nil`n}" Set-Content $_.FullName ($c.TrimEnd() + $hook) -Encoding UTF8 } } \ No newline at end of file diff --git a/Tools/mysql_model/qgdzs_db/model/categories.gen.go b/Tools/mysql_model/qgdzs_db/model/categories.gen.go index 826de21..a9b4f0b 100644 --- a/Tools/mysql_model/qgdzs_db/model/categories.gen.go +++ b/Tools/mysql_model/qgdzs_db/model/categories.gen.go @@ -16,7 +16,7 @@ const TableNameCategory = "categories" // Category mapped from table type Category struct { ID uint64 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"` - Sn string `gorm:"column:sn;not null;comment:业务唯一编号" json:"sn"` // 业务唯一编号 + Sn int64 `gorm:"column:sn;not null;comment:业务唯一编号" json:"sn"` // 业务唯一编号 Category string `gorm:"column:category;not null;comment:分类" json:"category"` // 分类 CreatedAt time.Time `gorm:"column:created_at;not null" json:"created_at"` UpdatedAt time.Time `gorm:"column:updated_at;not null" json:"updated_at"` @@ -30,8 +30,8 @@ func (*Category) TableName() string { // Auto sn func (m *Category) BeforeCreate(_ *gorm.DB) error { - if m.Sn == "" { - m.Sn = utils.SnowflakeInstance().Generate().String() + if m.Sn == 0 { + m.Sn = utils.SnowflakeInstance().Generate().Int64() } return nil } diff --git a/Tools/mysql_model/qgdzs_db/model/point_card.gen.go b/Tools/mysql_model/qgdzs_db/model/point_card.gen.go new file mode 100644 index 0000000..a61f381 --- /dev/null +++ b/Tools/mysql_model/qgdzs_db/model/point_card.gen.go @@ -0,0 +1,38 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +import ( + "time" + + "git.hlsq.asia/mmorpg/service-common/utils" + "gorm.io/gorm" +) + +const TableNamePointCard = "point_card" + +// PointCard mapped from table +type PointCard struct { + ID uint64 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"` + Sn int64 `gorm:"column:sn;not null;comment:业务唯一编号" json:"sn"` // 业务唯一编号 + UserSn int64 `gorm:"column:user_sn;not null;comment:用户-唯一编号" json:"user_sn"` // 用户-唯一编号 + Point int64 `gorm:"column:point;not null;comment:积分" json:"point"` // 积分 + CreatedAt time.Time `gorm:"column:created_at;not null" json:"created_at"` + UpdatedAt time.Time `gorm:"column:updated_at;not null" json:"updated_at"` + DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"` +} + +// TableName PointCard's table name +func (*PointCard) TableName() string { + return TableNamePointCard +} + +// Auto sn +func (m *PointCard) BeforeCreate(_ *gorm.DB) error { + if m.Sn == 0 { + m.Sn = utils.SnowflakeInstance().Generate().Int64() + } + return nil +} diff --git a/Tools/mysql_model/qgdzs_db/model/point_records.gen.go b/Tools/mysql_model/qgdzs_db/model/point_records.gen.go new file mode 100644 index 0000000..c191a6d --- /dev/null +++ b/Tools/mysql_model/qgdzs_db/model/point_records.gen.go @@ -0,0 +1,46 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +import ( + "time" + + "git.hlsq.asia/mmorpg/service-common/utils" + "gorm.io/gorm" +) + +const TableNamePointRecord = "point_records" + +// PointRecord mapped from table +type PointRecord struct { + ID uint64 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"` + Sn int64 `gorm:"column:sn;not null;comment:业务唯一编号" json:"sn"` // 业务唯一编号 + UserSn int64 `gorm:"column:user_sn;not null;comment:用户-唯一编号" json:"user_sn"` // 用户-唯一编号 + /* + 来源: + 0. 未知 + 1. 随机答题 + 2. 类目答题 + 3. 限时答题 + */ + Source int32 `gorm:"column:source;not null;comment:来源:\n0. 未知\n1. 随机答题\n2. 类目答题\n3. 限时答题" json:"source"` + Point int64 `gorm:"column:point;not null;comment:积分" json:"point"` // 积分 + CreatedAt time.Time `gorm:"column:created_at;not null" json:"created_at"` + UpdatedAt time.Time `gorm:"column:updated_at;not null" json:"updated_at"` + DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"` +} + +// TableName PointRecord's table name +func (*PointRecord) TableName() string { + return TableNamePointRecord +} + +// Auto sn +func (m *PointRecord) BeforeCreate(_ *gorm.DB) error { + if m.Sn == 0 { + m.Sn = utils.SnowflakeInstance().Generate().Int64() + } + return nil +} diff --git a/Tools/mysql_model/qgdzs_db/model/questions.gen.go b/Tools/mysql_model/qgdzs_db/model/questions.gen.go index 41da87f..0430876 100644 --- a/Tools/mysql_model/qgdzs_db/model/questions.gen.go +++ b/Tools/mysql_model/qgdzs_db/model/questions.gen.go @@ -16,13 +16,13 @@ const TableNameQuestion = "questions" // Question mapped from table type Question struct { ID uint64 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"` - Sn string `gorm:"column:sn;not null;comment:业务唯一编号" json:"sn"` // 业务唯一编号 + Sn int64 `gorm:"column:sn;not null;comment:业务唯一编号" json:"sn"` // 业务唯一编号 Question string `gorm:"column:question;not null;comment:题干" json:"question"` // 题干 Options string `gorm:"column:options;not null;comment:选项" json:"options"` // 选项 Answer string `gorm:"column:answer;not null;comment:答案" json:"answer"` // 答案 Explanation string `gorm:"column:explanation;not null;comment:解析" json:"explanation"` // 解析 Difficulty int32 `gorm:"column:difficulty;not null;comment:难度分 0 - 100" json:"difficulty"` // 难度分 0 - 100 - CategorySn string `gorm:"column:category_sn;not null;comment:分类-唯一编号" json:"category_sn"` // 分类-唯一编号 + CategorySn int64 `gorm:"column:category_sn;not null;comment:分类-唯一编号" json:"category_sn"` // 分类-唯一编号 CreatedAt time.Time `gorm:"column:created_at;not null" json:"created_at"` UpdatedAt time.Time `gorm:"column:updated_at;not null" json:"updated_at"` DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"` @@ -35,8 +35,8 @@ func (*Question) TableName() string { // Auto sn func (m *Question) BeforeCreate(_ *gorm.DB) error { - if m.Sn == "" { - m.Sn = utils.SnowflakeInstance().Generate().String() + if m.Sn == 0 { + m.Sn = utils.SnowflakeInstance().Generate().Int64() } return nil } diff --git a/Tools/mysql_model/qgdzs_db/model/records.gen.go b/Tools/mysql_model/qgdzs_db/model/records.gen.go index f928139..9ace80f 100644 --- a/Tools/mysql_model/qgdzs_db/model/records.gen.go +++ b/Tools/mysql_model/qgdzs_db/model/records.gen.go @@ -16,9 +16,9 @@ const TableNameRecord = "records" // Record mapped from table type Record struct { ID uint64 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"` - Sn string `gorm:"column:sn;not null;comment:业务唯一编号" json:"sn"` // 业务唯一编号 - UserSn string `gorm:"column:user_sn;not null;comment:用户-唯一编号" json:"user_sn"` // 用户-唯一编号 - QuestionSn string `gorm:"column:question_sn;not null;comment:题目-唯一编号" json:"question_sn"` // 题目-唯一编号 + Sn int64 `gorm:"column:sn;not null;comment:业务唯一编号" json:"sn"` // 业务唯一编号 + UserSn int64 `gorm:"column:user_sn;not null;comment:用户-唯一编号" json:"user_sn"` // 用户-唯一编号 + QuestionSn int64 `gorm:"column:question_sn;not null;comment:题目-唯一编号" json:"question_sn"` // 题目-唯一编号 Answer string `gorm:"column:answer;not null;comment:答案" json:"answer"` // 答案 IsCorrect int32 `gorm:"column:is_correct;not null;comment:是否正确 0 否 1 是" json:"is_correct"` // 是否正确 0 否 1 是 CreatedAt time.Time `gorm:"column:created_at;not null" json:"created_at"` @@ -33,8 +33,8 @@ func (*Record) TableName() string { // Auto sn func (m *Record) BeforeCreate(_ *gorm.DB) error { - if m.Sn == "" { - m.Sn = utils.SnowflakeInstance().Generate().String() + if m.Sn == 0 { + m.Sn = utils.SnowflakeInstance().Generate().Int64() } return nil } diff --git a/Tools/mysql_model/qgdzs_db/query/categories.gen.go b/Tools/mysql_model/qgdzs_db/query/categories.gen.go index 78622d3..0732346 100644 --- a/Tools/mysql_model/qgdzs_db/query/categories.gen.go +++ b/Tools/mysql_model/qgdzs_db/query/categories.gen.go @@ -28,7 +28,7 @@ func newCategory(db *gorm.DB, opts ...gen.DOOption) category { tableName := _category.categoryDo.TableName() _category.ALL = field.NewAsterisk(tableName) _category.ID = field.NewUint64(tableName, "id") - _category.Sn = field.NewString(tableName, "sn") + _category.Sn = field.NewInt64(tableName, "sn") _category.Category = field.NewString(tableName, "category") _category.CreatedAt = field.NewTime(tableName, "created_at") _category.UpdatedAt = field.NewTime(tableName, "updated_at") @@ -44,7 +44,7 @@ type category struct { ALL field.Asterisk ID field.Uint64 - Sn field.String // 业务唯一编号 + Sn field.Int64 // 业务唯一编号 Category field.String // 分类 CreatedAt field.Time UpdatedAt field.Time @@ -66,7 +66,7 @@ func (c category) As(alias string) *category { func (c *category) updateTableName(table string) *category { c.ALL = field.NewAsterisk(table) c.ID = field.NewUint64(table, "id") - c.Sn = field.NewString(table, "sn") + c.Sn = field.NewInt64(table, "sn") c.Category = field.NewString(table, "category") c.CreatedAt = field.NewTime(table, "created_at") c.UpdatedAt = field.NewTime(table, "updated_at") diff --git a/Tools/mysql_model/qgdzs_db/query/gen.go b/Tools/mysql_model/qgdzs_db/query/gen.go index f5d18a1..5836690 100644 --- a/Tools/mysql_model/qgdzs_db/query/gen.go +++ b/Tools/mysql_model/qgdzs_db/query/gen.go @@ -17,29 +17,35 @@ import ( func Use(db *gorm.DB, opts ...gen.DOOption) *Query { return &Query{ - db: db, - Category: newCategory(db, opts...), - Question: newQuestion(db, opts...), - Record: newRecord(db, opts...), + db: db, + Category: newCategory(db, opts...), + PointCard: newPointCard(db, opts...), + PointRecord: newPointRecord(db, opts...), + Question: newQuestion(db, opts...), + Record: newRecord(db, opts...), } } type Query struct { db *gorm.DB - Category category - Question question - Record record + Category category + PointCard pointCard + PointRecord pointRecord + Question question + Record record } func (q *Query) Available() bool { return q.db != nil } func (q *Query) clone(db *gorm.DB) *Query { return &Query{ - db: db, - Category: q.Category.clone(db), - Question: q.Question.clone(db), - Record: q.Record.clone(db), + db: db, + Category: q.Category.clone(db), + PointCard: q.PointCard.clone(db), + PointRecord: q.PointRecord.clone(db), + Question: q.Question.clone(db), + Record: q.Record.clone(db), } } @@ -53,24 +59,30 @@ func (q *Query) WriteDB() *Query { func (q *Query) ReplaceDB(db *gorm.DB) *Query { return &Query{ - db: db, - Category: q.Category.replaceDB(db), - Question: q.Question.replaceDB(db), - Record: q.Record.replaceDB(db), + db: db, + Category: q.Category.replaceDB(db), + PointCard: q.PointCard.replaceDB(db), + PointRecord: q.PointRecord.replaceDB(db), + Question: q.Question.replaceDB(db), + Record: q.Record.replaceDB(db), } } type queryCtx struct { - Category *categoryDo - Question *questionDo - Record *recordDo + Category *categoryDo + PointCard *pointCardDo + PointRecord *pointRecordDo + Question *questionDo + Record *recordDo } func (q *Query) WithContext(ctx context.Context) *queryCtx { return &queryCtx{ - Category: q.Category.WithContext(ctx), - Question: q.Question.WithContext(ctx), - Record: q.Record.WithContext(ctx), + Category: q.Category.WithContext(ctx), + PointCard: q.PointCard.WithContext(ctx), + PointRecord: q.PointRecord.WithContext(ctx), + Question: q.Question.WithContext(ctx), + Record: q.Record.WithContext(ctx), } } diff --git a/Tools/mysql_model/qgdzs_db/query/point_card.gen.go b/Tools/mysql_model/qgdzs_db/query/point_card.gen.go new file mode 100644 index 0000000..c6e85ce --- /dev/null +++ b/Tools/mysql_model/qgdzs_db/query/point_card.gen.go @@ -0,0 +1,353 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package query + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "git.hlsq.asia/mmorpg/qgdzs_db/model" +) + +func newPointCard(db *gorm.DB, opts ...gen.DOOption) pointCard { + _pointCard := pointCard{} + + _pointCard.pointCardDo.UseDB(db, opts...) + _pointCard.pointCardDo.UseModel(&model.PointCard{}) + + tableName := _pointCard.pointCardDo.TableName() + _pointCard.ALL = field.NewAsterisk(tableName) + _pointCard.ID = field.NewUint64(tableName, "id") + _pointCard.Sn = field.NewInt64(tableName, "sn") + _pointCard.UserSn = field.NewInt64(tableName, "user_sn") + _pointCard.Point = field.NewInt64(tableName, "point") + _pointCard.CreatedAt = field.NewTime(tableName, "created_at") + _pointCard.UpdatedAt = field.NewTime(tableName, "updated_at") + _pointCard.DeletedAt = field.NewField(tableName, "deleted_at") + + _pointCard.fillFieldMap() + + return _pointCard +} + +type pointCard struct { + pointCardDo pointCardDo + + ALL field.Asterisk + ID field.Uint64 + Sn field.Int64 // 业务唯一编号 + UserSn field.Int64 // 用户-唯一编号 + Point field.Int64 // 积分 + CreatedAt field.Time + UpdatedAt field.Time + DeletedAt field.Field + + fieldMap map[string]field.Expr +} + +func (p pointCard) Table(newTableName string) *pointCard { + p.pointCardDo.UseTable(newTableName) + return p.updateTableName(newTableName) +} + +func (p pointCard) As(alias string) *pointCard { + p.pointCardDo.DO = *(p.pointCardDo.As(alias).(*gen.DO)) + return p.updateTableName(alias) +} + +func (p *pointCard) updateTableName(table string) *pointCard { + p.ALL = field.NewAsterisk(table) + p.ID = field.NewUint64(table, "id") + p.Sn = field.NewInt64(table, "sn") + p.UserSn = field.NewInt64(table, "user_sn") + p.Point = field.NewInt64(table, "point") + p.CreatedAt = field.NewTime(table, "created_at") + p.UpdatedAt = field.NewTime(table, "updated_at") + p.DeletedAt = field.NewField(table, "deleted_at") + + p.fillFieldMap() + + return p +} + +func (p *pointCard) WithContext(ctx context.Context) *pointCardDo { + return p.pointCardDo.WithContext(ctx) +} + +func (p pointCard) TableName() string { return p.pointCardDo.TableName() } + +func (p pointCard) Alias() string { return p.pointCardDo.Alias() } + +func (p pointCard) Columns(cols ...field.Expr) gen.Columns { return p.pointCardDo.Columns(cols...) } + +func (p *pointCard) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := p.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (p *pointCard) fillFieldMap() { + p.fieldMap = make(map[string]field.Expr, 7) + p.fieldMap["id"] = p.ID + p.fieldMap["sn"] = p.Sn + p.fieldMap["user_sn"] = p.UserSn + p.fieldMap["point"] = p.Point + p.fieldMap["created_at"] = p.CreatedAt + p.fieldMap["updated_at"] = p.UpdatedAt + p.fieldMap["deleted_at"] = p.DeletedAt +} + +func (p pointCard) clone(db *gorm.DB) pointCard { + p.pointCardDo.ReplaceConnPool(db.Statement.ConnPool) + return p +} + +func (p pointCard) replaceDB(db *gorm.DB) pointCard { + p.pointCardDo.ReplaceDB(db) + return p +} + +type pointCardDo struct{ gen.DO } + +func (p pointCardDo) Debug() *pointCardDo { + return p.withDO(p.DO.Debug()) +} + +func (p pointCardDo) WithContext(ctx context.Context) *pointCardDo { + return p.withDO(p.DO.WithContext(ctx)) +} + +func (p pointCardDo) ReadDB() *pointCardDo { + return p.Clauses(dbresolver.Read) +} + +func (p pointCardDo) WriteDB() *pointCardDo { + return p.Clauses(dbresolver.Write) +} + +func (p pointCardDo) Session(config *gorm.Session) *pointCardDo { + return p.withDO(p.DO.Session(config)) +} + +func (p pointCardDo) Clauses(conds ...clause.Expression) *pointCardDo { + return p.withDO(p.DO.Clauses(conds...)) +} + +func (p pointCardDo) Returning(value interface{}, columns ...string) *pointCardDo { + return p.withDO(p.DO.Returning(value, columns...)) +} + +func (p pointCardDo) Not(conds ...gen.Condition) *pointCardDo { + return p.withDO(p.DO.Not(conds...)) +} + +func (p pointCardDo) Or(conds ...gen.Condition) *pointCardDo { + return p.withDO(p.DO.Or(conds...)) +} + +func (p pointCardDo) Select(conds ...field.Expr) *pointCardDo { + return p.withDO(p.DO.Select(conds...)) +} + +func (p pointCardDo) Where(conds ...gen.Condition) *pointCardDo { + return p.withDO(p.DO.Where(conds...)) +} + +func (p pointCardDo) Order(conds ...field.Expr) *pointCardDo { + return p.withDO(p.DO.Order(conds...)) +} + +func (p pointCardDo) Distinct(cols ...field.Expr) *pointCardDo { + return p.withDO(p.DO.Distinct(cols...)) +} + +func (p pointCardDo) Omit(cols ...field.Expr) *pointCardDo { + return p.withDO(p.DO.Omit(cols...)) +} + +func (p pointCardDo) Join(table schema.Tabler, on ...field.Expr) *pointCardDo { + return p.withDO(p.DO.Join(table, on...)) +} + +func (p pointCardDo) LeftJoin(table schema.Tabler, on ...field.Expr) *pointCardDo { + return p.withDO(p.DO.LeftJoin(table, on...)) +} + +func (p pointCardDo) RightJoin(table schema.Tabler, on ...field.Expr) *pointCardDo { + return p.withDO(p.DO.RightJoin(table, on...)) +} + +func (p pointCardDo) Group(cols ...field.Expr) *pointCardDo { + return p.withDO(p.DO.Group(cols...)) +} + +func (p pointCardDo) Having(conds ...gen.Condition) *pointCardDo { + return p.withDO(p.DO.Having(conds...)) +} + +func (p pointCardDo) Limit(limit int) *pointCardDo { + return p.withDO(p.DO.Limit(limit)) +} + +func (p pointCardDo) Offset(offset int) *pointCardDo { + return p.withDO(p.DO.Offset(offset)) +} + +func (p pointCardDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *pointCardDo { + return p.withDO(p.DO.Scopes(funcs...)) +} + +func (p pointCardDo) Unscoped() *pointCardDo { + return p.withDO(p.DO.Unscoped()) +} + +func (p pointCardDo) Create(values ...*model.PointCard) error { + if len(values) == 0 { + return nil + } + return p.DO.Create(values) +} + +func (p pointCardDo) CreateInBatches(values []*model.PointCard, batchSize int) error { + return p.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (p pointCardDo) Save(values ...*model.PointCard) error { + if len(values) == 0 { + return nil + } + return p.DO.Save(values) +} + +func (p pointCardDo) First() (*model.PointCard, error) { + if result, err := p.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.PointCard), nil + } +} + +func (p pointCardDo) Take() (*model.PointCard, error) { + if result, err := p.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.PointCard), nil + } +} + +func (p pointCardDo) Last() (*model.PointCard, error) { + if result, err := p.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.PointCard), nil + } +} + +func (p pointCardDo) Find() ([]*model.PointCard, error) { + result, err := p.DO.Find() + return result.([]*model.PointCard), err +} + +func (p pointCardDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.PointCard, err error) { + buf := make([]*model.PointCard, 0, batchSize) + err = p.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (p pointCardDo) FindInBatches(result *[]*model.PointCard, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return p.DO.FindInBatches(result, batchSize, fc) +} + +func (p pointCardDo) Attrs(attrs ...field.AssignExpr) *pointCardDo { + return p.withDO(p.DO.Attrs(attrs...)) +} + +func (p pointCardDo) Assign(attrs ...field.AssignExpr) *pointCardDo { + return p.withDO(p.DO.Assign(attrs...)) +} + +func (p pointCardDo) Joins(fields ...field.RelationField) *pointCardDo { + for _, _f := range fields { + p = *p.withDO(p.DO.Joins(_f)) + } + return &p +} + +func (p pointCardDo) Preload(fields ...field.RelationField) *pointCardDo { + for _, _f := range fields { + p = *p.withDO(p.DO.Preload(_f)) + } + return &p +} + +func (p pointCardDo) FirstOrInit() (*model.PointCard, error) { + if result, err := p.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.PointCard), nil + } +} + +func (p pointCardDo) FirstOrCreate() (*model.PointCard, error) { + if result, err := p.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.PointCard), nil + } +} + +func (p pointCardDo) FindByPage(offset int, limit int) (result []*model.PointCard, count int64, err error) { + result, err = p.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = p.Offset(-1).Limit(-1).Count() + return +} + +func (p pointCardDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = p.Count() + if err != nil { + return + } + + err = p.Offset(offset).Limit(limit).Scan(result) + return +} + +func (p pointCardDo) Scan(result interface{}) (err error) { + return p.DO.Scan(result) +} + +func (p pointCardDo) Delete(models ...*model.PointCard) (result gen.ResultInfo, err error) { + return p.DO.Delete(models) +} + +func (p *pointCardDo) withDO(do gen.Dao) *pointCardDo { + p.DO = *do.(*gen.DO) + return p +} diff --git a/Tools/mysql_model/qgdzs_db/query/point_records.gen.go b/Tools/mysql_model/qgdzs_db/query/point_records.gen.go new file mode 100644 index 0000000..5474f66 --- /dev/null +++ b/Tools/mysql_model/qgdzs_db/query/point_records.gen.go @@ -0,0 +1,364 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package query + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "git.hlsq.asia/mmorpg/qgdzs_db/model" +) + +func newPointRecord(db *gorm.DB, opts ...gen.DOOption) pointRecord { + _pointRecord := pointRecord{} + + _pointRecord.pointRecordDo.UseDB(db, opts...) + _pointRecord.pointRecordDo.UseModel(&model.PointRecord{}) + + tableName := _pointRecord.pointRecordDo.TableName() + _pointRecord.ALL = field.NewAsterisk(tableName) + _pointRecord.ID = field.NewUint64(tableName, "id") + _pointRecord.Sn = field.NewInt64(tableName, "sn") + _pointRecord.UserSn = field.NewInt64(tableName, "user_sn") + _pointRecord.Source = field.NewInt32(tableName, "source") + _pointRecord.Point = field.NewInt64(tableName, "point") + _pointRecord.CreatedAt = field.NewTime(tableName, "created_at") + _pointRecord.UpdatedAt = field.NewTime(tableName, "updated_at") + _pointRecord.DeletedAt = field.NewField(tableName, "deleted_at") + + _pointRecord.fillFieldMap() + + return _pointRecord +} + +type pointRecord struct { + pointRecordDo pointRecordDo + + ALL field.Asterisk + ID field.Uint64 + Sn field.Int64 // 业务唯一编号 + UserSn field.Int64 // 用户-唯一编号 + /* + 来源: + 0. 未知 + 1. 随机答题 + 2. 类目答题 + 3. 限时答题 + */ + Source field.Int32 + Point field.Int64 // 积分 + CreatedAt field.Time + UpdatedAt field.Time + DeletedAt field.Field + + fieldMap map[string]field.Expr +} + +func (p pointRecord) Table(newTableName string) *pointRecord { + p.pointRecordDo.UseTable(newTableName) + return p.updateTableName(newTableName) +} + +func (p pointRecord) As(alias string) *pointRecord { + p.pointRecordDo.DO = *(p.pointRecordDo.As(alias).(*gen.DO)) + return p.updateTableName(alias) +} + +func (p *pointRecord) updateTableName(table string) *pointRecord { + p.ALL = field.NewAsterisk(table) + p.ID = field.NewUint64(table, "id") + p.Sn = field.NewInt64(table, "sn") + p.UserSn = field.NewInt64(table, "user_sn") + p.Source = field.NewInt32(table, "source") + p.Point = field.NewInt64(table, "point") + p.CreatedAt = field.NewTime(table, "created_at") + p.UpdatedAt = field.NewTime(table, "updated_at") + p.DeletedAt = field.NewField(table, "deleted_at") + + p.fillFieldMap() + + return p +} + +func (p *pointRecord) WithContext(ctx context.Context) *pointRecordDo { + return p.pointRecordDo.WithContext(ctx) +} + +func (p pointRecord) TableName() string { return p.pointRecordDo.TableName() } + +func (p pointRecord) Alias() string { return p.pointRecordDo.Alias() } + +func (p pointRecord) Columns(cols ...field.Expr) gen.Columns { return p.pointRecordDo.Columns(cols...) } + +func (p *pointRecord) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := p.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (p *pointRecord) fillFieldMap() { + p.fieldMap = make(map[string]field.Expr, 8) + p.fieldMap["id"] = p.ID + p.fieldMap["sn"] = p.Sn + p.fieldMap["user_sn"] = p.UserSn + p.fieldMap["source"] = p.Source + p.fieldMap["point"] = p.Point + p.fieldMap["created_at"] = p.CreatedAt + p.fieldMap["updated_at"] = p.UpdatedAt + p.fieldMap["deleted_at"] = p.DeletedAt +} + +func (p pointRecord) clone(db *gorm.DB) pointRecord { + p.pointRecordDo.ReplaceConnPool(db.Statement.ConnPool) + return p +} + +func (p pointRecord) replaceDB(db *gorm.DB) pointRecord { + p.pointRecordDo.ReplaceDB(db) + return p +} + +type pointRecordDo struct{ gen.DO } + +func (p pointRecordDo) Debug() *pointRecordDo { + return p.withDO(p.DO.Debug()) +} + +func (p pointRecordDo) WithContext(ctx context.Context) *pointRecordDo { + return p.withDO(p.DO.WithContext(ctx)) +} + +func (p pointRecordDo) ReadDB() *pointRecordDo { + return p.Clauses(dbresolver.Read) +} + +func (p pointRecordDo) WriteDB() *pointRecordDo { + return p.Clauses(dbresolver.Write) +} + +func (p pointRecordDo) Session(config *gorm.Session) *pointRecordDo { + return p.withDO(p.DO.Session(config)) +} + +func (p pointRecordDo) Clauses(conds ...clause.Expression) *pointRecordDo { + return p.withDO(p.DO.Clauses(conds...)) +} + +func (p pointRecordDo) Returning(value interface{}, columns ...string) *pointRecordDo { + return p.withDO(p.DO.Returning(value, columns...)) +} + +func (p pointRecordDo) Not(conds ...gen.Condition) *pointRecordDo { + return p.withDO(p.DO.Not(conds...)) +} + +func (p pointRecordDo) Or(conds ...gen.Condition) *pointRecordDo { + return p.withDO(p.DO.Or(conds...)) +} + +func (p pointRecordDo) Select(conds ...field.Expr) *pointRecordDo { + return p.withDO(p.DO.Select(conds...)) +} + +func (p pointRecordDo) Where(conds ...gen.Condition) *pointRecordDo { + return p.withDO(p.DO.Where(conds...)) +} + +func (p pointRecordDo) Order(conds ...field.Expr) *pointRecordDo { + return p.withDO(p.DO.Order(conds...)) +} + +func (p pointRecordDo) Distinct(cols ...field.Expr) *pointRecordDo { + return p.withDO(p.DO.Distinct(cols...)) +} + +func (p pointRecordDo) Omit(cols ...field.Expr) *pointRecordDo { + return p.withDO(p.DO.Omit(cols...)) +} + +func (p pointRecordDo) Join(table schema.Tabler, on ...field.Expr) *pointRecordDo { + return p.withDO(p.DO.Join(table, on...)) +} + +func (p pointRecordDo) LeftJoin(table schema.Tabler, on ...field.Expr) *pointRecordDo { + return p.withDO(p.DO.LeftJoin(table, on...)) +} + +func (p pointRecordDo) RightJoin(table schema.Tabler, on ...field.Expr) *pointRecordDo { + return p.withDO(p.DO.RightJoin(table, on...)) +} + +func (p pointRecordDo) Group(cols ...field.Expr) *pointRecordDo { + return p.withDO(p.DO.Group(cols...)) +} + +func (p pointRecordDo) Having(conds ...gen.Condition) *pointRecordDo { + return p.withDO(p.DO.Having(conds...)) +} + +func (p pointRecordDo) Limit(limit int) *pointRecordDo { + return p.withDO(p.DO.Limit(limit)) +} + +func (p pointRecordDo) Offset(offset int) *pointRecordDo { + return p.withDO(p.DO.Offset(offset)) +} + +func (p pointRecordDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *pointRecordDo { + return p.withDO(p.DO.Scopes(funcs...)) +} + +func (p pointRecordDo) Unscoped() *pointRecordDo { + return p.withDO(p.DO.Unscoped()) +} + +func (p pointRecordDo) Create(values ...*model.PointRecord) error { + if len(values) == 0 { + return nil + } + return p.DO.Create(values) +} + +func (p pointRecordDo) CreateInBatches(values []*model.PointRecord, batchSize int) error { + return p.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (p pointRecordDo) Save(values ...*model.PointRecord) error { + if len(values) == 0 { + return nil + } + return p.DO.Save(values) +} + +func (p pointRecordDo) First() (*model.PointRecord, error) { + if result, err := p.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.PointRecord), nil + } +} + +func (p pointRecordDo) Take() (*model.PointRecord, error) { + if result, err := p.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.PointRecord), nil + } +} + +func (p pointRecordDo) Last() (*model.PointRecord, error) { + if result, err := p.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.PointRecord), nil + } +} + +func (p pointRecordDo) Find() ([]*model.PointRecord, error) { + result, err := p.DO.Find() + return result.([]*model.PointRecord), err +} + +func (p pointRecordDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.PointRecord, err error) { + buf := make([]*model.PointRecord, 0, batchSize) + err = p.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (p pointRecordDo) FindInBatches(result *[]*model.PointRecord, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return p.DO.FindInBatches(result, batchSize, fc) +} + +func (p pointRecordDo) Attrs(attrs ...field.AssignExpr) *pointRecordDo { + return p.withDO(p.DO.Attrs(attrs...)) +} + +func (p pointRecordDo) Assign(attrs ...field.AssignExpr) *pointRecordDo { + return p.withDO(p.DO.Assign(attrs...)) +} + +func (p pointRecordDo) Joins(fields ...field.RelationField) *pointRecordDo { + for _, _f := range fields { + p = *p.withDO(p.DO.Joins(_f)) + } + return &p +} + +func (p pointRecordDo) Preload(fields ...field.RelationField) *pointRecordDo { + for _, _f := range fields { + p = *p.withDO(p.DO.Preload(_f)) + } + return &p +} + +func (p pointRecordDo) FirstOrInit() (*model.PointRecord, error) { + if result, err := p.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.PointRecord), nil + } +} + +func (p pointRecordDo) FirstOrCreate() (*model.PointRecord, error) { + if result, err := p.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.PointRecord), nil + } +} + +func (p pointRecordDo) FindByPage(offset int, limit int) (result []*model.PointRecord, count int64, err error) { + result, err = p.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = p.Offset(-1).Limit(-1).Count() + return +} + +func (p pointRecordDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = p.Count() + if err != nil { + return + } + + err = p.Offset(offset).Limit(limit).Scan(result) + return +} + +func (p pointRecordDo) Scan(result interface{}) (err error) { + return p.DO.Scan(result) +} + +func (p pointRecordDo) Delete(models ...*model.PointRecord) (result gen.ResultInfo, err error) { + return p.DO.Delete(models) +} + +func (p *pointRecordDo) withDO(do gen.Dao) *pointRecordDo { + p.DO = *do.(*gen.DO) + return p +} diff --git a/Tools/mysql_model/qgdzs_db/query/questions.gen.go b/Tools/mysql_model/qgdzs_db/query/questions.gen.go index 2080390..170f776 100644 --- a/Tools/mysql_model/qgdzs_db/query/questions.gen.go +++ b/Tools/mysql_model/qgdzs_db/query/questions.gen.go @@ -28,13 +28,13 @@ func newQuestion(db *gorm.DB, opts ...gen.DOOption) question { tableName := _question.questionDo.TableName() _question.ALL = field.NewAsterisk(tableName) _question.ID = field.NewUint64(tableName, "id") - _question.Sn = field.NewString(tableName, "sn") + _question.Sn = field.NewInt64(tableName, "sn") _question.Question = field.NewString(tableName, "question") _question.Options = field.NewString(tableName, "options") _question.Answer = field.NewString(tableName, "answer") _question.Explanation = field.NewString(tableName, "explanation") _question.Difficulty = field.NewInt32(tableName, "difficulty") - _question.CategorySn = field.NewString(tableName, "category_sn") + _question.CategorySn = field.NewInt64(tableName, "category_sn") _question.CreatedAt = field.NewTime(tableName, "created_at") _question.UpdatedAt = field.NewTime(tableName, "updated_at") _question.DeletedAt = field.NewField(tableName, "deleted_at") @@ -49,13 +49,13 @@ type question struct { ALL field.Asterisk ID field.Uint64 - Sn field.String // 业务唯一编号 + Sn field.Int64 // 业务唯一编号 Question field.String // 题干 Options field.String // 选项 Answer field.String // 答案 Explanation field.String // 解析 Difficulty field.Int32 // 难度分 0 - 100 - CategorySn field.String // 分类-唯一编号 + CategorySn field.Int64 // 分类-唯一编号 CreatedAt field.Time UpdatedAt field.Time DeletedAt field.Field @@ -76,13 +76,13 @@ func (q question) As(alias string) *question { func (q *question) updateTableName(table string) *question { q.ALL = field.NewAsterisk(table) q.ID = field.NewUint64(table, "id") - q.Sn = field.NewString(table, "sn") + q.Sn = field.NewInt64(table, "sn") q.Question = field.NewString(table, "question") q.Options = field.NewString(table, "options") q.Answer = field.NewString(table, "answer") q.Explanation = field.NewString(table, "explanation") q.Difficulty = field.NewInt32(table, "difficulty") - q.CategorySn = field.NewString(table, "category_sn") + q.CategorySn = field.NewInt64(table, "category_sn") q.CreatedAt = field.NewTime(table, "created_at") q.UpdatedAt = field.NewTime(table, "updated_at") q.DeletedAt = field.NewField(table, "deleted_at") diff --git a/Tools/mysql_model/qgdzs_db/query/records.gen.go b/Tools/mysql_model/qgdzs_db/query/records.gen.go index a85934c..fd9c0cb 100644 --- a/Tools/mysql_model/qgdzs_db/query/records.gen.go +++ b/Tools/mysql_model/qgdzs_db/query/records.gen.go @@ -28,9 +28,9 @@ func newRecord(db *gorm.DB, opts ...gen.DOOption) record { tableName := _record.recordDo.TableName() _record.ALL = field.NewAsterisk(tableName) _record.ID = field.NewUint64(tableName, "id") - _record.Sn = field.NewString(tableName, "sn") - _record.UserSn = field.NewString(tableName, "user_sn") - _record.QuestionSn = field.NewString(tableName, "question_sn") + _record.Sn = field.NewInt64(tableName, "sn") + _record.UserSn = field.NewInt64(tableName, "user_sn") + _record.QuestionSn = field.NewInt64(tableName, "question_sn") _record.Answer = field.NewString(tableName, "answer") _record.IsCorrect = field.NewInt32(tableName, "is_correct") _record.CreatedAt = field.NewTime(tableName, "created_at") @@ -47,9 +47,9 @@ type record struct { ALL field.Asterisk ID field.Uint64 - Sn field.String // 业务唯一编号 - UserSn field.String // 用户-唯一编号 - QuestionSn field.String // 题目-唯一编号 + Sn field.Int64 // 业务唯一编号 + UserSn field.Int64 // 用户-唯一编号 + QuestionSn field.Int64 // 题目-唯一编号 Answer field.String // 答案 IsCorrect field.Int32 // 是否正确 0 否 1 是 CreatedAt field.Time @@ -72,9 +72,9 @@ func (r record) As(alias string) *record { func (r *record) updateTableName(table string) *record { r.ALL = field.NewAsterisk(table) r.ID = field.NewUint64(table, "id") - r.Sn = field.NewString(table, "sn") - r.UserSn = field.NewString(table, "user_sn") - r.QuestionSn = field.NewString(table, "question_sn") + r.Sn = field.NewInt64(table, "sn") + r.UserSn = field.NewInt64(table, "user_sn") + r.QuestionSn = field.NewInt64(table, "question_sn") r.Answer = field.NewString(table, "answer") r.IsCorrect = field.NewInt32(table, "is_correct") r.CreatedAt = field.NewTime(table, "created_at") diff --git a/Tools/mysql_model/user_db/model/users.gen.go b/Tools/mysql_model/user_db/model/users.gen.go index e5905db..1d333cb 100644 --- a/Tools/mysql_model/user_db/model/users.gen.go +++ b/Tools/mysql_model/user_db/model/users.gen.go @@ -16,7 +16,7 @@ const TableNameUser = "users" // User mapped from table type User struct { ID uint64 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"` - Sn string `gorm:"column:sn;not null;comment:业务唯一编号" json:"sn"` // 业务唯一编号 + Sn int64 `gorm:"column:sn;not null;comment:业务唯一编号" json:"sn"` // 业务唯一编号 Name string `gorm:"column:name;not null" json:"name"` Phone string `gorm:"column:phone" json:"phone"` WxUnionID string `gorm:"column:wx_union_id;comment:微信用户唯一标识" json:"wx_union_id"` // 微信用户唯一标识 @@ -33,8 +33,8 @@ func (*User) TableName() string { // Auto sn func (m *User) BeforeCreate(_ *gorm.DB) error { - if m.Sn == "" { - m.Sn = utils.SnowflakeInstance().Generate().String() + if m.Sn == 0 { + m.Sn = utils.SnowflakeInstance().Generate().Int64() } return nil } diff --git a/Tools/mysql_model/user_db/query/users.gen.go b/Tools/mysql_model/user_db/query/users.gen.go index 3b0c61b..7559813 100644 --- a/Tools/mysql_model/user_db/query/users.gen.go +++ b/Tools/mysql_model/user_db/query/users.gen.go @@ -28,7 +28,7 @@ func newUser(db *gorm.DB, opts ...gen.DOOption) user { tableName := _user.userDo.TableName() _user.ALL = field.NewAsterisk(tableName) _user.ID = field.NewUint64(tableName, "id") - _user.Sn = field.NewString(tableName, "sn") + _user.Sn = field.NewInt64(tableName, "sn") _user.Name = field.NewString(tableName, "name") _user.Phone = field.NewString(tableName, "phone") _user.WxUnionID = field.NewString(tableName, "wx_union_id") @@ -47,7 +47,7 @@ type user struct { ALL field.Asterisk ID field.Uint64 - Sn field.String // 业务唯一编号 + Sn field.Int64 // 业务唯一编号 Name field.String Phone field.String WxUnionID field.String // 微信用户唯一标识 @@ -72,7 +72,7 @@ func (u user) As(alias string) *user { func (u *user) updateTableName(table string) *user { u.ALL = field.NewAsterisk(table) u.ID = field.NewUint64(table, "id") - u.Sn = field.NewString(table, "sn") + u.Sn = field.NewInt64(table, "sn") u.Name = field.NewString(table, "name") u.Phone = field.NewString(table, "phone") u.WxUnionID = field.NewString(table, "wx_union_id")