From d1760688c59f8c595ad035700271fda5fb608649 Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Thu, 18 May 2023 11:58:54 +0800 Subject: [PATCH] worldtask pb --- modules/worldtask/api_accept.go | 2 +- pb/worldtask_msg.pb.go | 50 ++++++++++++++++++++++++--------- 2 files changed, 37 insertions(+), 15 deletions(-) diff --git a/modules/worldtask/api_accept.go b/modules/worldtask/api_accept.go index bd70aa6c5..053d9a222 100644 --- a/modules/worldtask/api_accept.go +++ b/modules/worldtask/api_accept.go @@ -8,7 +8,7 @@ import ( func (a *apiComp) AcceptCheck(session comm.IUserSession, req *pb.WorldtaskAcceptReq) (code pb.ErrorCode) { if req.TaskId <= 0 || req.GroupId <= 0 { - code = *pb.ErrorCode_ReqParameterError.Enum() + code = pb.ErrorCode_ReqParameterError } return } diff --git a/pb/worldtask_msg.pb.go b/pb/worldtask_msg.pb.go index 32a21ea18..4dda209e5 100644 --- a/pb/worldtask_msg.pb.go +++ b/pb/worldtask_msg.pb.go @@ -637,6 +637,7 @@ type WorldtaskBattleStartResp struct { unknownFields protoimpl.UnknownFields Info *BattleInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info"` //战斗信息 + Code ErrorCode `protobuf:"varint,2,opt,name=Code,proto3,enum=ErrorCode" json:"Code"` } func (x *WorldtaskBattleStartResp) Reset() { @@ -678,6 +679,13 @@ func (x *WorldtaskBattleStartResp) GetInfo() *BattleInfo { return nil } +func (x *WorldtaskBattleStartResp) GetCode() ErrorCode { + if x != nil { + return x.Code + } + return ErrorCode_Success +} + // 战斗完成 type WorldtaskBattleFinishReq struct { state protoimpl.MessageState @@ -763,7 +771,8 @@ type WorldtaskBattleFinishResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - TaskId int32 `protobuf:"varint,1,opt,name=taskId,proto3" json:"taskId"` //任务ID + TaskId int32 `protobuf:"varint,1,opt,name=taskId,proto3" json:"taskId"` //任务ID + Code ErrorCode `protobuf:"varint,2,opt,name=code,proto3,enum=ErrorCode" json:"code"` } func (x *WorldtaskBattleFinishResp) Reset() { @@ -805,6 +814,13 @@ func (x *WorldtaskBattleFinishResp) GetTaskId() int32 { return 0 } +func (x *WorldtaskBattleFinishResp) GetCode() ErrorCode { + if x != nil { + return x.Code + } + return ErrorCode_Success +} + // 当前完成的任务列表推送 type WorldtaskFinishIdsPush struct { state protoimpl.MessageState @@ -1021,10 +1037,12 @@ var file_worldtask_worldtask_msg_proto_rawDesc = []byte{ 0x43, 0x6f, 0x6e, 0x66, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x06, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, - 0x22, 0x3b, 0x0a, 0x18, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, + 0x22, 0x5b, 0x0a, 0x18, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, - 0x74, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0xb1, 0x01, + 0x74, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x1e, 0x0a, + 0x04, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45, 0x72, + 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x22, 0xb1, 0x01, 0x0a, 0x18, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x72, 0x6f, @@ -1036,10 +1054,12 @@ var file_worldtask_worldtask_msg_proto_rawDesc = []byte{ 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, - 0x74, 0x22, 0x33, 0x0a, 0x19, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, + 0x74, 0x22, 0x53, 0x0a, 0x19, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, - 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x40, 0x0a, 0x16, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, + 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, + 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x40, 0x0a, 0x16, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x49, 0x64, 0x73, 0x50, 0x75, 0x73, 0x68, 0x12, 0x26, 0x0a, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x52, 0x08, @@ -1101,15 +1121,17 @@ var file_worldtask_worldtask_msg_proto_depIdxs = []int32{ 17, // 4: WorldtaskNexttaskPush.nextTask:type_name -> WorldtaskNexttaskPush.NextTaskEntry 20, // 5: WorldtaskBattleStartReq.battle:type_name -> BattleFormation 21, // 6: WorldtaskBattleStartResp.info:type_name -> BattleInfo - 22, // 7: WorldtaskBattleFinishReq.report:type_name -> BattleReport - 23, // 8: WorldtaskFinishIdsPush.taskList:type_name -> Worldtask - 19, // 9: WorldtaskChapterrewardResp.code:type_name -> ErrorCode - 23, // 10: WorldtaskNexttaskPush.NextTaskEntry.value:type_name -> Worldtask - 11, // [11:11] is the sub-list for method output_type - 11, // [11:11] is the sub-list for method input_type - 11, // [11:11] is the sub-list for extension type_name - 11, // [11:11] is the sub-list for extension extendee - 0, // [0:11] is the sub-list for field type_name + 19, // 7: WorldtaskBattleStartResp.Code:type_name -> ErrorCode + 22, // 8: WorldtaskBattleFinishReq.report:type_name -> BattleReport + 19, // 9: WorldtaskBattleFinishResp.code:type_name -> ErrorCode + 23, // 10: WorldtaskFinishIdsPush.taskList:type_name -> Worldtask + 19, // 11: WorldtaskChapterrewardResp.code:type_name -> ErrorCode + 23, // 12: WorldtaskNexttaskPush.NextTaskEntry.value:type_name -> Worldtask + 13, // [13:13] is the sub-list for method output_type + 13, // [13:13] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name } func init() { file_worldtask_worldtask_msg_proto_init() }