From 4bd57b56fde4c374b0bffa7d61e1f0ddb38ae879 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Thu, 16 Jun 2022 12:26:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E7=BB=9F=E4=B8=80=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=A0=81=E6=B6=88=E6=81=AF=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/robot/robot.go | 2 +- comm/core.go | 2 +- comm/usersession.go | 5 +- modules/gate_comp.go | 3 +- modules/gateway/agent.go | 12 +- modules/gateway/agentmgr_comp.go | 1 - modules/pack/api_getlist.go | 6 +- modules/pack/api_sellItem.go | 7 +- modules/pack/api_useItem.go | 7 +- modules/pack/cache_comp.go | 43 +++--- pb.bat | 1 + pb/comm.pb.go | 236 ++++++++++++++----------------- pb/errorcode.pb.go | 138 +++++++++--------- pb/friend_db.pb.go | 8 +- pb/friend_msg.pb.go | 74 +++++----- pb/mail_db.pb.go | 22 +-- pb/mail_msg.pb.go | 14 +- pb/notify_msg.pb.go | 167 ++++++++++++++++++++++ pb/pack_db.pb.go | 16 +-- pb/pack_msg.pb.go | 16 +-- pb/proto/comm.proto | 6 +- pb/proto/errorcode.proto | 23 +-- pb/proto/notify/notify_msg.proto | 10 ++ pb/user_db.pb.go | 30 ++-- pb/user_msg.pb.go | 14 +- services/comp_gateroute.go | 14 +- sys/cache/init_test.go | 9 -- 27 files changed, 521 insertions(+), 365 deletions(-) create mode 100644 pb/notify_msg.pb.go create mode 100644 pb/proto/notify/notify_msg.proto diff --git a/cmd/robot/robot.go b/cmd/robot/robot.go index fe6ce05ec..3f916765e 100644 --- a/cmd/robot/robot.go +++ b/cmd/robot/robot.go @@ -152,7 +152,7 @@ func (r *Robot) AccountRegister(account string) { //打印响应 func printReply(msg *pb.UserMessage, rsp interface{}) { - log.Printf("rsp [%s.%s] [%d] [%v]", msg.MainType, msg.SubType, msg.Code, rsp) + log.Printf("rsp [%s.%s] [%v]", msg.MainType, msg.SubType, rsp) } //方法参数跟踪 diff --git a/comm/core.go b/comm/core.go index 8c515c501..c805ee70b 100644 --- a/comm/core.go +++ b/comm/core.go @@ -82,7 +82,7 @@ type IUserSession interface { IsLogin() bool Bind(uid string, wokerId string) (err error) UnBind() (err error) - SendMsg(mainType, subType string, code pb.ErrorCode, msg proto.Message) (err error) + SendMsg(mainType, subType string, msg proto.Message) (err error) Close() (err error) ToString() string } diff --git a/comm/usersession.go b/comm/usersession.go index 25836cc53..ce18b1428 100644 --- a/comm/usersession.go +++ b/comm/usersession.go @@ -86,15 +86,14 @@ func (this *UserSession) UnBind() (err error) { } //向用户发送消息 -func (this *UserSession) SendMsg(mainType, subType string, code pb.ErrorCode, msg proto.Message) (err error) { +func (this *UserSession) SendMsg(mainType, subType string, msg proto.Message) (err error) { reply := &pb.RPCMessageReply{} data, _ := ptypes.MarshalAny(msg) - log.Debugf("SendMsg to SessionId:[%s] UserId:[%s] Code:%d Data: %v", this.UserId, code, msg) + log.Debugf("SendMsg to SessionId:[%s] UserId:[%s] Data: %v", this.UserId, msg) if err := this.service.RpcCall(context.Background(), fmt.Sprintf("%s/%s", Service_Gateway, this.GatewayServiceId), string(Rpc_GatewayAgentSendMsg), &pb.AgentSendMessageReq{ UserSessionId: this.SessionId, MainType: mainType, SubType: subType, - Code: code, Data: data, }, reply); err != nil { log.Errorf("SendMsg:%s UserSession:%s UserId:%s err:%v", mainType, this.SessionId, this.UserId, err) diff --git a/modules/gate_comp.go b/modules/gate_comp.go index 69526fafd..2f1939fff 100644 --- a/modules/gate_comp.go +++ b/modules/gate_comp.go @@ -96,7 +96,8 @@ func (this *MComp_GateComp) reflectionRouteHandle(method reflect.Method) { if mtype.NumOut() != 1 { return } - if returnType := mtype.Out(0); returnType != typeOfError { + returnCodeType := mtype.Out(0) + if returnCodeType != typeOfErrorCode { return } this.scomp.RegisterRoute(fmt.Sprintf("%s.%s", this.module.GetType(), strings.ToLower(mname)), reflect.ValueOf(this.comp), replyType, method) diff --git a/modules/gateway/agent.go b/modules/gateway/agent.go index ec8bdd84f..09863dfb2 100644 --- a/modules/gateway/agent.go +++ b/modules/gateway/agent.go @@ -11,6 +11,7 @@ import ( "go_dreamfactory/lego/sys/log" "go_dreamfactory/lego/utils/container/id" + "github.com/golang/protobuf/ptypes" "github.com/gorilla/websocket" "google.golang.org/protobuf/proto" ) @@ -154,7 +155,14 @@ func (this *Agent) messageDistribution(msg *pb.UserMessage) { Message: msg.Data, }, reply); err != nil { log.Errorf("agent:%s uId:%s MessageDistribution err:%v", this.sessionId, this.uId, err) - } else { - log.Debugf("agent:%s uId:%s MessageDistribution reply:%v", this.sessionId, this.uId, reply) + return + } + if reply.Code != pb.ErrorCode_Success { + data, _ := ptypes.MarshalAny(&pb.ErrorNotify{ReqMainType: msg.MainType, ReqSubType: msg.SubType, Code: reply.Code}) + this.WriteMsg(&pb.UserMessage{ + MainType: "notify", + SubType: "errornotify", + Data: data, + }) } } diff --git a/modules/gateway/agentmgr_comp.go b/modules/gateway/agentmgr_comp.go index 52dfcc523..1ca3046ee 100644 --- a/modules/gateway/agentmgr_comp.go +++ b/modules/gateway/agentmgr_comp.go @@ -61,7 +61,6 @@ func (this *AgentMgr_Comp) SendMsgToAgent(ctx context.Context, args *pb.AgentSen a.(IAgent).WriteMsg(&pb.UserMessage{ MainType: args.MainType, SubType: args.SubType, - Code: args.Code, Data: args.Data, }) } else { diff --git a/modules/pack/api_getlist.go b/modules/pack/api_getlist.go index 16ce99fec..1d6ec79fc 100644 --- a/modules/pack/api_getlist.go +++ b/modules/pack/api_getlist.go @@ -14,9 +14,9 @@ func (this *Api_Comp) Getlist_Check(session comm.IUserSession, req *pb.GetlistRe } ///获取用户道具 -func (this *Api_Comp) Getlist(session comm.IUserSession, agrs map[string]interface{}, req *pb.GetlistReq) (err error) { +func (this *Api_Comp) Getlist(session comm.IUserSession, agrs map[string]interface{}, req *pb.GetlistReq) (code pb.ErrorCode) { var ( - code pb.ErrorCode + err error items []*pb.DB_UserItemData nt int64 tempgrids []*pb.DB_UserItemData @@ -25,7 +25,7 @@ func (this *Api_Comp) Getlist(session comm.IUserSession, agrs map[string]interfa dels []string ) defer func() { - session.SendMsg(string(this.module.GetType()), GetlistResp, code, &pb.GetlistResp{Grids: grids}) + session.SendMsg(string(this.module.GetType()), GetlistResp, &pb.GetlistResp{Grids: grids}) if code == pb.ErrorCode_Success { go func() { //异步处理修改数据 this.module.cache_comp.Pack_UpdateUserPack(session.GetUserId(), modifys...) diff --git a/modules/pack/api_sellItem.go b/modules/pack/api_sellItem.go index b5ddf36ea..fda36e2ad 100644 --- a/modules/pack/api_sellItem.go +++ b/modules/pack/api_sellItem.go @@ -12,12 +12,9 @@ func (this *Api_Comp) SellItem_Check(session comm.IUserSession, req *pb.SellItem } //出售道具 -func (this *Api_Comp) SellItem(session comm.IUserSession, agrs map[string]interface{}, req *pb.SellItemReq) (err error) { - var ( - code pb.ErrorCode - ) +func (this *Api_Comp) SellItem(session comm.IUserSession, agrs map[string]interface{}, req *pb.SellItemReq) (code pb.ErrorCode) { defer func() { - session.SendMsg(string(this.module.GetType()), SellItemResp, code, &pb.SellItemResp{}) + session.SendMsg(string(this.module.GetType()), SellItemResp, &pb.SellItemResp{}) }() return } diff --git a/modules/pack/api_useItem.go b/modules/pack/api_useItem.go index ce6302207..5cdd12bcd 100644 --- a/modules/pack/api_useItem.go +++ b/modules/pack/api_useItem.go @@ -12,12 +12,9 @@ func (this *Api_Comp) Useitem_Check(session comm.IUserSession, req *pb.UseItemRe } //使用道具 -func (this *Api_Comp) Useitem(session comm.IUserSession, agrs map[string]interface{}, req *pb.UseItemReq) (err error) { - var ( - code pb.ErrorCode - ) +func (this *Api_Comp) Useitem(session comm.IUserSession, agrs map[string]interface{}, req *pb.UseItemReq) (code pb.ErrorCode) { defer func() { - session.SendMsg(string(this.module.GetType()), UseItemResp, code, &pb.UseItemResp{}) + session.SendMsg(string(this.module.GetType()), UseItemResp, &pb.UseItemResp{}) }() return diff --git a/modules/pack/cache_comp.go b/modules/pack/cache_comp.go index 6a60f2db3..f775b1080 100644 --- a/modules/pack/cache_comp.go +++ b/modules/pack/cache_comp.go @@ -7,7 +7,6 @@ import ( "go_dreamfactory/lego/sys/redis" "go_dreamfactory/modules" "go_dreamfactory/pb" - "reflect" "go.mongodb.org/mongo-driver/bson/primitive" ) @@ -27,27 +26,27 @@ func (this *Cache_Comp) Init(service core.IService, module core.IModule, comp co ///查询用户背包数据 func (this *Cache_Comp) Pack_QueryUserPack(uId string) (itmes []*pb.DB_UserItemData, err error) { - var ( - lists []interface{} - temp map[string]interface{} - ) - if lists, err = this.Redis.HGetAll(fmt.Sprintf(Redis_PackCache, uId), reflect.TypeOf(pb.DB_UserItemData{})); err == nil { - itmes = make([]*pb.DB_UserItemData, 0, len(lists)) - for i, v := range lists { - itmes[i] = v.(*pb.DB_UserItemData) - } - return - } else if err == redis.RedisNil { - if itmes, err = this.module.db_comp.Pack_QueryUserPack(uId); err == nil { - temp = make(map[string]interface{}) - for _, v := range itmes { - temp[v.GridId] = v - } - this.Redis.HMSet(fmt.Sprintf(Redis_PackCache, uId), temp) - } else if err == mgo.MongodbNil { - err = nil - } - } + // var ( + // lists []interface{} + // temp map[string]interface{} + // ) + // if lists, err = this.Redis.HGetAll(fmt.Sprintf(Redis_PackCache, uId), reflect.TypeOf(pb.DB_UserItemData{})); err == nil { + // itmes = make([]*pb.DB_UserItemData, 0, len(lists)) + // for i, v := range lists { + // itmes[i] = v.(*pb.DB_UserItemData) + // } + // return + // } else if err == redis.RedisNil { + // if itmes, err = this.module.db_comp.Pack_QueryUserPack(uId); err == nil { + // temp = make(map[string]interface{}) + // for _, v := range itmes { + // temp[v.GridId] = v + // } + // this.Redis.HMSet(fmt.Sprintf(Redis_PackCache, uId), temp) + // } else if err == mgo.MongodbNil { + // err = nil + // } + // } return } diff --git a/pb.bat b/pb.bat index 44f2fa5bc..59ab0d057 100644 --- a/pb.bat +++ b/pb.bat @@ -8,6 +8,7 @@ set SRC=%PROJECT_ROOT%\pb\proto set TAR=%PROJECT_ROOT%\pb protoc --proto_path=%SRC% --go_out=%TAR% --go_opt=paths=import %SRC%\*.proto +protoc --proto_path=%SRC% --go_out=%TAR% --go_opt=paths=import %SRC%\notify\*.proto protoc --proto_path=%SRC% --go_out=%TAR% --go_opt=paths=import %SRC%\user\*.proto protoc --proto_path=%SRC% --go_out=%TAR% --go_opt=paths=import %SRC%\friend\*.proto protoc --proto_path=%SRC% --go_out=%TAR% --go_opt=paths=import %SRC%\pack\*.proto diff --git a/pb/comm.pb.go b/pb/comm.pb.go index dbf65b8ff..86dee7bfe 100644 --- a/pb/comm.pb.go +++ b/pb/comm.pb.go @@ -27,10 +27,9 @@ type UserMessage struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - MainType string `protobuf:"bytes,1,opt,name=MainType,proto3" json:"MainType"` - SubType string `protobuf:"bytes,2,opt,name=SubType,proto3" json:"SubType"` - Code ErrorCode `protobuf:"varint,3,opt,name=Code,proto3,enum=ErrorCode" json:"Code"` - Data *anypb.Any `protobuf:"bytes,4,opt,name=data,proto3" json:"data"` + MainType string `protobuf:"bytes,1,opt,name=MainType,proto3" json:"MainType,omitempty"` //用户消息处理 模块名 例如:user 对应项目中 user的模块 + SubType string `protobuf:"bytes,2,opt,name=SubType,proto3" json:"SubType,omitempty"` //用户消息处理函数名 例如:login 对应项目中 user的模块中 api_login 的处理函数 + Data *anypb.Any `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` } func (x *UserMessage) Reset() { @@ -79,13 +78,6 @@ func (x *UserMessage) GetSubType() string { return "" } -func (x *UserMessage) GetCode() ErrorCode { - if x != nil { - return x.Code - } - return ErrorCode_Success -} - func (x *UserMessage) GetData() *anypb.Any { if x != nil { return x.Data @@ -99,12 +91,12 @@ type AgentMessage struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Ip string `protobuf:"bytes,1,opt,name=Ip,proto3" json:"Ip"` - UserSessionId string `protobuf:"bytes,2,opt,name=UserSessionId,proto3" json:"UserSessionId"` - UserId string `protobuf:"bytes,3,opt,name=UserId,proto3" json:"UserId"` - GatewayServiceId string `protobuf:"bytes,4,opt,name=GatewayServiceId,proto3" json:"GatewayServiceId"` - Method string `protobuf:"bytes,5,opt,name=Method,proto3" json:"Method"` - Message *anypb.Any `protobuf:"bytes,6,opt,name=Message,proto3" json:"Message"` + Ip string `protobuf:"bytes,1,opt,name=Ip,proto3" json:"Ip,omitempty"` + UserSessionId string `protobuf:"bytes,2,opt,name=UserSessionId,proto3" json:"UserSessionId,omitempty"` + UserId string `protobuf:"bytes,3,opt,name=UserId,proto3" json:"UserId,omitempty"` + GatewayServiceId string `protobuf:"bytes,4,opt,name=GatewayServiceId,proto3" json:"GatewayServiceId,omitempty"` + Method string `protobuf:"bytes,5,opt,name=Method,proto3" json:"Method,omitempty"` + Message *anypb.Any `protobuf:"bytes,6,opt,name=Message,proto3" json:"Message,omitempty"` } func (x *AgentMessage) Reset() { @@ -187,8 +179,8 @@ type RPCMessageReply struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Code ErrorCode `protobuf:"varint,1,opt,name=Code,proto3,enum=ErrorCode" json:"Code"` - Msg string `protobuf:"bytes,2,opt,name=Msg,proto3" json:"Msg"` + Code ErrorCode `protobuf:"varint,1,opt,name=Code,proto3,enum=ErrorCode" json:"Code,omitempty"` + Msg string `protobuf:"bytes,2,opt,name=Msg,proto3" json:"Msg,omitempty"` } func (x *RPCMessageReply) Reset() { @@ -243,9 +235,9 @@ type AgentBuildReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UserSessionId string `protobuf:"bytes,1,opt,name=UserSessionId,proto3" json:"UserSessionId"` - UserId string `protobuf:"bytes,2,opt,name=UserId,proto3" json:"UserId"` - WorkerId string `protobuf:"bytes,3,opt,name=WorkerId,proto3" json:"WorkerId"` + UserSessionId string `protobuf:"bytes,1,opt,name=UserSessionId,proto3" json:"UserSessionId,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=UserId,proto3" json:"UserId,omitempty"` + WorkerId string `protobuf:"bytes,3,opt,name=WorkerId,proto3" json:"WorkerId,omitempty"` } func (x *AgentBuildReq) Reset() { @@ -307,7 +299,7 @@ type AgentUnBuildReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UserSessionId string `protobuf:"bytes,1,opt,name=UserSessionId,proto3" json:"UserSessionId"` + UserSessionId string `protobuf:"bytes,1,opt,name=UserSessionId,proto3" json:"UserSessionId,omitempty"` } func (x *AgentUnBuildReq) Reset() { @@ -355,11 +347,10 @@ type AgentSendMessageReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UserSessionId string `protobuf:"bytes,1,opt,name=UserSessionId,proto3" json:"UserSessionId"` - MainType string `protobuf:"bytes,2,opt,name=MainType,proto3" json:"MainType"` - SubType string `protobuf:"bytes,3,opt,name=SubType,proto3" json:"SubType"` - Code ErrorCode `protobuf:"varint,4,opt,name=Code,proto3,enum=ErrorCode" json:"Code"` - Data *anypb.Any `protobuf:"bytes,5,opt,name=Data,proto3" json:"Data"` + UserSessionId string `protobuf:"bytes,1,opt,name=UserSessionId,proto3" json:"UserSessionId,omitempty"` + MainType string `protobuf:"bytes,2,opt,name=MainType,proto3" json:"MainType,omitempty"` + SubType string `protobuf:"bytes,3,opt,name=SubType,proto3" json:"SubType,omitempty"` + Data *anypb.Any `protobuf:"bytes,4,opt,name=Data,proto3" json:"Data,omitempty"` } func (x *AgentSendMessageReq) Reset() { @@ -415,13 +406,6 @@ func (x *AgentSendMessageReq) GetSubType() string { return "" } -func (x *AgentSendMessageReq) GetCode() ErrorCode { - if x != nil { - return x.Code - } - return ErrorCode_Success -} - func (x *AgentSendMessageReq) GetData() *anypb.Any { if x != nil { return x.Data @@ -435,10 +419,10 @@ type BatchMessageReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UserSessionIds []string `protobuf:"bytes,1,rep,name=UserSessionIds,proto3" json:"UserSessionIds"` - MainType string `protobuf:"bytes,2,opt,name=MainType,proto3" json:"MainType"` - SubType string `protobuf:"bytes,3,opt,name=SubType,proto3" json:"SubType"` - Data *anypb.Any `protobuf:"bytes,4,opt,name=Data,proto3" json:"Data"` + UserSessionIds []string `protobuf:"bytes,1,rep,name=UserSessionIds,proto3" json:"UserSessionIds,omitempty"` + MainType string `protobuf:"bytes,2,opt,name=MainType,proto3" json:"MainType,omitempty"` + SubType string `protobuf:"bytes,3,opt,name=SubType,proto3" json:"SubType,omitempty"` + Data *anypb.Any `protobuf:"bytes,4,opt,name=Data,proto3" json:"Data,omitempty"` } func (x *BatchMessageReq) Reset() { @@ -507,9 +491,9 @@ type BroadCastMessageReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - MainType string `protobuf:"bytes,1,opt,name=MainType,proto3" json:"MainType"` //服务名 - SubType string `protobuf:"bytes,2,opt,name=SubType,proto3" json:"SubType"` - Data *anypb.Any `protobuf:"bytes,3,opt,name=Data,proto3" json:"Data"` + MainType string `protobuf:"bytes,1,opt,name=MainType,proto3" json:"MainType,omitempty"` //服务名 + SubType string `protobuf:"bytes,2,opt,name=SubType,proto3" json:"SubType,omitempty"` + Data *anypb.Any `protobuf:"bytes,3,opt,name=Data,proto3" json:"Data,omitempty"` } func (x *BroadCastMessageReq) Reset() { @@ -571,7 +555,7 @@ type AgentCloseeReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UserSessionId string `protobuf:"bytes,1,opt,name=UserSessionId,proto3" json:"UserSessionId"` + UserSessionId string `protobuf:"bytes,1,opt,name=UserSessionId,proto3" json:"UserSessionId,omitempty"` } func (x *AgentCloseeReq) Reset() { @@ -619,77 +603,73 @@ var file_comm_proto_rawDesc = []byte{ 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, - 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8d, 0x01, 0x0a, 0x0b, 0x55, 0x73, 0x65, - 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x4d, 0x61, 0x69, 0x6e, - 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x4d, 0x61, 0x69, 0x6e, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x53, 0x75, 0x62, 0x54, 0x79, 0x70, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x53, 0x75, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, - 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45, - 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x28, - 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, - 0x6e, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xd0, 0x01, 0x0a, 0x0c, 0x41, 0x67, 0x65, - 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x70, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x70, 0x12, 0x24, 0x0a, 0x0d, 0x55, 0x73, 0x65, - 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, - 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x10, 0x47, 0x61, 0x74, 0x65, 0x77, - 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x10, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x2e, 0x0a, 0x07, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, - 0x6e, 0x79, 0x52, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x43, 0x0a, 0x0f, 0x52, - 0x50, 0x43, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1e, - 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45, - 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, - 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x4d, 0x73, 0x67, - 0x22, 0x69, 0x0a, 0x0d, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x65, - 0x71, 0x12, 0x24, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, - 0x1a, 0x0a, 0x08, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x49, 0x64, 0x22, 0x37, 0x0a, 0x0f, 0x41, - 0x67, 0x65, 0x6e, 0x74, 0x55, 0x6e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x71, 0x12, 0x24, - 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x49, 0x64, 0x22, 0xbb, 0x01, 0x0a, 0x13, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x53, 0x65, - 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x24, 0x0a, 0x0d, - 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x4d, 0x61, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x4d, 0x61, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, - 0x0a, 0x07, 0x53, 0x75, 0x62, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x53, 0x75, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, - 0x64, 0x65, 0x52, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x28, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x04, 0x44, 0x61, - 0x74, 0x61, 0x22, 0x99, 0x01, 0x0a, 0x0f, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, - 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x12, 0x1a, - 0x0a, 0x08, 0x4d, 0x61, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x4d, 0x61, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x53, 0x75, - 0x62, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x53, 0x75, 0x62, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x22, 0x75, - 0x0a, 0x13, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x43, 0x61, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x4d, 0x61, 0x69, 0x6e, 0x54, 0x79, 0x70, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x4d, 0x61, 0x69, 0x6e, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x18, 0x0a, 0x07, 0x53, 0x75, 0x62, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x53, 0x75, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x04, 0x44, - 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, - 0x04, 0x44, 0x61, 0x74, 0x61, 0x22, 0x36, 0x0a, 0x0e, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6c, - 0x6f, 0x73, 0x65, 0x65, 0x52, 0x65, 0x71, 0x12, 0x24, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x53, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, - 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x42, 0x06, 0x5a, - 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6d, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x4d, 0x61, 0x69, 0x6e, 0x54, + 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x4d, 0x61, 0x69, 0x6e, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x53, 0x75, 0x62, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x53, 0x75, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, + 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xd0, 0x01, 0x0a, 0x0c, 0x41, 0x67, 0x65, 0x6e, + 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x70, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x70, 0x12, 0x24, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, + 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0d, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x16, + 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x10, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, + 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x10, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x2e, 0x0a, 0x07, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, + 0x79, 0x52, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x43, 0x0a, 0x0f, 0x52, 0x50, + 0x43, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1e, 0x0a, + 0x04, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45, 0x72, + 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, + 0x03, 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x4d, 0x73, 0x67, 0x22, + 0x69, 0x0a, 0x0d, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x71, + 0x12, 0x24, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, + 0x0a, 0x08, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x49, 0x64, 0x22, 0x37, 0x0a, 0x0f, 0x41, 0x67, + 0x65, 0x6e, 0x74, 0x55, 0x6e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x71, 0x12, 0x24, 0x0a, + 0x0d, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x49, 0x64, 0x22, 0x9b, 0x01, 0x0a, 0x13, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x6e, + 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x24, 0x0a, 0x0d, 0x55, + 0x73, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, + 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x4d, 0x61, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x4d, 0x61, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x53, 0x75, 0x62, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x53, 0x75, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x04, 0x44, 0x61, 0x74, + 0x61, 0x22, 0x99, 0x01, 0x0a, 0x0f, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x55, + 0x73, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x12, 0x1a, 0x0a, + 0x08, 0x4d, 0x61, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x4d, 0x61, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x53, 0x75, 0x62, + 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x53, 0x75, 0x62, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x22, 0x75, 0x0a, + 0x13, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x43, 0x61, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x4d, 0x61, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x4d, 0x61, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x53, 0x75, 0x62, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x53, 0x75, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x04, 0x44, 0x61, + 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x04, + 0x44, 0x61, 0x74, 0x61, 0x22, 0x36, 0x0a, 0x0e, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6c, 0x6f, + 0x73, 0x65, 0x65, 0x52, 0x65, 0x71, 0x12, 0x24, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x55, + 0x73, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x42, 0x06, 0x5a, 0x04, + 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -715,23 +695,21 @@ var file_comm_proto_goTypes = []interface{}{ (*BatchMessageReq)(nil), // 6: BatchMessageReq (*BroadCastMessageReq)(nil), // 7: BroadCastMessageReq (*AgentCloseeReq)(nil), // 8: AgentCloseeReq - (ErrorCode)(0), // 9: ErrorCode - (*anypb.Any)(nil), // 10: google.protobuf.Any + (*anypb.Any)(nil), // 9: google.protobuf.Any + (ErrorCode)(0), // 10: ErrorCode } var file_comm_proto_depIdxs = []int32{ - 9, // 0: UserMessage.Code:type_name -> ErrorCode - 10, // 1: UserMessage.data:type_name -> google.protobuf.Any - 10, // 2: AgentMessage.Message:type_name -> google.protobuf.Any - 9, // 3: RPCMessageReply.Code:type_name -> ErrorCode - 9, // 4: AgentSendMessageReq.Code:type_name -> ErrorCode - 10, // 5: AgentSendMessageReq.Data:type_name -> google.protobuf.Any - 10, // 6: BatchMessageReq.Data:type_name -> google.protobuf.Any - 10, // 7: BroadCastMessageReq.Data:type_name -> google.protobuf.Any - 8, // [8:8] is the sub-list for method output_type - 8, // [8:8] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name + 9, // 0: UserMessage.data:type_name -> google.protobuf.Any + 9, // 1: AgentMessage.Message:type_name -> google.protobuf.Any + 10, // 2: RPCMessageReply.Code:type_name -> ErrorCode + 9, // 3: AgentSendMessageReq.Data:type_name -> google.protobuf.Any + 9, // 4: BatchMessageReq.Data:type_name -> google.protobuf.Any + 9, // 5: BroadCastMessageReq.Data:type_name -> google.protobuf.Any + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_comm_proto_init() } diff --git a/pb/errorcode.pb.go b/pb/errorcode.pb.go index 3a3ec720f..ab36879cd 100644 --- a/pb/errorcode.pb.go +++ b/pb/errorcode.pb.go @@ -25,17 +25,18 @@ type ErrorCode int32 const ( ErrorCode_Success ErrorCode = 0 //成功 ErrorCode_NoFindService ErrorCode = 10 //没有找到远程服务器 - ErrorCode_RpcFuncExecutionError ErrorCode = 11 //Rpc方法执行错误 - ErrorCode_CacheReadError ErrorCode = 12 //缓存读取失败 - ErrorCode_SqlExecutionError ErrorCode = 13 //数据库执行错误 - ErrorCode_ReqParameterError ErrorCode = 14 //请求参数错误 - ErrorCode_SignError ErrorCode = 15 //签名错误 - ErrorCode_InsufficientPermissions ErrorCode = 16 //权限不足 - ErrorCode_NoLogin ErrorCode = 17 //未登录 - ErrorCode_UserSessionNobeing ErrorCode = 18 //用户不存在 - ErrorCode_StateInvalid ErrorCode = 21 //无效状态 - ErrorCode_DBError ErrorCode = 22 // 数据库操作失败 - ErrorCode_SystemError ErrorCode = 23 // 通用错误 + ErrorCode_NoFindServiceHandleFunc ErrorCode = 11 //远程服务器未找到执行方法 + ErrorCode_RpcFuncExecutionError ErrorCode = 12 //Rpc方法执行错误 + ErrorCode_CacheReadError ErrorCode = 13 //缓存读取失败 + ErrorCode_SqlExecutionError ErrorCode = 14 //数据库执行错误 + ErrorCode_ReqParameterError ErrorCode = 15 //请求参数错误 + ErrorCode_SignError ErrorCode = 16 //签名错误 + ErrorCode_InsufficientPermissions ErrorCode = 17 //权限不足 + ErrorCode_NoLogin ErrorCode = 18 //未登录 + ErrorCode_UserSessionNobeing ErrorCode = 19 //用户不存在 + ErrorCode_StateInvalid ErrorCode = 20 //无效状态 + ErrorCode_DBError ErrorCode = 21 // 数据库操作失败 + ErrorCode_SystemError ErrorCode = 22 // 通用错误 //user ErrorCode_SecKeyInvalid ErrorCode = 1000 //秘钥无效 ErrorCode_SecKey ErrorCode = 1001 //秘钥格式错误 @@ -58,17 +59,18 @@ var ( ErrorCode_name = map[int32]string{ 0: "Success", 10: "NoFindService", - 11: "RpcFuncExecutionError", - 12: "CacheReadError", - 13: "SqlExecutionError", - 14: "ReqParameterError", - 15: "SignError", - 16: "InsufficientPermissions", - 17: "NoLogin", - 18: "UserSessionNobeing", - 21: "StateInvalid", - 22: "DBError", - 23: "SystemError", + 11: "NoFindServiceHandleFunc", + 12: "RpcFuncExecutionError", + 13: "CacheReadError", + 14: "SqlExecutionError", + 15: "ReqParameterError", + 16: "SignError", + 17: "InsufficientPermissions", + 18: "NoLogin", + 19: "UserSessionNobeing", + 20: "StateInvalid", + 21: "DBError", + 22: "SystemError", 1000: "SecKeyInvalid", 1001: "SecKey", 1100: "FriendNotSelf", @@ -86,17 +88,18 @@ var ( ErrorCode_value = map[string]int32{ "Success": 0, "NoFindService": 10, - "RpcFuncExecutionError": 11, - "CacheReadError": 12, - "SqlExecutionError": 13, - "ReqParameterError": 14, - "SignError": 15, - "InsufficientPermissions": 16, - "NoLogin": 17, - "UserSessionNobeing": 18, - "StateInvalid": 21, - "DBError": 22, - "SystemError": 23, + "NoFindServiceHandleFunc": 11, + "RpcFuncExecutionError": 12, + "CacheReadError": 13, + "SqlExecutionError": 14, + "ReqParameterError": 15, + "SignError": 16, + "InsufficientPermissions": 17, + "NoLogin": 18, + "UserSessionNobeing": 19, + "StateInvalid": 20, + "DBError": 21, + "SystemError": 22, "SecKeyInvalid": 1000, "SecKey": 1001, "FriendNotSelf": 1100, @@ -144,42 +147,43 @@ var File_errorcode_proto protoreflect.FileDescriptor var file_errorcode_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2a, 0x9d, 0x04, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, + 0x6f, 0x2a, 0xba, 0x04, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x10, 0x0a, 0x12, - 0x19, 0x0a, 0x15, 0x52, 0x70, 0x63, 0x46, 0x75, 0x6e, 0x63, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x0b, 0x12, 0x12, 0x0a, 0x0e, 0x43, 0x61, - 0x63, 0x68, 0x65, 0x52, 0x65, 0x61, 0x64, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x0c, 0x12, 0x15, - 0x0a, 0x11, 0x53, 0x71, 0x6c, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, - 0x72, 0x6f, 0x72, 0x10, 0x0d, 0x12, 0x15, 0x0a, 0x11, 0x52, 0x65, 0x71, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x65, 0x74, 0x65, 0x72, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x0e, 0x12, 0x0d, 0x0a, 0x09, - 0x53, 0x69, 0x67, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x0f, 0x12, 0x1b, 0x0a, 0x17, 0x49, - 0x6e, 0x73, 0x75, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x65, 0x72, 0x6d, 0x69, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x10, 0x10, 0x12, 0x0b, 0x0a, 0x07, 0x4e, 0x6f, 0x4c, 0x6f, - 0x67, 0x69, 0x6e, 0x10, 0x11, 0x12, 0x16, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x62, 0x65, 0x69, 0x6e, 0x67, 0x10, 0x12, 0x12, 0x10, 0x0a, - 0x0c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x10, 0x15, 0x12, - 0x0b, 0x0a, 0x07, 0x44, 0x42, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x16, 0x12, 0x0f, 0x0a, 0x0b, - 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x17, 0x12, 0x12, 0x0a, - 0x0d, 0x53, 0x65, 0x63, 0x4b, 0x65, 0x79, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x10, 0xe8, - 0x07, 0x12, 0x0b, 0x0a, 0x06, 0x53, 0x65, 0x63, 0x4b, 0x65, 0x79, 0x10, 0xe9, 0x07, 0x12, 0x12, - 0x0a, 0x0d, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4e, 0x6f, 0x74, 0x53, 0x65, 0x6c, 0x66, 0x10, - 0xcc, 0x08, 0x12, 0x12, 0x0a, 0x0d, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x6c, 0x66, - 0x4d, 0x61, 0x78, 0x10, 0xcd, 0x08, 0x12, 0x14, 0x0a, 0x0f, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, - 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4d, 0x61, 0x78, 0x10, 0xce, 0x08, 0x12, 0x15, 0x0a, 0x10, - 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x6c, 0x66, 0x4e, 0x6f, 0x44, 0x61, 0x74, 0x61, - 0x10, 0xcf, 0x08, 0x12, 0x17, 0x0a, 0x12, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x54, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x4e, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x10, 0xd0, 0x08, 0x12, 0x0e, 0x0a, 0x09, - 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x59, 0x65, 0x74, 0x10, 0xd1, 0x08, 0x12, 0x13, 0x0a, 0x0e, - 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x59, 0x65, 0x74, 0x10, 0xd2, - 0x08, 0x12, 0x17, 0x0a, 0x12, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x6c, 0x66, 0x42, - 0x6c, 0x61, 0x63, 0x6b, 0x59, 0x65, 0x74, 0x10, 0xd3, 0x08, 0x12, 0x19, 0x0a, 0x14, 0x46, 0x72, - 0x69, 0x65, 0x6e, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x59, - 0x65, 0x74, 0x10, 0xd4, 0x08, 0x12, 0x15, 0x0a, 0x10, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x41, - 0x70, 0x70, 0x6c, 0x79, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xd5, 0x08, 0x12, 0x13, 0x0a, 0x0e, - 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x4d, 0x61, 0x78, 0x10, 0xd6, - 0x08, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x1b, 0x0a, 0x17, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x46, 0x75, 0x6e, 0x63, 0x10, 0x0b, 0x12, 0x19, 0x0a, 0x15, + 0x52, 0x70, 0x63, 0x46, 0x75, 0x6e, 0x63, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x0c, 0x12, 0x12, 0x0a, 0x0e, 0x43, 0x61, 0x63, 0x68, 0x65, + 0x52, 0x65, 0x61, 0x64, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x0d, 0x12, 0x15, 0x0a, 0x11, 0x53, + 0x71, 0x6c, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, + 0x10, 0x0e, 0x12, 0x15, 0x0a, 0x11, 0x52, 0x65, 0x71, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, + 0x65, 0x72, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x0f, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x69, 0x67, + 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x10, 0x12, 0x1b, 0x0a, 0x17, 0x49, 0x6e, 0x73, 0x75, + 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x10, 0x11, 0x12, 0x0b, 0x0a, 0x07, 0x4e, 0x6f, 0x4c, 0x6f, 0x67, 0x69, 0x6e, + 0x10, 0x12, 0x12, 0x16, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x4e, 0x6f, 0x62, 0x65, 0x69, 0x6e, 0x67, 0x10, 0x13, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x10, 0x14, 0x12, 0x0b, 0x0a, 0x07, + 0x44, 0x42, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x15, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x79, 0x73, + 0x74, 0x65, 0x6d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x16, 0x12, 0x12, 0x0a, 0x0d, 0x53, 0x65, + 0x63, 0x4b, 0x65, 0x79, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x10, 0xe8, 0x07, 0x12, 0x0b, + 0x0a, 0x06, 0x53, 0x65, 0x63, 0x4b, 0x65, 0x79, 0x10, 0xe9, 0x07, 0x12, 0x12, 0x0a, 0x0d, 0x46, + 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4e, 0x6f, 0x74, 0x53, 0x65, 0x6c, 0x66, 0x10, 0xcc, 0x08, 0x12, + 0x12, 0x0a, 0x0d, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x6c, 0x66, 0x4d, 0x61, 0x78, + 0x10, 0xcd, 0x08, 0x12, 0x14, 0x0a, 0x0f, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x54, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x4d, 0x61, 0x78, 0x10, 0xce, 0x08, 0x12, 0x15, 0x0a, 0x10, 0x46, 0x72, 0x69, + 0x65, 0x6e, 0x64, 0x53, 0x65, 0x6c, 0x66, 0x4e, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x10, 0xcf, 0x08, + 0x12, 0x17, 0x0a, 0x12, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x4e, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x10, 0xd0, 0x08, 0x12, 0x0e, 0x0a, 0x09, 0x46, 0x72, 0x69, + 0x65, 0x6e, 0x64, 0x59, 0x65, 0x74, 0x10, 0xd1, 0x08, 0x12, 0x13, 0x0a, 0x0e, 0x46, 0x72, 0x69, + 0x65, 0x6e, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x59, 0x65, 0x74, 0x10, 0xd2, 0x08, 0x12, 0x17, + 0x0a, 0x12, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x6c, 0x66, 0x42, 0x6c, 0x61, 0x63, + 0x6b, 0x59, 0x65, 0x74, 0x10, 0xd3, 0x08, 0x12, 0x19, 0x0a, 0x14, 0x46, 0x72, 0x69, 0x65, 0x6e, + 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x59, 0x65, 0x74, 0x10, + 0xd4, 0x08, 0x12, 0x15, 0x0a, 0x10, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x41, 0x70, 0x70, 0x6c, + 0x79, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xd5, 0x08, 0x12, 0x13, 0x0a, 0x0e, 0x46, 0x72, 0x69, + 0x65, 0x6e, 0x64, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x4d, 0x61, 0x78, 0x10, 0xd6, 0x08, 0x42, 0x06, + 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pb/friend_db.pb.go b/pb/friend_db.pb.go index b2fc9e3b8..c5a69f3cd 100644 --- a/pb/friend_db.pb.go +++ b/pb/friend_db.pb.go @@ -25,10 +25,10 @@ type DB_FriendData struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId" bson:"_id"` // ID - FriendIds []string `protobuf:"bytes,2,rep,name=friendIds,proto3" json:"friendIds"` //好友ID - ApplyIds []string `protobuf:"bytes,3,rep,name=applyIds,proto3" json:"applyIds"` //申请用户ID - BlackIds []string `protobuf:"bytes,4,rep,name=blackIds,proto3" json:"blackIds"` //黑名单ID + UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty" bson:"_id"` // ID + FriendIds []string `protobuf:"bytes,2,rep,name=friendIds,proto3" json:"friendIds,omitempty"` //好友ID + ApplyIds []string `protobuf:"bytes,3,rep,name=applyIds,proto3" json:"applyIds,omitempty"` //申请用户ID + BlackIds []string `protobuf:"bytes,4,rep,name=blackIds,proto3" json:"blackIds,omitempty"` //黑名单ID } func (x *DB_FriendData) Reset() { diff --git a/pb/friend_msg.pb.go b/pb/friend_msg.pb.go index 4885e5909..725a918e5 100644 --- a/pb/friend_msg.pb.go +++ b/pb/friend_msg.pb.go @@ -25,13 +25,13 @@ type FriendBase struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId"` //ID - NickName string `protobuf:"bytes,2,opt,name=NickName,proto3" json:"NickName"` //昵称 - Level int32 `protobuf:"varint,3,opt,name=level,proto3" json:"level"` //等级 - Avatar int32 `protobuf:"varint,4,opt,name=avatar,proto3" json:"avatar"` //头像 - Strength int64 `protobuf:"varint,5,opt,name=strength,proto3" json:"strength"` //战力 - ServerId int32 `protobuf:"varint,6,opt,name=serverId,proto3" json:"serverId"` //服务编号 - OfflineTime int64 `protobuf:"varint,7,opt,name=offlineTime,proto3" json:"offlineTime"` //最近一次下线时间 0在线 + UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` //ID + NickName string `protobuf:"bytes,2,opt,name=NickName,proto3" json:"NickName,omitempty"` //昵称 + Level int32 `protobuf:"varint,3,opt,name=level,proto3" json:"level,omitempty"` //等级 + Avatar int32 `protobuf:"varint,4,opt,name=avatar,proto3" json:"avatar,omitempty"` //头像 + Strength int64 `protobuf:"varint,5,opt,name=strength,proto3" json:"strength,omitempty"` //战力 + ServerId int32 `protobuf:"varint,6,opt,name=serverId,proto3" json:"serverId,omitempty"` //服务编号 + OfflineTime int64 `protobuf:"varint,7,opt,name=offlineTime,proto3" json:"offlineTime,omitempty"` //最近一次下线时间 0在线 } func (x *FriendBase) Reset() { @@ -159,7 +159,7 @@ type FriendListRsp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - List []*FriendBase `protobuf:"bytes,1,rep,name=list,proto3" json:"list"` + List []*FriendBase `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` } func (x *FriendListRsp) Reset() { @@ -207,7 +207,7 @@ type FriendApplyReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId"` //好友ID + FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId,omitempty"` //好友ID } func (x *FriendApplyReq) Reset() { @@ -254,8 +254,8 @@ type FriendApplyRsp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId"` //用户ID - FriendId string `protobuf:"bytes,2,opt,name=friendId,proto3" json:"friendId"` //好友ID + UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` //用户ID + FriendId string `protobuf:"bytes,2,opt,name=friendId,proto3" json:"friendId,omitempty"` //好友ID } func (x *FriendApplyRsp) Reset() { @@ -310,7 +310,7 @@ type FriendDelReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId"` //好友ID + FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId,omitempty"` //好友ID } func (x *FriendDelReq) Reset() { @@ -357,8 +357,8 @@ type FriendDelRsp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId"` //好友ID - UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId"` //用户ID + FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId,omitempty"` //好友ID + UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"` //用户ID } func (x *FriendDelRsp) Reset() { @@ -413,7 +413,7 @@ type FriendAgreeReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - FriendIds []string `protobuf:"bytes,1,rep,name=friendIds,proto3" json:"friendIds"` //被同意的用户 + FriendIds []string `protobuf:"bytes,1,rep,name=friendIds,proto3" json:"friendIds,omitempty"` //被同意的用户 } func (x *FriendAgreeReq) Reset() { @@ -460,7 +460,7 @@ type FriendAgreeRsp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Num int32 `protobuf:"varint,1,opt,name=Num,proto3" json:"Num"` //操作的数量 + Num int32 `protobuf:"varint,1,opt,name=Num,proto3" json:"Num,omitempty"` //操作的数量 } func (x *FriendAgreeRsp) Reset() { @@ -508,7 +508,7 @@ type FriendRefuseReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - FriendIds []string `protobuf:"bytes,1,rep,name=friendIds,proto3" json:"friendIds"` //被拒绝的用户 + FriendIds []string `protobuf:"bytes,1,rep,name=friendIds,proto3" json:"friendIds,omitempty"` //被拒绝的用户 } func (x *FriendRefuseReq) Reset() { @@ -555,7 +555,7 @@ type FriendRefuseRsp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Num int32 `protobuf:"varint,1,opt,name=Num,proto3" json:"Num"` //操作的数量 + Num int32 `protobuf:"varint,1,opt,name=Num,proto3" json:"Num,omitempty"` //操作的数量 } func (x *FriendRefuseRsp) Reset() { @@ -641,7 +641,7 @@ type FriendApplyListRsp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - List []*FriendBase `protobuf:"bytes,1,rep,name=list,proto3" json:"list"` + List []*FriendBase `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` } func (x *FriendApplyListRsp) Reset() { @@ -689,7 +689,7 @@ type FriendSearchReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - NickName string `protobuf:"bytes,1,opt,name=nickName,proto3" json:"nickName"` //好友昵称 + NickName string `protobuf:"bytes,1,opt,name=nickName,proto3" json:"nickName,omitempty"` //好友昵称 } func (x *FriendSearchReq) Reset() { @@ -736,7 +736,7 @@ type FriendSearchRsp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Friend *FriendBase `protobuf:"bytes,1,opt,name=friend,proto3" json:"friend"` + Friend *FriendBase `protobuf:"bytes,1,opt,name=friend,proto3" json:"friend,omitempty"` } func (x *FriendSearchRsp) Reset() { @@ -822,7 +822,7 @@ type FriendBlackListRsp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Friends []*FriendBase `protobuf:"bytes,1,rep,name=friends,proto3" json:"friends"` + Friends []*FriendBase `protobuf:"bytes,1,rep,name=friends,proto3" json:"friends,omitempty"` } func (x *FriendBlackListRsp) Reset() { @@ -870,7 +870,7 @@ type FriendBlackAddReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId"` + FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId,omitempty"` } func (x *FriendBlackAddReq) Reset() { @@ -917,8 +917,8 @@ type FriendBlackAddRsp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId"` - UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId"` + FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"` } func (x *FriendBlackAddRsp) Reset() { @@ -973,7 +973,7 @@ type FriendDelBlackReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId"` + FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId,omitempty"` } func (x *FriendDelBlackReq) Reset() { @@ -1020,8 +1020,8 @@ type FriendDelBlackRsp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId"` - UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId"` + FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"` } func (x *FriendDelBlackRsp) Reset() { @@ -1076,7 +1076,7 @@ type FriendReceiveReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId"` + FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId,omitempty"` } func (x *FriendReceiveReq) Reset() { @@ -1123,8 +1123,8 @@ type FriendReceiveRsp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId"` - UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId"` + FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"` } func (x *FriendReceiveRsp) Reset() { @@ -1179,7 +1179,7 @@ type FriendGiveReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId"` + FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId,omitempty"` } func (x *FriendGiveReq) Reset() { @@ -1226,8 +1226,8 @@ type FriendGiveRsp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId"` - UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId"` + FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"` } func (x *FriendGiveRsp) Reset() { @@ -1282,7 +1282,7 @@ type FriendTotalReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId"` + FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId,omitempty"` } func (x *FriendTotalReq) Reset() { @@ -1329,8 +1329,8 @@ type FriendTotalRsp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId"` - Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total"` //好友数量 + FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId,omitempty"` + Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //好友数量 } func (x *FriendTotalRsp) Reset() { diff --git a/pb/mail_db.pb.go b/pb/mail_db.pb.go index 29cd81e91..c4a422a41 100644 --- a/pb/mail_db.pb.go +++ b/pb/mail_db.pb.go @@ -25,8 +25,8 @@ type MailAttachment struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ItemId uint32 `protobuf:"varint,1,opt,name=ItemId,proto3" json:"ItemId"` // 道具iD - ItemCount uint32 `protobuf:"varint,2,opt,name=ItemCount,proto3" json:"ItemCount"` // 数量 + ItemId uint32 `protobuf:"varint,1,opt,name=ItemId,proto3" json:"ItemId,omitempty"` // 道具iD + ItemCount uint32 `protobuf:"varint,2,opt,name=ItemCount,proto3" json:"ItemCount,omitempty"` // 数量 } func (x *MailAttachment) Reset() { @@ -80,15 +80,15 @@ type DB_MailData struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ObjId string `protobuf:"bytes,1,opt,name=ObjId,proto3" json:"ObjId" bson:"_id"` // ID - UserId string `protobuf:"bytes,2,opt,name=UserId,proto3" json:"UserId"` - Title string `protobuf:"bytes,3,opt,name=Title,proto3" json:"Title"` // 邮件标题 - Contex string `protobuf:"bytes,4,opt,name=Contex,proto3" json:"Contex"` // 邮件内容 - CreateTime uint64 `protobuf:"varint,5,opt,name=CreateTime,proto3" json:"CreateTime"` // 发送时间 - DueTime uint64 `protobuf:"varint,6,opt,name=DueTime,proto3" json:"DueTime"` // 过期时间 - Check bool `protobuf:"varint,7,opt,name=Check,proto3" json:"Check"` // 是否查看 - Reward bool `protobuf:"varint,8,opt,name=Reward,proto3" json:"Reward"` // 附件领取状态 - Items []*MailAttachment `protobuf:"bytes,9,rep,name=Items,proto3" json:"Items"` // 附件 + ObjId string `protobuf:"bytes,1,opt,name=ObjId,proto3" json:"ObjId,omitempty" bson:"_id"` // ID + UserId string `protobuf:"bytes,2,opt,name=UserId,proto3" json:"UserId,omitempty"` + Title string `protobuf:"bytes,3,opt,name=Title,proto3" json:"Title,omitempty"` // 邮件标题 + Contex string `protobuf:"bytes,4,opt,name=Contex,proto3" json:"Contex,omitempty"` // 邮件内容 + CreateTime uint64 `protobuf:"varint,5,opt,name=CreateTime,proto3" json:"CreateTime,omitempty"` // 发送时间 + DueTime uint64 `protobuf:"varint,6,opt,name=DueTime,proto3" json:"DueTime,omitempty"` // 过期时间 + Check bool `protobuf:"varint,7,opt,name=Check,proto3" json:"Check,omitempty"` // 是否查看 + Reward bool `protobuf:"varint,8,opt,name=Reward,proto3" json:"Reward,omitempty"` // 附件领取状态 + Items []*MailAttachment `protobuf:"bytes,9,rep,name=Items,proto3" json:"Items,omitempty"` // 附件 } func (x *DB_MailData) Reset() { diff --git a/pb/mail_msg.pb.go b/pb/mail_msg.pb.go index ba6149350..388595803 100644 --- a/pb/mail_msg.pb.go +++ b/pb/mail_msg.pb.go @@ -64,7 +64,7 @@ type QueryUserMailResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Mails []*DB_MailData `protobuf:"bytes,1,rep,name=Mails,proto3" json:"Mails"` + Mails []*DB_MailData `protobuf:"bytes,1,rep,name=Mails,proto3" json:"Mails,omitempty"` } func (x *QueryUserMailResp) Reset() { @@ -112,7 +112,7 @@ type ReadUserMailReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ObjID string `protobuf:"bytes,1,opt,name=ObjID,proto3" json:"ObjID"` + ObjID string `protobuf:"bytes,1,opt,name=ObjID,proto3" json:"ObjID,omitempty"` } func (x *ReadUserMailReq) Reset() { @@ -159,7 +159,7 @@ type ReadUserMailResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Mail *DB_MailData `protobuf:"bytes,1,opt,name=Mail,proto3" json:"Mail"` + Mail *DB_MailData `protobuf:"bytes,1,opt,name=Mail,proto3" json:"Mail,omitempty"` } func (x *ReadUserMailResp) Reset() { @@ -207,7 +207,7 @@ type GetUserMailAttachmentReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ObjID string `protobuf:"bytes,1,opt,name=ObjID,proto3" json:"ObjID"` + ObjID string `protobuf:"bytes,1,opt,name=ObjID,proto3" json:"ObjID,omitempty"` } func (x *GetUserMailAttachmentReq) Reset() { @@ -254,7 +254,7 @@ type GetUserMailAttachmentResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Mail *DB_MailData `protobuf:"bytes,1,opt,name=Mail,proto3" json:"Mail"` + Mail *DB_MailData `protobuf:"bytes,1,opt,name=Mail,proto3" json:"Mail,omitempty"` } func (x *GetUserMailAttachmentResp) Reset() { @@ -302,7 +302,7 @@ type DelUserMailReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ObjID string `protobuf:"bytes,1,opt,name=ObjID,proto3" json:"ObjID"` + ObjID string `protobuf:"bytes,1,opt,name=ObjID,proto3" json:"ObjID,omitempty"` } func (x *DelUserMailReq) Reset() { @@ -349,7 +349,7 @@ type DelUserMailResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Mail []*DB_MailData `protobuf:"bytes,1,rep,name=Mail,proto3" json:"Mail"` + Mail []*DB_MailData `protobuf:"bytes,1,rep,name=Mail,proto3" json:"Mail,omitempty"` } func (x *DelUserMailResp) Reset() { diff --git a/pb/notify_msg.pb.go b/pb/notify_msg.pb.go new file mode 100644 index 000000000..f7b7d51c4 --- /dev/null +++ b/pb/notify_msg.pb.go @@ -0,0 +1,167 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc v3.20.0 +// source: notify/notify_msg.proto + +package pb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +//统一错误码返回 +type ErrorNotify struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ReqMainType string `protobuf:"bytes,1,opt,name=ReqMainType,proto3" json:"ReqMainType,omitempty"` // 请求协议模块 模块名 例如:user 对应项目中 user的模块 + ReqSubType string `protobuf:"bytes,2,opt,name=ReqSubType,proto3" json:"ReqSubType,omitempty"` // 请求协议函数 例如:login 对应项目中 user的模块中 api_login 的处理函数 + Code ErrorCode `protobuf:"varint,3,opt,name=Code,proto3,enum=ErrorCode" json:"Code,omitempty"` // 执行返回错误码 对应 errorcode.proto 枚举 +} + +func (x *ErrorNotify) Reset() { + *x = ErrorNotify{} + if protoimpl.UnsafeEnabled { + mi := &file_notify_notify_msg_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ErrorNotify) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ErrorNotify) ProtoMessage() {} + +func (x *ErrorNotify) ProtoReflect() protoreflect.Message { + mi := &file_notify_notify_msg_proto_msgTypes[0] + 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 ErrorNotify.ProtoReflect.Descriptor instead. +func (*ErrorNotify) Descriptor() ([]byte, []int) { + return file_notify_notify_msg_proto_rawDescGZIP(), []int{0} +} + +func (x *ErrorNotify) GetReqMainType() string { + if x != nil { + return x.ReqMainType + } + return "" +} + +func (x *ErrorNotify) GetReqSubType() string { + if x != nil { + return x.ReqSubType + } + return "" +} + +func (x *ErrorNotify) GetCode() ErrorCode { + if x != nil { + return x.Code + } + return ErrorCode_Success +} + +var File_notify_notify_msg_proto protoreflect.FileDescriptor + +var file_notify_notify_msg_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x2f, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x5f, + 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6f, 0x0a, 0x0b, 0x45, 0x72, + 0x72, 0x6f, 0x72, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x52, 0x65, 0x71, + 0x4d, 0x61, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x52, 0x65, 0x71, 0x4d, 0x61, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x52, + 0x65, 0x71, 0x53, 0x75, 0x62, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x52, 0x65, 0x71, 0x53, 0x75, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x04, 0x43, + 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, + 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_notify_notify_msg_proto_rawDescOnce sync.Once + file_notify_notify_msg_proto_rawDescData = file_notify_notify_msg_proto_rawDesc +) + +func file_notify_notify_msg_proto_rawDescGZIP() []byte { + file_notify_notify_msg_proto_rawDescOnce.Do(func() { + file_notify_notify_msg_proto_rawDescData = protoimpl.X.CompressGZIP(file_notify_notify_msg_proto_rawDescData) + }) + return file_notify_notify_msg_proto_rawDescData +} + +var file_notify_notify_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_notify_notify_msg_proto_goTypes = []interface{}{ + (*ErrorNotify)(nil), // 0: ErrorNotify + (ErrorCode)(0), // 1: ErrorCode +} +var file_notify_notify_msg_proto_depIdxs = []int32{ + 1, // 0: ErrorNotify.Code:type_name -> ErrorCode + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_notify_notify_msg_proto_init() } +func file_notify_notify_msg_proto_init() { + if File_notify_notify_msg_proto != nil { + return + } + file_errorcode_proto_init() + if !protoimpl.UnsafeEnabled { + file_notify_notify_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ErrorNotify); 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{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_notify_notify_msg_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_notify_notify_msg_proto_goTypes, + DependencyIndexes: file_notify_notify_msg_proto_depIdxs, + MessageInfos: file_notify_notify_msg_proto_msgTypes, + }.Build() + File_notify_notify_msg_proto = out.File + file_notify_notify_msg_proto_rawDesc = nil + file_notify_notify_msg_proto_goTypes = nil + file_notify_notify_msg_proto_depIdxs = nil +} diff --git a/pb/pack_db.pb.go b/pb/pack_db.pb.go index b353fea0f..235c28ad7 100644 --- a/pb/pack_db.pb.go +++ b/pb/pack_db.pb.go @@ -26,14 +26,14 @@ type DB_UserItemData struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - GridId string `protobuf:"bytes,1,opt,name=GridId,proto3" json:"GridId"` //背包格子Id - UId string `protobuf:"bytes,2,opt,name=UId,proto3" json:"UId"` //用户id - IsEmpty bool `protobuf:"varint,3,opt,name=IsEmpty,proto3" json:"IsEmpty"` //是否是空格子 - ItemId int32 `protobuf:"varint,4,opt,name=ItemId,proto3" json:"ItemId"` //存放物品的Id - Amount uint32 `protobuf:"varint,5,opt,name=Amount,proto3" json:"Amount"` //存放物品的数量 - CTime int64 `protobuf:"varint,6,opt,name=CTime,proto3" json:"CTime"` //物品获取时间 - ETime int64 `protobuf:"varint,7,opt,name=ETime,proto3" json:"ETime"` //物品过期时间 - IsNewItem bool `protobuf:"varint,8,opt,name=IsNewItem,proto3" json:"IsNewItem"` //是否是新的 + GridId string `protobuf:"bytes,1,opt,name=GridId,proto3" json:"GridId,omitempty"` //背包格子Id + UId string `protobuf:"bytes,2,opt,name=UId,proto3" json:"UId,omitempty"` //用户id + IsEmpty bool `protobuf:"varint,3,opt,name=IsEmpty,proto3" json:"IsEmpty,omitempty"` //是否是空格子 + ItemId int32 `protobuf:"varint,4,opt,name=ItemId,proto3" json:"ItemId,omitempty"` //存放物品的Id + Amount uint32 `protobuf:"varint,5,opt,name=Amount,proto3" json:"Amount,omitempty"` //存放物品的数量 + CTime int64 `protobuf:"varint,6,opt,name=CTime,proto3" json:"CTime,omitempty"` //物品获取时间 + ETime int64 `protobuf:"varint,7,opt,name=ETime,proto3" json:"ETime,omitempty"` //物品过期时间 + IsNewItem bool `protobuf:"varint,8,opt,name=IsNewItem,proto3" json:"IsNewItem,omitempty"` //是否是新的 } func (x *DB_UserItemData) Reset() { diff --git a/pb/pack_msg.pb.go b/pb/pack_msg.pb.go index 140b19eeb..ca8145d3d 100644 --- a/pb/pack_msg.pb.go +++ b/pb/pack_msg.pb.go @@ -26,7 +26,7 @@ type GetlistReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - IType int32 `protobuf:"varint,1,opt,name=IType,proto3" json:"IType"` //道具类型 + IType int32 `protobuf:"varint,1,opt,name=IType,proto3" json:"IType,omitempty"` //道具类型 } func (x *GetlistReq) Reset() { @@ -74,7 +74,7 @@ type GetlistResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Grids []*DB_UserItemData `protobuf:"bytes,1,rep,name=Grids,proto3" json:"Grids"` //用户背包列表 + Grids []*DB_UserItemData `protobuf:"bytes,1,rep,name=Grids,proto3" json:"Grids,omitempty"` //用户背包列表 } func (x *GetlistResp) Reset() { @@ -122,9 +122,9 @@ type UseItemReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - GridId int32 `protobuf:"varint,1,opt,name=GridId,proto3" json:"GridId"` //格子Id - ItemId int32 `protobuf:"varint,2,opt,name=ItemId,proto3" json:"ItemId"` //物品Id - Amount uint32 `protobuf:"varint,3,opt,name=Amount,proto3" json:"Amount"` //使用数量 + GridId int32 `protobuf:"varint,1,opt,name=GridId,proto3" json:"GridId,omitempty"` //格子Id + ItemId int32 `protobuf:"varint,2,opt,name=ItemId,proto3" json:"ItemId,omitempty"` //物品Id + Amount uint32 `protobuf:"varint,3,opt,name=Amount,proto3" json:"Amount,omitempty"` //使用数量 } func (x *UseItemReq) Reset() { @@ -225,9 +225,9 @@ type SellItemReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - GridId int32 `protobuf:"varint,1,opt,name=GridId,proto3" json:"GridId"` //格子Id - ItemId int32 `protobuf:"varint,2,opt,name=ItemId,proto3" json:"ItemId"` //物品Id - Amount uint32 `protobuf:"varint,3,opt,name=Amount,proto3" json:"Amount"` //使用数量 + GridId int32 `protobuf:"varint,1,opt,name=GridId,proto3" json:"GridId,omitempty"` //格子Id + ItemId int32 `protobuf:"varint,2,opt,name=ItemId,proto3" json:"ItemId,omitempty"` //物品Id + Amount uint32 `protobuf:"varint,3,opt,name=Amount,proto3" json:"Amount,omitempty"` //使用数量 } func (x *SellItemReq) Reset() { diff --git a/pb/proto/comm.proto b/pb/proto/comm.proto index bccd3d3cc..ea12f7074 100644 --- a/pb/proto/comm.proto +++ b/pb/proto/comm.proto @@ -7,8 +7,7 @@ import "google/protobuf/any.proto"; message UserMessage { string MainType =1; //用户消息处理 模块名 例如:user 对应项目中 user的模块 string SubType = 2; //用户消息处理函数名 例如:login 对应项目中 user的模块中 api_login 的处理函数 - ErrorCode Code = 3; //统一消息 - google.protobuf.Any data = 4; + google.protobuf.Any data = 3; } //代理用户转发消息结构 @@ -43,8 +42,7 @@ message AgentSendMessageReq { string UserSessionId = 1; string MainType = 2; string SubType = 3; - ErrorCode Code = 4; - google.protobuf.Any Data = 5; + google.protobuf.Any Data = 4; } //发送批量消息 diff --git a/pb/proto/errorcode.proto b/pb/proto/errorcode.proto index d095cd53d..406585345 100644 --- a/pb/proto/errorcode.proto +++ b/pb/proto/errorcode.proto @@ -5,17 +5,18 @@ option go_package = ".;pb"; enum ErrorCode { Success = 0; //成功 NoFindService = 10; //没有找到远程服务器 - RpcFuncExecutionError = 11; //Rpc方法执行错误 - CacheReadError = 12; //缓存读取失败 - SqlExecutionError = 13; //数据库执行错误 - ReqParameterError = 14; //请求参数错误 - SignError = 15; //签名错误 - InsufficientPermissions = 16; //权限不足 - NoLogin = 17; //未登录 - UserSessionNobeing = 18; //用户不存在 - StateInvalid = 21; //无效状态 - DBError = 22; // 数据库操作失败 - SystemError = 23; // 通用错误 + NoFindServiceHandleFunc = 11; //远程服务器未找到执行方法 + RpcFuncExecutionError = 12; //Rpc方法执行错误 + CacheReadError = 13; //缓存读取失败 + SqlExecutionError = 14; //数据库执行错误 + ReqParameterError = 15; //请求参数错误 + SignError = 16; //签名错误 + InsufficientPermissions = 17; //权限不足 + NoLogin = 18; //未登录 + UserSessionNobeing = 19; //用户不存在 + StateInvalid = 20; //无效状态 + DBError = 21; // 数据库操作失败 + SystemError = 22; // 通用错误 //user SecKeyInvalid = 1000; //秘钥无效 diff --git a/pb/proto/notify/notify_msg.proto b/pb/proto/notify/notify_msg.proto new file mode 100644 index 000000000..90f83e6e8 --- /dev/null +++ b/pb/proto/notify/notify_msg.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; +option go_package = ".;pb"; +import "errorcode.proto"; + +//统一错误码返回 +message ErrorNotify { + string ReqMainType =1; // 请求协议模块 模块名 例如:user 对应项目中 user的模块 + string ReqSubType = 2; // 请求协议函数 例如:login 对应项目中 user的模块中 api_login 的处理函数 + ErrorCode Code = 3; // 执行返回错误码 对应 errorcode.proto 枚举 +} diff --git a/pb/user_db.pb.go b/pb/user_db.pb.go index 4d34f828b..09013d493 100644 --- a/pb/user_db.pb.go +++ b/pb/user_db.pb.go @@ -25,9 +25,9 @@ type Cache_UserData struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid"` - SessionId string `protobuf:"bytes,2,opt,name=SessionId,proto3" json:"SessionId"` - GatewayServiceId string `protobuf:"bytes,3,opt,name=GatewayServiceId,proto3" json:"GatewayServiceId"` // DB_UserData UserData = 4; + Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` + SessionId string `protobuf:"bytes,2,opt,name=SessionId,proto3" json:"SessionId,omitempty"` + GatewayServiceId string `protobuf:"bytes,3,opt,name=GatewayServiceId,proto3" json:"GatewayServiceId,omitempty"` // DB_UserData UserData = 4; } func (x *Cache_UserData) Reset() { @@ -88,18 +88,18 @@ type DB_UserData struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` // ID - Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid"` - Uuid string `protobuf:"bytes,3,opt,name=uuid,proto3" json:"uuid"` //玩家唯一uuid - Binduid string `protobuf:"bytes,4,opt,name=binduid,proto3" json:"binduid"` //玩家账号 - Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name"` //玩家名 - Sid int32 `protobuf:"varint,6,opt,name=sid,proto3" json:"sid"` //区服id - Createip string `protobuf:"bytes,7,opt,name=createip,proto3" json:"createip"` //创建账号时的ip - Lastloginip string `protobuf:"bytes,8,opt,name=lastloginip,proto3" json:"lastloginip"` //最后一次登录时的ip - Ctime int64 `protobuf:"varint,9,opt,name=ctime,proto3" json:"ctime"` //玩家创号时间戳 - Logintime int64 `protobuf:"varint,10,opt,name=logintime,proto3" json:"logintime"` //最后一次登录时间 - FriendPoint int32 `protobuf:"varint,11,opt,name=FriendPoint,proto3" json:"FriendPoint"` //友情点 - Avatar int32 `protobuf:"varint,12,opt,name=avatar,proto3" json:"avatar"` //头像 + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty" bson:"_id"` // ID + Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` + Uuid string `protobuf:"bytes,3,opt,name=uuid,proto3" json:"uuid,omitempty"` //玩家唯一uuid + Binduid string `protobuf:"bytes,4,opt,name=binduid,proto3" json:"binduid,omitempty"` //玩家账号 + Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` //玩家名 + Sid int32 `protobuf:"varint,6,opt,name=sid,proto3" json:"sid,omitempty"` //区服id + Createip string `protobuf:"bytes,7,opt,name=createip,proto3" json:"createip,omitempty"` //创建账号时的ip + Lastloginip string `protobuf:"bytes,8,opt,name=lastloginip,proto3" json:"lastloginip,omitempty"` //最后一次登录时的ip + Ctime int64 `protobuf:"varint,9,opt,name=ctime,proto3" json:"ctime,omitempty"` //玩家创号时间戳 + Logintime int64 `protobuf:"varint,10,opt,name=logintime,proto3" json:"logintime,omitempty"` //最后一次登录时间 + FriendPoint int32 `protobuf:"varint,11,opt,name=FriendPoint,proto3" json:"FriendPoint,omitempty"` //友情点 + Avatar int32 `protobuf:"varint,12,opt,name=avatar,proto3" json:"avatar,omitempty"` //头像 } func (x *DB_UserData) Reset() { diff --git a/pb/user_msg.pb.go b/pb/user_msg.pb.go index 3f6680d83..1ee7f9132 100644 --- a/pb/user_msg.pb.go +++ b/pb/user_msg.pb.go @@ -26,7 +26,7 @@ type UserLoginReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Sec string `protobuf:"bytes,1,opt,name=sec,proto3" json:"sec"` //密文 + Sec string `protobuf:"bytes,1,opt,name=sec,proto3" json:"sec,omitempty"` //密文 } func (x *UserLoginReq) Reset() { @@ -73,7 +73,7 @@ type UserLoginResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Data *Cache_UserData `protobuf:"bytes,1,opt,name=data,proto3" json:"data"` + Data *Cache_UserData `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` } func (x *UserLoginResp) Reset() { @@ -120,7 +120,7 @@ type UserRegisterReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account"` + Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` } func (x *UserRegisterReq) Reset() { @@ -167,8 +167,8 @@ type UserRegisterRsp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Code ErrorCode `protobuf:"varint,1,opt,name=Code,proto3,enum=ErrorCode" json:"Code"` - Account string `protobuf:"bytes,2,opt,name=account,proto3" json:"account"` + Code ErrorCode `protobuf:"varint,1,opt,name=Code,proto3,enum=ErrorCode" json:"Code,omitempty"` + Account string `protobuf:"bytes,2,opt,name=account,proto3" json:"account,omitempty"` } func (x *UserRegisterRsp) Reset() { @@ -222,7 +222,7 @@ type UserLoadRsp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Data *Cache_UserData `protobuf:"bytes,1,opt,name=data,proto3" json:"data"` + Data *Cache_UserData `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` } func (x *UserLoadRsp) Reset() { @@ -270,7 +270,7 @@ type UserCreateReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - NickName string `protobuf:"bytes,1,opt,name=NickName,proto3" json:"NickName"` //昵称 + NickName string `protobuf:"bytes,1,opt,name=NickName,proto3" json:"NickName,omitempty"` //昵称 } func (x *UserCreateReq) Reset() { diff --git a/services/comp_gateroute.go b/services/comp_gateroute.go index 1d61b7602..b9043ff35 100644 --- a/services/comp_gateroute.go +++ b/services/comp_gateroute.go @@ -128,16 +128,22 @@ func (this *SComp_GateRouteComp) ReceiveMsg(ctx context.Context, args *pb.AgentM } returnValues := msgcheck.fn.Func.Call([]reflect.Value{msgcheck.rcvr, reflect.ValueOf(session), reflect.ValueOf(msg)}) // The return value for the method is an error. - code := returnValues[1].Int() - if pb.ErrorCode(code) != pb.ErrorCode_Success { + code := pb.ErrorCode(returnValues[1].Int()) + if code != pb.ErrorCode_Success { log.Errorf("HandleUserMsg:%s msg:%v code:%d", args.Method, msg, code) + reply.Code = code return nil } result := returnValues[0].Interface().(map[string]interface{}) - msghandle.fn.Func.Call([]reflect.Value{msghandle.rcvr, reflect.ValueOf(session), reflect.ValueOf(result), reflect.ValueOf(msg)}) + returnValues = msghandle.fn.Func.Call([]reflect.Value{msghandle.rcvr, reflect.ValueOf(session), reflect.ValueOf(result), reflect.ValueOf(msg)}) + code = pb.ErrorCode(returnValues[1].Int()) + if code != pb.ErrorCode_Success { + log.Errorf("HandleUserMsg:%s msg:%v code:%d", args.Method, msg, code) + reply.Code = code + return nil + } } else { reply.Code = pb.ErrorCode_ReqParameterError - // reply.Msg = pb.GetErrorCodeMsg(pb.ErrorCode_ReqParameterError) } return nil } diff --git a/sys/cache/init_test.go b/sys/cache/init_test.go index 93a2a8eb9..aebde276a 100644 --- a/sys/cache/init_test.go +++ b/sys/cache/init_test.go @@ -8,13 +8,11 @@ import ( "go_dreamfactory/sys/cache" "go_dreamfactory/sys/db" "os" - "reflect" "testing" "time" "go_dreamfactory/utils" - "github.com/stretchr/testify/require" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/bson/primitive" ) @@ -113,10 +111,3 @@ func TestSet(t *testing.T) { cache.Redis().HMSet("friend:222", data) } - -func TestGet(t *testing.T) { - result, err := cache.Redis().HGetAll("111", reflect.TypeOf(map[string]interface{}{})) - require.Nil(t, err) - - fmt.Println(result...) -}