From cfd3cba23ba9f7ea76fb0f75d10c6237bb753aa3 Mon Sep 17 00:00:00 2001 From: zhaocy Date: Fri, 10 Jun 2022 14:20:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=A5=BD=E5=8F=8B=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/robot/friend.go | 181 ++++++- cmd/robot/robot.go | 18 +- cmd/robot/user.go | 5 +- go.mod | 1 + modules/friend/friend_comp.go | 297 ++++++++++- modules/user/user_comp.go | 10 +- pb/friend_msg.pb.go | 856 ++++++++++++++++++++++--------- pb/proto/errorcode.proto | 1 + pb/proto/friend/friend_msg.proto | 56 +- pb/proto/user/user_db.proto | 2 +- sys/cache/friend.go | 11 +- sys/cache/friend_test.go | 2 +- sys/cache/user.go | 6 +- sys/db/friend.go | 20 +- sys/db/friend_test.go | 10 +- sys/db/user.go | 10 +- utils/strings.go | 25 +- 17 files changed, 1184 insertions(+), 327 deletions(-) diff --git a/cmd/robot/friend.go b/cmd/robot/friend.go index 6e7bfa868..d49482cf0 100644 --- a/cmd/robot/friend.go +++ b/cmd/robot/friend.go @@ -2,23 +2,78 @@ package robot import ( "go_dreamfactory/comm" + "go_dreamfactory/modules/friend" "go_dreamfactory/pb" "log" ) func (r *Robot) handleFriendMsg(msg *pb.UserMessage) { switch msg.SubType { - case "apply": + case friend.Friend_SubType_Apply: r.handleFriendApply(msg) + case friend.Friend_SubType_ApplyList: + r.handleFriendApplyList(msg) + case friend.Friend_SubType_Agree: + r.handleFriendAgree(msg) + case friend.Friend_SubType_Refuse: + r.handleFriendRefuse(msg) + case friend.Friend_SubType_Blacklist: + r.handleFriendBlacklist(msg) + case friend.Friend_SubType_AddBlack: + r.handleFriendAddBlack(msg) + case friend.Friend_SubType_DelBlack: + r.handleFriendDelBlack(msg) + case friend.Friend_SubType_Search: + r.handleFriendSearch(msg) } } -//添加好友 +//好友列表 +func (r *Robot) FriendList() { + req := &pb.FriendListReq{} + head := &pb.UserMessage{MainType: string(comm.SM_FriendModule), SubType: friend.Friend_SubType_List} + defer traceFunc(head.MainType, head.SubType, r.user.UserData.GetUserId(), req) + err := r.SendToClient(head, req) + if err != nil { + log.Fatal(err) + } +} + +func (r *Robot) handleFriendList(msg *pb.UserMessage) { + rsp := &pb.FriendListRsp{} + if !comm.ProtoDecode(msg, rsp) { + return + } + printReply(msg, rsp) +} + +//好友搜索 +func (r *Robot) FriendSearch(nickName string) { + req := &pb.FriendSearchReq{ + NickName: nickName, + } + head := &pb.UserMessage{MainType: string(comm.SM_FriendModule), SubType: friend.Friend_SubType_Search} + defer traceFunc(head.MainType, head.SubType, r.user.UserData.GetUserId(), req) + err := r.SendToClient(head, req) + if err != nil { + log.Fatal(err) + } +} + +func (r *Robot) handleFriendSearch(msg *pb.UserMessage) { + rsp := &pb.FriendSearchRsp{} + if !comm.ProtoDecode(msg, rsp) { + return + } + printReply(msg, rsp) +} + +//好友申请 func (r *Robot) FriendApply(friendId string) { req := &pb.FriendApplyReq{ FriendId: friendId, } - head := &pb.UserMessage{MainType: "friend", SubType: "apply"} + head := &pb.UserMessage{MainType: string(comm.SM_FriendModule), SubType: friend.Friend_SubType_Apply} defer traceFunc(head.MainType, head.SubType, r.user.UserData.GetUserId(), req) err := r.SendToClient(head, req) if err != nil { @@ -33,3 +88,123 @@ func (r *Robot) handleFriendApply(msg *pb.UserMessage) { } printReply(msg, rsp) } + +//申请列表 +func (r *Robot) FriendApplyList() { + req := &pb.FriendApplyListReq{} + head := &pb.UserMessage{MainType: string(comm.SM_FriendModule), SubType: friend.Friend_SubType_ApplyList} + defer traceFunc(head.MainType, head.SubType, r.user.UserData.GetUserId(), req) + err := r.SendToClient(head, req) + if err != nil { + log.Fatal(err) + } +} + +func (r *Robot) handleFriendApplyList(msg *pb.UserMessage) { + rsp := &pb.FriendApplyListRsp{} + if !comm.ProtoDecode(msg, rsp) { + return + } + printReply(msg, rsp) +} + +//同意 +func (r *Robot) FriendAgree(friendIds []string) { + req := &pb.FriendAgreeReq{ + FriendIds: friendIds, + } + head := &pb.UserMessage{MainType: string(comm.SM_FriendModule), SubType: friend.Friend_SubType_Apply} + defer traceFunc(head.MainType, head.SubType, r.user.UserData.GetUserId(), req) + err := r.SendToClient(head, req) + if err != nil { + log.Fatal(err) + } +} + +func (r *Robot) handleFriendAgree(msg *pb.UserMessage) { + rsp := &pb.FriendAgreeRsp{} + if !comm.ProtoDecode(msg, rsp) { + return + } + printReply(msg, rsp) +} + +//拒绝 +func (r *Robot) FriendRefuse(friendIds []string) { + req := &pb.FriendRefuseReq{ + FriendIds: friendIds, + } + head := &pb.UserMessage{MainType: string(comm.SM_FriendModule), SubType: friend.Friend_SubType_Refuse} + defer traceFunc(head.MainType, head.SubType, r.user.UserData.GetUserId(), req) + err := r.SendToClient(head, req) + if err != nil { + log.Fatal(err) + } +} + +func (r *Robot) handleFriendRefuse(msg *pb.UserMessage) { + rsp := &pb.FriendRefuseRsp{} + if !comm.ProtoDecode(msg, rsp) { + return + } + printReply(msg, rsp) +} + +//黑名单列表 +func (r *Robot) FriendBlacklist() { + req := &pb.FriendBlackListReq{} + head := &pb.UserMessage{MainType: string(comm.SM_FriendModule), SubType: friend.Friend_SubType_Blacklist} + defer traceFunc(head.MainType, head.SubType, r.user.UserData.GetUserId(), req) + err := r.SendToClient(head, req) + if err != nil { + log.Fatal(err) + } +} + +func (r *Robot) handleFriendBlacklist(msg *pb.UserMessage) { + rsp := &pb.FriendBlackListRsp{} + if !comm.ProtoDecode(msg, rsp) { + return + } + printReply(msg, rsp) +} + +//添加黑名单 +func (r *Robot) FriendAddBlack() { + req := &pb.FriendBlackAddReq{} + head := &pb.UserMessage{MainType: string(comm.SM_FriendModule), SubType: friend.Friend_SubType_AddBlack} + defer traceFunc(head.MainType, head.SubType, r.user.UserData.GetUserId(), req) + err := r.SendToClient(head, req) + if err != nil { + log.Fatal(err) + } +} + +func (r *Robot) handleFriendAddBlack(msg *pb.UserMessage) { + rsp := &pb.FriendBlackAddRsp{} + if !comm.ProtoDecode(msg, rsp) { + return + } + printReply(msg, rsp) +} + +//删除黑名单 +func (r *Robot) FriendDelBlack(friendId string) { + req := &pb.FriendDelBlackReq{ + FriendId: friendId, + } + head := &pb.UserMessage{MainType: string(comm.SM_FriendModule), SubType: friend.Friend_SubType_DelBlack} + defer traceFunc(head.MainType, head.SubType, r.user.UserData.GetUserId(), req) + err := r.SendToClient(head, req) + if err != nil { + log.Fatal(err) + } +} + +func (r *Robot) handleFriendDelBlack(msg *pb.UserMessage) { + rsp := &pb.FriendDelBlackRsp{} + if !comm.ProtoDecode(msg, rsp) { + return + } + printReply(msg, rsp) +} diff --git a/cmd/robot/robot.go b/cmd/robot/robot.go index d241a87eb..d4d903b57 100644 --- a/cmd/robot/robot.go +++ b/cmd/robot/robot.go @@ -9,9 +9,9 @@ import ( "log" "net/http" + "github.com/golang/protobuf/proto" "github.com/gorilla/websocket" jsoniter "github.com/json-iterator/go" - "google.golang.org/protobuf/proto" ) type Robot struct { @@ -79,13 +79,21 @@ func (r *Robot) handleMsg(msg *pb.UserMessage) { //在这里添加玩家成功登录以后的测试方法 func (r *Robot) onUserLoaded() { //user - r.CreateUser("user671") + // r.CreateUser("乐谷4") //friend - r.FriendApply("629f147e3d276120561bfa18") + // r.FriendApply("629f147e3d276120561bfa18") + // r.FriendAgree([]string{}) + // r.FriendRefuse([]string{}) + // r.FriendApplyList() + // r.FriendList() + // r.FriendBlacklist() + // r.FriendAddBlack() + // r.FriendDelBlack("") + r.FriendSearch("乐谷5") //pack - r.QueryUserPack() + // r.QueryUserPack() } @@ -137,10 +145,12 @@ func (r *Robot) AccountRegister() { } } +//打印响应 func printReply(msg *pb.UserMessage, rsp interface{}) { log.Printf("rsp [%s.%s] [%d] [%v]", msg.MainType, msg.SubType, msg.Code, rsp) } +//方法参数跟踪 func traceFunc(module string, funcName string, uid string, funcArgs interface{}) { log.Printf("req [%s.%s] [%s] [%v]", module, funcName, uid, funcArgs) } diff --git a/cmd/robot/user.go b/cmd/robot/user.go index e8883c0a5..51f87b32d 100644 --- a/cmd/robot/user.go +++ b/cmd/robot/user.go @@ -2,6 +2,7 @@ package robot import ( "go_dreamfactory/comm" + "go_dreamfactory/modules/user" "go_dreamfactory/pb" "log" ) @@ -40,8 +41,8 @@ func (r *Robot) CreateUser(NickName string) { } head := &pb.UserMessage{ - MainType: "user", - SubType: "create", + MainType: string(comm.SM_UserModule), + SubType: user.User_SubType_Create, } defer traceFunc(head.MainType, head.SubType, r.user.UserData.GetUserId(), req) diff --git a/go.mod b/go.mod index c632988c2..31b5d2b24 100644 --- a/go.mod +++ b/go.mod @@ -7,6 +7,7 @@ require ( github.com/go-playground/validator/v10 v10.10.1 github.com/go-redis/redis/v8 v8.11.5 github.com/golang-jwt/jwt v3.2.2+incompatible + github.com/golang/protobuf v1.5.2 github.com/gorilla/websocket v1.4.2 github.com/hashicorp/consul/api v1.12.0 github.com/json-iterator/go v1.1.12 diff --git a/modules/friend/friend_comp.go b/modules/friend/friend_comp.go index f0e48dc2c..7e835645e 100644 --- a/modules/friend/friend_comp.go +++ b/modules/friend/friend_comp.go @@ -8,12 +8,20 @@ import ( "go_dreamfactory/modules" "go_dreamfactory/pb" "go_dreamfactory/sys/cache" + "go_dreamfactory/sys/db" "go_dreamfactory/utils" ) const ( + Friend_SubType_List = "list" Friend_SubType_Apply = "apply" Friend_SubType_ApplyList = "applylist" + Friend_SubType_AddBlack = "addblack" + Friend_SubType_DelBlack = "delblack" + Friend_SubType_Blacklist = "blacklist" + Friend_SubType_Agree = "agree" + Friend_SubType_Refuse = "refuse" + Friend_SubType_Search = "search" ) type FriendComp struct { @@ -29,6 +37,27 @@ func (this *FriendComp) Init(service core.IService, module core.IModule, comp co //搜索 func (this *FriendComp) Search(ctx context.Context, session comm.IUserSession, req *pb.FriendSearchReq) error { + var ( + code pb.ErrorCode + rsp *pb.FriendSearchRsp + friend *pb.FriendBase + ) + defer func() { + if code == pb.ErrorCode_Success { + rsp = &pb.FriendSearchRsp{ + Friend: friend, + } + } + session.SendMsg(string(this.module.GetType()), Friend_SubType_Search, code, rsp) + }() + + user := db.Defsys.Frined_FindCond(req.NickName) + if user != nil { + friend = &pb.FriendBase{ + UserId: user.UserId, + NickName: user.NiceName, + } + } return nil } @@ -115,7 +144,7 @@ func (this *FriendComp) Apply(ctx context.Context, session comm.IUserSession, re //将自己加入到目标用户的申请列表中 target.ApplyIds = append(target.ApplyIds, self.UserId) - err = cache.Defsys.Friend_Apply(&pb.Cache_FriendData{ + err = cache.Defsys.Friend_Update(&pb.Cache_FriendData{ UserId: req.FriendId, ApplyIds: target.ApplyIds, }) @@ -138,12 +167,6 @@ func (this *FriendComp) ApplyList(ctx context.Context, session comm.IUserSession list []*pb.FriendBase ) - self, err = cache.Defsys.Friend_Get(session.GetUserId()) - if self == nil || err != nil { - code = pb.ErrorCode_FriendSelfNoData - return - } - defer func() { if code == pb.ErrorCode_Success { rsp = &pb.FriendApplyListRsp{ @@ -153,6 +176,12 @@ func (this *FriendComp) ApplyList(ctx context.Context, session comm.IUserSession session.SendMsg(string(this.module.GetType()), Friend_SubType_ApplyList, code, rsp) }() + self, err = cache.Defsys.Friend_Get(session.GetUserId()) + if self == nil || err != nil { + code = pb.ErrorCode_FriendSelfNoData + return + } + for _, userId := range self.ApplyIds { //TODO 组装FriendBase明细数据 list = append(list, &pb.FriendBase{ @@ -169,28 +198,142 @@ func (this *FriendComp) Del(ctx context.Context, session comm.IUserSession, req } //好友列表 -func (this *FriendComp) List(ctx context.Context, session comm.IUserSession, req *pb.FriendListReq) error { +func (this *FriendComp) List(ctx context.Context, session comm.IUserSession, req *pb.FriendListReq) (err error) { + var ( + code pb.ErrorCode + self *pb.Cache_FriendData + rsp *pb.FriendListRsp + list []*pb.FriendBase + ) + + defer func() { + if code == pb.ErrorCode_Success { + rsp = &pb.FriendListRsp{ + List: list, + } + } + session.SendMsg(string(this.module.GetType()), Friend_SubType_List, code, rsp) + }() + + self, err = cache.Defsys.Friend_Get(session.GetUserId()) + if self == nil || err != nil { + code = pb.ErrorCode_FriendSelfNoData + return + } + + for _, userId := range self.FriendIds { + list = append(list, &pb.FriendBase{ + UserId: userId, + }) + } + return nil } //单个/批量同意 -func (this *FriendComp) Agree(ctx context.Context, session comm.IUserSession, req *pb.FriendAgreeOrRefuseReq) error { +func (this *FriendComp) Agree(ctx context.Context, session comm.IUserSession, req *pb.FriendAgreeReq) (err error) { + var ( + code pb.ErrorCode + self *pb.Cache_FriendData + rsp *pb.FriendAgreeRsp + optNum int32 + ) + defer func() { + if code == pb.ErrorCode_Success { + rsp = &pb.FriendAgreeRsp{ + Num: optNum, + } + } + session.SendMsg(string(this.module.GetType()), Friend_SubType_Agree, code, rsp) + }() + + self, err = cache.Defsys.Friend_Get(session.GetUserId()) + if self == nil || err != nil { + code = pb.ErrorCode_FriendSelfNoData + return + } + + //将申请人加入到自己的好友列表中 + for _, userId := range req.FriendIds { + if _, ok := utils.Find(self.FriendIds, userId); !ok { + self.FriendIds = append(self.FriendIds, userId) + } + } + + //将自己加入到申请人的好友列表中 + for _, userId := range req.FriendIds { + target, err2 := cache.Defsys.Friend_Get(userId) + if target == nil || err2 != nil { + code = pb.ErrorCode_FriendTargetNoData + continue + } + if _, ok := utils.Find(target.FriendIds, self.UserId); !ok { + target.FriendIds = append(target.FriendIds, self.UserId) + } + err = cache.Defsys.Friend_Update(target) + if err != nil { + code = pb.ErrorCode_DBError + return + } + } + + //将申请人从申请列表中删除 + for _, userId := range req.FriendIds { + self.ApplyIds = utils.DeleteString(self.ApplyIds, userId) + optNum++ + } + + //更新 + err = cache.Defsys.Friend_Update(self) + if err != nil { + code = pb.ErrorCode_DBError + return + } return nil } //单个/批量拒绝 -func (this *FriendComp) Refuse(ctx context.Context, session comm.IUserSession, req *pb.FriendAgreeOrRefuseReq) error { +func (this *FriendComp) Refuse(ctx context.Context, session comm.IUserSession, req *pb.FriendRefuseReq) (err error) { + //将申请人从申请列表中删除 + var ( + code pb.ErrorCode + self *pb.Cache_FriendData + rsp *pb.FriendAgreeRsp + optNum int32 + ) + defer func() { + if code == pb.ErrorCode_Success { + rsp = &pb.FriendAgreeRsp{ + Num: optNum, + } + } + session.SendMsg(string(this.module.GetType()), Friend_SubType_Refuse, code, rsp) + }() + + self, err = cache.Defsys.Friend_Get(session.GetUserId()) + if self == nil || err != nil { + code = pb.ErrorCode_FriendSelfNoData + return + } + + //将申请人从申请列表中删除 + for _, userId := range req.FriendIds { + self.ApplyIds = utils.DeleteString(self.ApplyIds, userId) + optNum++ + } + + //更新 + err = cache.Defsys.Friend_Update(self) + if err != nil { + code = pb.ErrorCode_DBError + return + } return nil } //赠送或接收 -func (this *FriendComp) ReceSend(ctx context.Context, session comm.IUserSession, req *pb.FriendReceiveOrSendReq) error { - return nil -} - -//好友数量 -func (this *FriendComp) Total(ctx context.Context, session comm.IUserSession, req *pb.FriendTotalReq) error { +func (this *FriendComp) ReceSend(ctx context.Context, session comm.IUserSession, req *pb.FriendReceiveReq) error { return nil } @@ -200,11 +343,129 @@ func (this *FriendComp) Detail(ctx context.Context, session comm.IUserSession, r } //黑名单 -func (this *FriendComp) Blacklist(ctx context.Context, session comm.IUserSession, req *pb.FriendBlackListReq) error { +func (this *FriendComp) Blacklist(ctx context.Context, session comm.IUserSession, req *pb.FriendBlackListReq) (err error) { + var ( + code pb.ErrorCode + self *pb.Cache_FriendData + rsp *pb.FriendBlackListRsp + list []*pb.FriendBase + ) + + defer func() { + if code == pb.ErrorCode_Success { + rsp = &pb.FriendBlackListRsp{ + Friends: list, + } + } + session.SendMsg(string(this.module.GetType()), Friend_SubType_Blacklist, code, rsp) + }() + + self, err = cache.Defsys.Friend_Get(session.GetUserId()) + if self == nil || err != nil { + code = pb.ErrorCode_FriendSelfNoData + return + } + + for _, userId := range self.BlackIds { + //TODO 完善FriendBase信息 + list = append(list, &pb.FriendBase{ + UserId: userId, + }) + } + return nil } //加入黑名单 -func (this *FriendComp) Addblack(ctx context.Context, session comm.IUserSession, req *pb.FriendBlackAddReq) error { +func (this *FriendComp) Addblack(ctx context.Context, session comm.IUserSession, req *pb.FriendBlackAddReq) (err error) { + var ( + code pb.ErrorCode + self *pb.Cache_FriendData + target *pb.Cache_FriendData + rsp *pb.FriendBlackAddRsp + blackNumMax = 50 //TODO 从配置中读取 + ) + + defer func() { + if code == pb.ErrorCode_Success { + rsp = &pb.FriendBlackAddRsp{ + FriendId: req.FriendId, + UserId: session.GetUserId(), + } + } + session.SendMsg(string(this.module.GetType()), Friend_SubType_AddBlack, code, rsp) + }() + + self, err = cache.Defsys.Friend_Get(session.GetUserId()) + if self == nil || err != nil { + code = pb.ErrorCode_FriendSelfNoData + return + } + + target, err = cache.Defsys.Friend_Get(req.FriendId) + if target == nil || err != nil { + code = pb.ErrorCode_FriendTargetNoData + return + } + + //判断目标是否在好友列表里面 + if _, ok := utils.Find(self.FriendIds, req.FriendId); ok { + code = pb.ErrorCode_FriendSelfBlackYet + return + } + + // 判断自己是否在对方的黑名单中 + if _, ok := utils.Find(target.BlackIds, self.UserId); ok { + code = pb.ErrorCode_FriendTargetBlackYet + return + } + + // 判断是否黑名单人数已满 + if len(self.BlackIds) >= blackNumMax { + code = pb.ErrorCode_FriendBlackMax + return + } + + //将目标加入黑名单 + self.BlackIds = append(self.BlackIds, req.FriendId) + //更新黑名单 + err = cache.Defsys.Friend_Update(self) + if err != nil { + code = pb.ErrorCode_DBError + return + } + return nil +} + +//删除黑名单 +func (this *FriendComp) delblack(ctx context.Context, session comm.IUserSession, req *pb.FriendDelBlackReq) (err error) { + var ( + code pb.ErrorCode + self *pb.Cache_FriendData + rsp *pb.FriendDelBlackRsp + ) + defer func() { + if code == pb.ErrorCode_Success { + rsp = &pb.FriendDelBlackRsp{ + FriendId: req.FriendId, + UserId: session.GetUserId(), + } + } + session.SendMsg(string(this.module.GetType()), Friend_SubType_AddBlack, code, rsp) + }() + self, err = cache.Defsys.Friend_Get(session.GetUserId()) + if self == nil || err != nil { + code = pb.ErrorCode_FriendSelfNoData + return + } + + //从黑名单列表中删除目标 + self.BlackIds = utils.DeleteString(self.BlackIds, req.FriendId) + //更新黑名单 + err = cache.Defsys.Friend_Update(self) + if err != nil { + code = pb.ErrorCode_DBError + return + } return nil } diff --git a/modules/user/user_comp.go b/modules/user/user_comp.go index 4151fb5ea..4cee7f1cf 100644 --- a/modules/user/user_comp.go +++ b/modules/user/user_comp.go @@ -13,6 +13,10 @@ import ( "go_dreamfactory/lego/sys/log" ) +const ( + User_SubType_Create = "create" +) + type UserComp struct { modules.MComp_GateComp module *User @@ -26,11 +30,11 @@ func (this *UserComp) Init(service core.IService, module core.IModule, comp core //创角 func (this *UserComp) Create(ctx context.Context, session comm.IUserSession, req *pb.UserCreateReq) (err error) { - defer utils.TraceFunc(session.GetUserId(), "user", "create", req, nil) + defer utils.TraceFunc(session.GetUserId(), string(this.module.GetType()), User_SubType_Create, req, nil) user := cache.Defsys.Get(session.GetUserId()) var code pb.ErrorCode defer func() { - session.SendMsg("user", "create", code, &pb.UserCreateRsp{}) + session.SendMsg(string(this.module.GetType()), User_SubType_Create, code, &pb.UserCreateRsp{}) }() if user == nil { log.Errorf("user no exist") @@ -42,6 +46,8 @@ func (this *UserComp) Create(ctx context.Context, session comm.IUserSession, req err = cache.Defsys.Update(user) if err != nil { log.Errorf("cache update err") + code = pb.ErrorCode_DBError + return } event.RegisterGO(comm.Event_CreateUser, session.GetUserId()) return nil diff --git a/pb/friend_msg.pb.go b/pb/friend_msg.pb.go index a88fd3497..725a918e5 100644 --- a/pb/friend_msg.pb.go +++ b/pb/friend_msg.pb.go @@ -159,7 +159,7 @@ type FriendListRsp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - List []*Cache_FriendData `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + List []*FriendBase `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` } func (x *FriendListRsp) Reset() { @@ -194,7 +194,7 @@ func (*FriendListRsp) Descriptor() ([]byte, []int) { return file_friend_friend_msg_proto_rawDescGZIP(), []int{2} } -func (x *FriendListRsp) GetList() []*Cache_FriendData { +func (x *FriendListRsp) GetList() []*FriendBase { if x != nil { return x.List } @@ -407,18 +407,17 @@ func (x *FriendDelRsp) GetUserId() string { return "" } -//同意或拒绝 -type FriendAgreeOrRefuseReq struct { +//同意 +type FriendAgreeReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId,omitempty"` //被同意或拒绝的用户 - IsAgree bool `protobuf:"varint,2,opt,name=isAgree,proto3" json:"isAgree,omitempty"` + FriendIds []string `protobuf:"bytes,1,rep,name=friendIds,proto3" json:"friendIds,omitempty"` //被同意的用户 } -func (x *FriendAgreeOrRefuseReq) Reset() { - *x = FriendAgreeOrRefuseReq{} +func (x *FriendAgreeReq) Reset() { + *x = FriendAgreeReq{} if protoimpl.UnsafeEnabled { mi := &file_friend_friend_msg_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -426,13 +425,13 @@ func (x *FriendAgreeOrRefuseReq) Reset() { } } -func (x *FriendAgreeOrRefuseReq) String() string { +func (x *FriendAgreeReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*FriendAgreeOrRefuseReq) ProtoMessage() {} +func (*FriendAgreeReq) ProtoMessage() {} -func (x *FriendAgreeOrRefuseReq) ProtoReflect() protoreflect.Message { +func (x *FriendAgreeReq) ProtoReflect() protoreflect.Message { mi := &file_friend_friend_msg_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -444,36 +443,28 @@ func (x *FriendAgreeOrRefuseReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use FriendAgreeOrRefuseReq.ProtoReflect.Descriptor instead. -func (*FriendAgreeOrRefuseReq) Descriptor() ([]byte, []int) { +// Deprecated: Use FriendAgreeReq.ProtoReflect.Descriptor instead. +func (*FriendAgreeReq) Descriptor() ([]byte, []int) { return file_friend_friend_msg_proto_rawDescGZIP(), []int{7} } -func (x *FriendAgreeOrRefuseReq) GetFriendId() string { +func (x *FriendAgreeReq) GetFriendIds() []string { if x != nil { - return x.FriendId + return x.FriendIds } - return "" + return nil } -func (x *FriendAgreeOrRefuseReq) GetIsAgree() bool { - if x != nil { - return x.IsAgree - } - return false -} - -type FriendAgressOrRefuseRsp struct { +type FriendAgreeRsp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Num int32 `protobuf:"varint,1,opt,name=Num,proto3" json:"Num,omitempty"` //操作的数量 - IsAgree bool `protobuf:"varint,2,opt,name=isAgree,proto3" json:"isAgree,omitempty"` + Num int32 `protobuf:"varint,1,opt,name=Num,proto3" json:"Num,omitempty"` //操作的数量 } -func (x *FriendAgressOrRefuseRsp) Reset() { - *x = FriendAgressOrRefuseRsp{} +func (x *FriendAgreeRsp) Reset() { + *x = FriendAgreeRsp{} if protoimpl.UnsafeEnabled { mi := &file_friend_friend_msg_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -481,13 +472,13 @@ func (x *FriendAgressOrRefuseRsp) Reset() { } } -func (x *FriendAgressOrRefuseRsp) String() string { +func (x *FriendAgreeRsp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*FriendAgressOrRefuseRsp) ProtoMessage() {} +func (*FriendAgreeRsp) ProtoMessage() {} -func (x *FriendAgressOrRefuseRsp) ProtoReflect() protoreflect.Message { +func (x *FriendAgreeRsp) ProtoReflect() protoreflect.Message { mi := &file_friend_friend_msg_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -499,23 +490,111 @@ func (x *FriendAgressOrRefuseRsp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use FriendAgressOrRefuseRsp.ProtoReflect.Descriptor instead. -func (*FriendAgressOrRefuseRsp) Descriptor() ([]byte, []int) { +// Deprecated: Use FriendAgreeRsp.ProtoReflect.Descriptor instead. +func (*FriendAgreeRsp) Descriptor() ([]byte, []int) { return file_friend_friend_msg_proto_rawDescGZIP(), []int{8} } -func (x *FriendAgressOrRefuseRsp) GetNum() int32 { +func (x *FriendAgreeRsp) GetNum() int32 { if x != nil { return x.Num } return 0 } -func (x *FriendAgressOrRefuseRsp) GetIsAgree() bool { - if x != nil { - return x.IsAgree +//拒绝 +type FriendRefuseReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FriendIds []string `protobuf:"bytes,1,rep,name=friendIds,proto3" json:"friendIds,omitempty"` //被拒绝的用户 +} + +func (x *FriendRefuseReq) Reset() { + *x = FriendRefuseReq{} + if protoimpl.UnsafeEnabled { + mi := &file_friend_friend_msg_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return false +} + +func (x *FriendRefuseReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FriendRefuseReq) ProtoMessage() {} + +func (x *FriendRefuseReq) ProtoReflect() protoreflect.Message { + mi := &file_friend_friend_msg_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 FriendRefuseReq.ProtoReflect.Descriptor instead. +func (*FriendRefuseReq) Descriptor() ([]byte, []int) { + return file_friend_friend_msg_proto_rawDescGZIP(), []int{9} +} + +func (x *FriendRefuseReq) GetFriendIds() []string { + if x != nil { + return x.FriendIds + } + return nil +} + +type FriendRefuseRsp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Num int32 `protobuf:"varint,1,opt,name=Num,proto3" json:"Num,omitempty"` //操作的数量 +} + +func (x *FriendRefuseRsp) Reset() { + *x = FriendRefuseRsp{} + if protoimpl.UnsafeEnabled { + mi := &file_friend_friend_msg_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FriendRefuseRsp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FriendRefuseRsp) ProtoMessage() {} + +func (x *FriendRefuseRsp) ProtoReflect() protoreflect.Message { + mi := &file_friend_friend_msg_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 FriendRefuseRsp.ProtoReflect.Descriptor instead. +func (*FriendRefuseRsp) Descriptor() ([]byte, []int) { + return file_friend_friend_msg_proto_rawDescGZIP(), []int{10} +} + +func (x *FriendRefuseRsp) GetNum() int32 { + if x != nil { + return x.Num + } + return 0 } //好友申请列表 @@ -528,7 +607,7 @@ type FriendApplyListReq struct { func (x *FriendApplyListReq) Reset() { *x = FriendApplyListReq{} if protoimpl.UnsafeEnabled { - mi := &file_friend_friend_msg_proto_msgTypes[9] + mi := &file_friend_friend_msg_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -541,7 +620,7 @@ func (x *FriendApplyListReq) String() string { func (*FriendApplyListReq) ProtoMessage() {} func (x *FriendApplyListReq) ProtoReflect() protoreflect.Message { - mi := &file_friend_friend_msg_proto_msgTypes[9] + mi := &file_friend_friend_msg_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -554,7 +633,7 @@ func (x *FriendApplyListReq) ProtoReflect() protoreflect.Message { // Deprecated: Use FriendApplyListReq.ProtoReflect.Descriptor instead. func (*FriendApplyListReq) Descriptor() ([]byte, []int) { - return file_friend_friend_msg_proto_rawDescGZIP(), []int{9} + return file_friend_friend_msg_proto_rawDescGZIP(), []int{11} } type FriendApplyListRsp struct { @@ -568,7 +647,7 @@ type FriendApplyListRsp struct { func (x *FriendApplyListRsp) Reset() { *x = FriendApplyListRsp{} if protoimpl.UnsafeEnabled { - mi := &file_friend_friend_msg_proto_msgTypes[10] + mi := &file_friend_friend_msg_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -581,7 +660,7 @@ func (x *FriendApplyListRsp) String() string { func (*FriendApplyListRsp) ProtoMessage() {} func (x *FriendApplyListRsp) ProtoReflect() protoreflect.Message { - mi := &file_friend_friend_msg_proto_msgTypes[10] + mi := &file_friend_friend_msg_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -594,7 +673,7 @@ func (x *FriendApplyListRsp) ProtoReflect() protoreflect.Message { // Deprecated: Use FriendApplyListRsp.ProtoReflect.Descriptor instead. func (*FriendApplyListRsp) Descriptor() ([]byte, []int) { - return file_friend_friend_msg_proto_rawDescGZIP(), []int{10} + return file_friend_friend_msg_proto_rawDescGZIP(), []int{12} } func (x *FriendApplyListRsp) GetList() []*FriendBase { @@ -610,14 +689,13 @@ type FriendSearchReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId,omitempty"` - NickName string `protobuf:"bytes,2,opt,name=nickName,proto3" json:"nickName,omitempty"` //好友昵称 + NickName string `protobuf:"bytes,1,opt,name=nickName,proto3" json:"nickName,omitempty"` //好友昵称 } func (x *FriendSearchReq) Reset() { *x = FriendSearchReq{} if protoimpl.UnsafeEnabled { - mi := &file_friend_friend_msg_proto_msgTypes[11] + mi := &file_friend_friend_msg_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -630,7 +708,7 @@ func (x *FriendSearchReq) String() string { func (*FriendSearchReq) ProtoMessage() {} func (x *FriendSearchReq) ProtoReflect() protoreflect.Message { - mi := &file_friend_friend_msg_proto_msgTypes[11] + mi := &file_friend_friend_msg_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -643,14 +721,7 @@ func (x *FriendSearchReq) ProtoReflect() protoreflect.Message { // Deprecated: Use FriendSearchReq.ProtoReflect.Descriptor instead. func (*FriendSearchReq) Descriptor() ([]byte, []int) { - return file_friend_friend_msg_proto_rawDescGZIP(), []int{11} -} - -func (x *FriendSearchReq) GetFriendId() string { - if x != nil { - return x.FriendId - } - return "" + return file_friend_friend_msg_proto_rawDescGZIP(), []int{13} } func (x *FriendSearchReq) GetNickName() string { @@ -665,13 +736,13 @@ type FriendSearchRsp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Friends []*FriendBase `protobuf:"bytes,1,rep,name=friends,proto3" json:"friends,omitempty"` + Friend *FriendBase `protobuf:"bytes,1,opt,name=friend,proto3" json:"friend,omitempty"` } func (x *FriendSearchRsp) Reset() { *x = FriendSearchRsp{} if protoimpl.UnsafeEnabled { - mi := &file_friend_friend_msg_proto_msgTypes[12] + mi := &file_friend_friend_msg_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -684,7 +755,7 @@ func (x *FriendSearchRsp) String() string { func (*FriendSearchRsp) ProtoMessage() {} func (x *FriendSearchRsp) ProtoReflect() protoreflect.Message { - mi := &file_friend_friend_msg_proto_msgTypes[12] + mi := &file_friend_friend_msg_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -697,12 +768,12 @@ func (x *FriendSearchRsp) ProtoReflect() protoreflect.Message { // Deprecated: Use FriendSearchRsp.ProtoReflect.Descriptor instead. func (*FriendSearchRsp) Descriptor() ([]byte, []int) { - return file_friend_friend_msg_proto_rawDescGZIP(), []int{12} + return file_friend_friend_msg_proto_rawDescGZIP(), []int{14} } -func (x *FriendSearchRsp) GetFriends() []*FriendBase { +func (x *FriendSearchRsp) GetFriend() *FriendBase { if x != nil { - return x.Friends + return x.Friend } return nil } @@ -717,7 +788,7 @@ type FriendBlackListReq struct { func (x *FriendBlackListReq) Reset() { *x = FriendBlackListReq{} if protoimpl.UnsafeEnabled { - mi := &file_friend_friend_msg_proto_msgTypes[13] + mi := &file_friend_friend_msg_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -730,7 +801,7 @@ func (x *FriendBlackListReq) String() string { func (*FriendBlackListReq) ProtoMessage() {} func (x *FriendBlackListReq) ProtoReflect() protoreflect.Message { - mi := &file_friend_friend_msg_proto_msgTypes[13] + mi := &file_friend_friend_msg_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -743,7 +814,7 @@ func (x *FriendBlackListReq) ProtoReflect() protoreflect.Message { // Deprecated: Use FriendBlackListReq.ProtoReflect.Descriptor instead. func (*FriendBlackListReq) Descriptor() ([]byte, []int) { - return file_friend_friend_msg_proto_rawDescGZIP(), []int{13} + return file_friend_friend_msg_proto_rawDescGZIP(), []int{15} } type FriendBlackListRsp struct { @@ -757,7 +828,7 @@ type FriendBlackListRsp struct { func (x *FriendBlackListRsp) Reset() { *x = FriendBlackListRsp{} if protoimpl.UnsafeEnabled { - mi := &file_friend_friend_msg_proto_msgTypes[14] + mi := &file_friend_friend_msg_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -770,7 +841,7 @@ func (x *FriendBlackListRsp) String() string { func (*FriendBlackListRsp) ProtoMessage() {} func (x *FriendBlackListRsp) ProtoReflect() protoreflect.Message { - mi := &file_friend_friend_msg_proto_msgTypes[14] + mi := &file_friend_friend_msg_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -783,7 +854,7 @@ func (x *FriendBlackListRsp) ProtoReflect() protoreflect.Message { // Deprecated: Use FriendBlackListRsp.ProtoReflect.Descriptor instead. func (*FriendBlackListRsp) Descriptor() ([]byte, []int) { - return file_friend_friend_msg_proto_rawDescGZIP(), []int{14} + return file_friend_friend_msg_proto_rawDescGZIP(), []int{16} } func (x *FriendBlackListRsp) GetFriends() []*FriendBase { @@ -805,7 +876,7 @@ type FriendBlackAddReq struct { func (x *FriendBlackAddReq) Reset() { *x = FriendBlackAddReq{} if protoimpl.UnsafeEnabled { - mi := &file_friend_friend_msg_proto_msgTypes[15] + mi := &file_friend_friend_msg_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -818,7 +889,7 @@ func (x *FriendBlackAddReq) String() string { func (*FriendBlackAddReq) ProtoMessage() {} func (x *FriendBlackAddReq) ProtoReflect() protoreflect.Message { - mi := &file_friend_friend_msg_proto_msgTypes[15] + mi := &file_friend_friend_msg_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -831,7 +902,7 @@ func (x *FriendBlackAddReq) ProtoReflect() protoreflect.Message { // Deprecated: Use FriendBlackAddReq.ProtoReflect.Descriptor instead. func (*FriendBlackAddReq) Descriptor() ([]byte, []int) { - return file_friend_friend_msg_proto_rawDescGZIP(), []int{15} + return file_friend_friend_msg_proto_rawDescGZIP(), []int{17} } func (x *FriendBlackAddReq) GetFriendId() string { @@ -853,7 +924,7 @@ type FriendBlackAddRsp struct { func (x *FriendBlackAddRsp) Reset() { *x = FriendBlackAddRsp{} if protoimpl.UnsafeEnabled { - mi := &file_friend_friend_msg_proto_msgTypes[16] + mi := &file_friend_friend_msg_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -866,7 +937,7 @@ func (x *FriendBlackAddRsp) String() string { func (*FriendBlackAddRsp) ProtoMessage() {} func (x *FriendBlackAddRsp) ProtoReflect() protoreflect.Message { - mi := &file_friend_friend_msg_proto_msgTypes[16] + mi := &file_friend_friend_msg_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -879,7 +950,7 @@ func (x *FriendBlackAddRsp) ProtoReflect() protoreflect.Message { // Deprecated: Use FriendBlackAddRsp.ProtoReflect.Descriptor instead. func (*FriendBlackAddRsp) Descriptor() ([]byte, []int) { - return file_friend_friend_msg_proto_rawDescGZIP(), []int{16} + return file_friend_friend_msg_proto_rawDescGZIP(), []int{18} } func (x *FriendBlackAddRsp) GetFriendId() string { @@ -896,33 +967,32 @@ func (x *FriendBlackAddRsp) GetUserId() string { return "" } -//赠送或接收 -type FriendReceiveOrSendReq struct { +//删除黑名单 +type FriendDelBlackReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId,omitempty"` - IsReceive bool `protobuf:"varint,2,opt,name=isReceive,proto3" json:"isReceive,omitempty"` + FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId,omitempty"` } -func (x *FriendReceiveOrSendReq) Reset() { - *x = FriendReceiveOrSendReq{} +func (x *FriendDelBlackReq) Reset() { + *x = FriendDelBlackReq{} if protoimpl.UnsafeEnabled { - mi := &file_friend_friend_msg_proto_msgTypes[17] + mi := &file_friend_friend_msg_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *FriendReceiveOrSendReq) String() string { +func (x *FriendDelBlackReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*FriendReceiveOrSendReq) ProtoMessage() {} +func (*FriendDelBlackReq) ProtoMessage() {} -func (x *FriendReceiveOrSendReq) ProtoReflect() protoreflect.Message { - mi := &file_friend_friend_msg_proto_msgTypes[17] +func (x *FriendDelBlackReq) ProtoReflect() protoreflect.Message { + mi := &file_friend_friend_msg_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -933,52 +1003,44 @@ func (x *FriendReceiveOrSendReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use FriendReceiveOrSendReq.ProtoReflect.Descriptor instead. -func (*FriendReceiveOrSendReq) Descriptor() ([]byte, []int) { - return file_friend_friend_msg_proto_rawDescGZIP(), []int{17} +// Deprecated: Use FriendDelBlackReq.ProtoReflect.Descriptor instead. +func (*FriendDelBlackReq) Descriptor() ([]byte, []int) { + return file_friend_friend_msg_proto_rawDescGZIP(), []int{19} } -func (x *FriendReceiveOrSendReq) GetFriendId() string { +func (x *FriendDelBlackReq) GetFriendId() string { if x != nil { return x.FriendId } return "" } -func (x *FriendReceiveOrSendReq) GetIsReceive() bool { - if x != nil { - return x.IsReceive - } - return false -} - -type FriendReceiveOrSendRsp struct { +type FriendDelBlackRsp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId,omitempty"` - UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"` - IsReceive bool `protobuf:"varint,3,opt,name=isReceive,proto3" json:"isReceive,omitempty"` + 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 *FriendReceiveOrSendRsp) Reset() { - *x = FriendReceiveOrSendRsp{} +func (x *FriendDelBlackRsp) Reset() { + *x = FriendDelBlackRsp{} if protoimpl.UnsafeEnabled { - mi := &file_friend_friend_msg_proto_msgTypes[18] + mi := &file_friend_friend_msg_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *FriendReceiveOrSendRsp) String() string { +func (x *FriendDelBlackRsp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*FriendReceiveOrSendRsp) ProtoMessage() {} +func (*FriendDelBlackRsp) ProtoMessage() {} -func (x *FriendReceiveOrSendRsp) ProtoReflect() protoreflect.Message { - mi := &file_friend_friend_msg_proto_msgTypes[18] +func (x *FriendDelBlackRsp) ProtoReflect() protoreflect.Message { + mi := &file_friend_friend_msg_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -989,30 +1051,229 @@ func (x *FriendReceiveOrSendRsp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use FriendReceiveOrSendRsp.ProtoReflect.Descriptor instead. -func (*FriendReceiveOrSendRsp) Descriptor() ([]byte, []int) { - return file_friend_friend_msg_proto_rawDescGZIP(), []int{18} +// Deprecated: Use FriendDelBlackRsp.ProtoReflect.Descriptor instead. +func (*FriendDelBlackRsp) Descriptor() ([]byte, []int) { + return file_friend_friend_msg_proto_rawDescGZIP(), []int{20} } -func (x *FriendReceiveOrSendRsp) GetFriendId() string { +func (x *FriendDelBlackRsp) GetFriendId() string { if x != nil { return x.FriendId } return "" } -func (x *FriendReceiveOrSendRsp) GetUserId() string { +func (x *FriendDelBlackRsp) GetUserId() string { if x != nil { return x.UserId } return "" } -func (x *FriendReceiveOrSendRsp) GetIsReceive() bool { - if x != nil { - return x.IsReceive +//接收 +type FriendReceiveReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId,omitempty"` +} + +func (x *FriendReceiveReq) Reset() { + *x = FriendReceiveReq{} + if protoimpl.UnsafeEnabled { + mi := &file_friend_friend_msg_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return false +} + +func (x *FriendReceiveReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FriendReceiveReq) ProtoMessage() {} + +func (x *FriendReceiveReq) ProtoReflect() protoreflect.Message { + mi := &file_friend_friend_msg_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 FriendReceiveReq.ProtoReflect.Descriptor instead. +func (*FriendReceiveReq) Descriptor() ([]byte, []int) { + return file_friend_friend_msg_proto_rawDescGZIP(), []int{21} +} + +func (x *FriendReceiveReq) GetFriendId() string { + if x != nil { + return x.FriendId + } + return "" +} + +type FriendReceiveRsp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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() { + *x = FriendReceiveRsp{} + if protoimpl.UnsafeEnabled { + mi := &file_friend_friend_msg_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FriendReceiveRsp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FriendReceiveRsp) ProtoMessage() {} + +func (x *FriendReceiveRsp) ProtoReflect() protoreflect.Message { + mi := &file_friend_friend_msg_proto_msgTypes[22] + 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 FriendReceiveRsp.ProtoReflect.Descriptor instead. +func (*FriendReceiveRsp) Descriptor() ([]byte, []int) { + return file_friend_friend_msg_proto_rawDescGZIP(), []int{22} +} + +func (x *FriendReceiveRsp) GetFriendId() string { + if x != nil { + return x.FriendId + } + return "" +} + +func (x *FriendReceiveRsp) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +//赠送 +type FriendGiveReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId,omitempty"` +} + +func (x *FriendGiveReq) Reset() { + *x = FriendGiveReq{} + if protoimpl.UnsafeEnabled { + mi := &file_friend_friend_msg_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FriendGiveReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FriendGiveReq) ProtoMessage() {} + +func (x *FriendGiveReq) ProtoReflect() protoreflect.Message { + mi := &file_friend_friend_msg_proto_msgTypes[23] + 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 FriendGiveReq.ProtoReflect.Descriptor instead. +func (*FriendGiveReq) Descriptor() ([]byte, []int) { + return file_friend_friend_msg_proto_rawDescGZIP(), []int{23} +} + +func (x *FriendGiveReq) GetFriendId() string { + if x != nil { + return x.FriendId + } + return "" +} + +type FriendGiveRsp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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() { + *x = FriendGiveRsp{} + if protoimpl.UnsafeEnabled { + mi := &file_friend_friend_msg_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FriendGiveRsp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FriendGiveRsp) ProtoMessage() {} + +func (x *FriendGiveRsp) ProtoReflect() protoreflect.Message { + mi := &file_friend_friend_msg_proto_msgTypes[24] + 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 FriendGiveRsp.ProtoReflect.Descriptor instead. +func (*FriendGiveRsp) Descriptor() ([]byte, []int) { + return file_friend_friend_msg_proto_rawDescGZIP(), []int{24} +} + +func (x *FriendGiveRsp) GetFriendId() string { + if x != nil { + return x.FriendId + } + return "" +} + +func (x *FriendGiveRsp) GetUserId() string { + if x != nil { + return x.UserId + } + return "" } //好友数量 @@ -1027,7 +1288,7 @@ type FriendTotalReq struct { func (x *FriendTotalReq) Reset() { *x = FriendTotalReq{} if protoimpl.UnsafeEnabled { - mi := &file_friend_friend_msg_proto_msgTypes[19] + mi := &file_friend_friend_msg_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1040,7 +1301,7 @@ func (x *FriendTotalReq) String() string { func (*FriendTotalReq) ProtoMessage() {} func (x *FriendTotalReq) ProtoReflect() protoreflect.Message { - mi := &file_friend_friend_msg_proto_msgTypes[19] + mi := &file_friend_friend_msg_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1053,7 +1314,7 @@ func (x *FriendTotalReq) ProtoReflect() protoreflect.Message { // Deprecated: Use FriendTotalReq.ProtoReflect.Descriptor instead. func (*FriendTotalReq) Descriptor() ([]byte, []int) { - return file_friend_friend_msg_proto_rawDescGZIP(), []int{19} + return file_friend_friend_msg_proto_rawDescGZIP(), []int{25} } func (x *FriendTotalReq) GetFriendId() string { @@ -1075,7 +1336,7 @@ type FriendTotalRsp struct { func (x *FriendTotalRsp) Reset() { *x = FriendTotalRsp{} if protoimpl.UnsafeEnabled { - mi := &file_friend_friend_msg_proto_msgTypes[20] + mi := &file_friend_friend_msg_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1088,7 +1349,7 @@ func (x *FriendTotalRsp) String() string { func (*FriendTotalRsp) ProtoMessage() {} func (x *FriendTotalRsp) ProtoReflect() protoreflect.Message { - mi := &file_friend_friend_msg_proto_msgTypes[20] + mi := &file_friend_friend_msg_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1101,7 +1362,7 @@ func (x *FriendTotalRsp) ProtoReflect() protoreflect.Message { // Deprecated: Use FriendTotalRsp.ProtoReflect.Descriptor instead. func (*FriendTotalRsp) Descriptor() ([]byte, []int) { - return file_friend_friend_msg_proto_rawDescGZIP(), []int{20} + return file_friend_friend_msg_proto_rawDescGZIP(), []int{26} } func (x *FriendTotalRsp) GetFriendId() string { @@ -1122,96 +1383,103 @@ var File_friend_friend_msg_proto protoreflect.FileDescriptor var file_friend_friend_msg_proto_rawDesc = []byte{ 0x0a, 0x17, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2f, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5f, - 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x66, 0x72, 0x69, 0x65, 0x6e, - 0x64, 0x2f, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0xc8, 0x01, 0x0a, 0x0a, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x42, 0x61, 0x73, 0x65, - 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x4e, 0x69, 0x63, 0x6b, - 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x4e, 0x69, 0x63, 0x6b, - 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, - 0x61, 0x74, 0x61, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, - 0x61, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x74, 0x72, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x74, 0x72, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x1a, - 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x66, - 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x0b, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x0f, 0x0a, 0x0d, - 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x22, 0x36, 0x0a, - 0x0d, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x73, 0x70, 0x12, 0x25, - 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x43, - 0x61, 0x63, 0x68, 0x65, 0x5f, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, - 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x2c, 0x0a, 0x0e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x41, - 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, - 0x64, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, - 0x64, 0x49, 0x64, 0x22, 0x44, 0x0a, 0x0e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x41, 0x70, 0x70, - 0x6c, 0x79, 0x52, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, - 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x22, 0x2a, 0x0a, 0x0c, 0x46, 0x72, 0x69, - 0x65, 0x6e, 0x64, 0x44, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x72, 0x69, + 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc8, 0x01, 0x0a, 0x0a, 0x46, 0x72, + 0x69, 0x65, 0x6e, 0x64, 0x42, 0x61, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, + 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, + 0x12, 0x1a, 0x0a, 0x08, 0x4e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x4e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, + 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, + 0x65, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x74, + 0x72, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x74, + 0x72, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x54, 0x69, 0x6d, + 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, + 0x54, 0x69, 0x6d, 0x65, 0x22, 0x0f, 0x0a, 0x0d, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x71, 0x22, 0x30, 0x0a, 0x0d, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x42, 0x61, 0x73, + 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x2c, 0x0a, 0x0e, 0x46, 0x72, 0x69, 0x65, 0x6e, + 0x64, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x72, 0x69, - 0x65, 0x6e, 0x64, 0x49, 0x64, 0x22, 0x42, 0x0a, 0x0c, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x44, - 0x65, 0x6c, 0x52, 0x73, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, - 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x4e, 0x0a, 0x16, 0x46, 0x72, 0x69, - 0x65, 0x6e, 0x64, 0x41, 0x67, 0x72, 0x65, 0x65, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x75, 0x73, 0x65, - 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x12, - 0x18, 0x0a, 0x07, 0x69, 0x73, 0x41, 0x67, 0x72, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x07, 0x69, 0x73, 0x41, 0x67, 0x72, 0x65, 0x65, 0x22, 0x45, 0x0a, 0x17, 0x46, 0x72, 0x69, - 0x65, 0x6e, 0x64, 0x41, 0x67, 0x72, 0x65, 0x73, 0x73, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x75, 0x73, - 0x65, 0x52, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x4e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x03, 0x4e, 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x73, 0x41, 0x67, 0x72, 0x65, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x41, 0x67, 0x72, 0x65, 0x65, - 0x22, 0x14, 0x0a, 0x12, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x4c, - 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x22, 0x35, 0x0a, 0x12, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, - 0x41, 0x70, 0x70, 0x6c, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x04, - 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x46, 0x72, 0x69, - 0x65, 0x6e, 0x64, 0x42, 0x61, 0x73, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x49, 0x0a, - 0x0f, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, - 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, - 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x38, 0x0a, 0x0f, 0x46, 0x72, 0x69, 0x65, - 0x6e, 0x64, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x73, 0x70, 0x12, 0x25, 0x0a, 0x07, 0x66, - 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x46, - 0x72, 0x69, 0x65, 0x6e, 0x64, 0x42, 0x61, 0x73, 0x65, 0x52, 0x07, 0x66, 0x72, 0x69, 0x65, 0x6e, - 0x64, 0x73, 0x22, 0x14, 0x0a, 0x12, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x42, 0x6c, 0x61, 0x63, - 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x22, 0x3b, 0x0a, 0x12, 0x46, 0x72, 0x69, 0x65, - 0x6e, 0x64, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x73, 0x70, 0x12, 0x25, - 0x0a, 0x07, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x0b, 0x2e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x42, 0x61, 0x73, 0x65, 0x52, 0x07, 0x66, 0x72, - 0x69, 0x65, 0x6e, 0x64, 0x73, 0x22, 0x2f, 0x0a, 0x11, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x42, - 0x6c, 0x61, 0x63, 0x6b, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x72, - 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x72, - 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x22, 0x47, 0x0a, 0x11, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, - 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x41, 0x64, 0x64, 0x52, 0x73, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x66, + 0x65, 0x6e, 0x64, 0x49, 0x64, 0x22, 0x44, 0x0a, 0x0e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x41, + 0x70, 0x70, 0x6c, 0x79, 0x52, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, + 0x1a, 0x0a, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x22, 0x2a, 0x0a, 0x0c, 0x46, + 0x72, 0x69, 0x65, 0x6e, 0x64, 0x44, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, - 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, - 0x52, 0x0a, 0x16, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, - 0x4f, 0x72, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x72, 0x69, - 0x65, 0x6e, 0x64, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x72, 0x69, - 0x65, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x73, 0x52, 0x65, 0x63, 0x65, 0x69, - 0x76, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x52, 0x65, 0x63, 0x65, - 0x69, 0x76, 0x65, 0x22, 0x6a, 0x0a, 0x16, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x63, - 0x65, 0x69, 0x76, 0x65, 0x4f, 0x72, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x73, 0x70, 0x12, 0x1a, 0x0a, - 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, - 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, - 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x73, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x22, - 0x2c, 0x0a, 0x0e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, + 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x22, 0x42, 0x0a, 0x0c, 0x46, 0x72, 0x69, 0x65, 0x6e, + 0x64, 0x44, 0x65, 0x6c, 0x52, 0x73, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, + 0x64, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, + 0x64, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x2e, 0x0a, 0x0e, 0x46, + 0x72, 0x69, 0x65, 0x6e, 0x64, 0x41, 0x67, 0x72, 0x65, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, + 0x09, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x09, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x73, 0x22, 0x22, 0x0a, 0x0e, 0x46, + 0x72, 0x69, 0x65, 0x6e, 0x64, 0x41, 0x67, 0x72, 0x65, 0x65, 0x52, 0x73, 0x70, 0x12, 0x10, 0x0a, + 0x03, 0x4e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x4e, 0x75, 0x6d, 0x22, + 0x2f, 0x0a, 0x0f, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x66, 0x75, 0x73, 0x65, 0x52, + 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x73, + 0x22, 0x23, 0x0a, 0x0f, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x66, 0x75, 0x73, 0x65, + 0x52, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x4e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x03, 0x4e, 0x75, 0x6d, 0x22, 0x14, 0x0a, 0x12, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x41, + 0x70, 0x70, 0x6c, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x22, 0x35, 0x0a, 0x12, 0x46, + 0x72, 0x69, 0x65, 0x6e, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x73, + 0x70, 0x12, 0x1f, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x0b, 0x2e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x42, 0x61, 0x73, 0x65, 0x52, 0x04, 0x6c, 0x69, + 0x73, 0x74, 0x22, 0x2d, 0x0a, 0x0f, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, + 0x65, 0x22, 0x36, 0x0a, 0x0f, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x52, 0x73, 0x70, 0x12, 0x23, 0x0a, 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x42, 0x61, 0x73, + 0x65, 0x52, 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x22, 0x14, 0x0a, 0x12, 0x46, 0x72, 0x69, + 0x65, 0x6e, 0x64, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x22, + 0x3b, 0x0a, 0x12, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x73, 0x70, 0x12, 0x25, 0x0a, 0x07, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x42, + 0x61, 0x73, 0x65, 0x52, 0x07, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, 0x22, 0x2f, 0x0a, 0x11, + 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x22, 0x42, 0x0a, - 0x0e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x73, 0x70, 0x12, - 0x1a, 0x0a, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, - 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, - 0x6c, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x22, 0x47, 0x0a, + 0x11, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x41, 0x64, 0x64, 0x52, + 0x73, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x16, + 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x2f, 0x0a, 0x11, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, + 0x44, 0x65, 0x6c, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x66, + 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, + 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x22, 0x47, 0x0a, 0x11, 0x46, 0x72, 0x69, 0x65, 0x6e, + 0x64, 0x44, 0x65, 0x6c, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x52, 0x73, 0x70, 0x12, 0x1a, 0x0a, 0x08, + 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, + 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, + 0x22, 0x2e, 0x0a, 0x10, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, + 0x65, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, + 0x22, 0x46, 0x0a, 0x10, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, + 0x65, 0x52, 0x73, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, + 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x2b, 0x0a, 0x0d, 0x46, 0x72, 0x69, 0x65, + 0x6e, 0x64, 0x47, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x72, 0x69, + 0x65, 0x6e, 0x64, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x72, 0x69, + 0x65, 0x6e, 0x64, 0x49, 0x64, 0x22, 0x43, 0x0a, 0x0d, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x47, + 0x69, 0x76, 0x65, 0x52, 0x73, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, + 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, + 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x2c, 0x0a, 0x0e, 0x46, 0x72, + 0x69, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, + 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x22, 0x42, 0x0a, 0x0e, 0x46, 0x72, 0x69, 0x65, + 0x6e, 0x64, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x73, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x72, + 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x72, + 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x06, 0x5a, 0x04, + 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1226,41 +1494,46 @@ func file_friend_friend_msg_proto_rawDescGZIP() []byte { return file_friend_friend_msg_proto_rawDescData } -var file_friend_friend_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 21) +var file_friend_friend_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 27) var file_friend_friend_msg_proto_goTypes = []interface{}{ - (*FriendBase)(nil), // 0: FriendBase - (*FriendListReq)(nil), // 1: FriendListReq - (*FriendListRsp)(nil), // 2: FriendListRsp - (*FriendApplyReq)(nil), // 3: FriendApplyReq - (*FriendApplyRsp)(nil), // 4: FriendApplyRsp - (*FriendDelReq)(nil), // 5: FriendDelReq - (*FriendDelRsp)(nil), // 6: FriendDelRsp - (*FriendAgreeOrRefuseReq)(nil), // 7: FriendAgreeOrRefuseReq - (*FriendAgressOrRefuseRsp)(nil), // 8: FriendAgressOrRefuseRsp - (*FriendApplyListReq)(nil), // 9: FriendApplyListReq - (*FriendApplyListRsp)(nil), // 10: FriendApplyListRsp - (*FriendSearchReq)(nil), // 11: FriendSearchReq - (*FriendSearchRsp)(nil), // 12: FriendSearchRsp - (*FriendBlackListReq)(nil), // 13: FriendBlackListReq - (*FriendBlackListRsp)(nil), // 14: FriendBlackListRsp - (*FriendBlackAddReq)(nil), // 15: FriendBlackAddReq - (*FriendBlackAddRsp)(nil), // 16: FriendBlackAddRsp - (*FriendReceiveOrSendReq)(nil), // 17: FriendReceiveOrSendReq - (*FriendReceiveOrSendRsp)(nil), // 18: FriendReceiveOrSendRsp - (*FriendTotalReq)(nil), // 19: FriendTotalReq - (*FriendTotalRsp)(nil), // 20: FriendTotalRsp - (*Cache_FriendData)(nil), // 21: Cache_FriendData + (*FriendBase)(nil), // 0: FriendBase + (*FriendListReq)(nil), // 1: FriendListReq + (*FriendListRsp)(nil), // 2: FriendListRsp + (*FriendApplyReq)(nil), // 3: FriendApplyReq + (*FriendApplyRsp)(nil), // 4: FriendApplyRsp + (*FriendDelReq)(nil), // 5: FriendDelReq + (*FriendDelRsp)(nil), // 6: FriendDelRsp + (*FriendAgreeReq)(nil), // 7: FriendAgreeReq + (*FriendAgreeRsp)(nil), // 8: FriendAgreeRsp + (*FriendRefuseReq)(nil), // 9: FriendRefuseReq + (*FriendRefuseRsp)(nil), // 10: FriendRefuseRsp + (*FriendApplyListReq)(nil), // 11: FriendApplyListReq + (*FriendApplyListRsp)(nil), // 12: FriendApplyListRsp + (*FriendSearchReq)(nil), // 13: FriendSearchReq + (*FriendSearchRsp)(nil), // 14: FriendSearchRsp + (*FriendBlackListReq)(nil), // 15: FriendBlackListReq + (*FriendBlackListRsp)(nil), // 16: FriendBlackListRsp + (*FriendBlackAddReq)(nil), // 17: FriendBlackAddReq + (*FriendBlackAddRsp)(nil), // 18: FriendBlackAddRsp + (*FriendDelBlackReq)(nil), // 19: FriendDelBlackReq + (*FriendDelBlackRsp)(nil), // 20: FriendDelBlackRsp + (*FriendReceiveReq)(nil), // 21: FriendReceiveReq + (*FriendReceiveRsp)(nil), // 22: FriendReceiveRsp + (*FriendGiveReq)(nil), // 23: FriendGiveReq + (*FriendGiveRsp)(nil), // 24: FriendGiveRsp + (*FriendTotalReq)(nil), // 25: FriendTotalReq + (*FriendTotalRsp)(nil), // 26: FriendTotalRsp } var file_friend_friend_msg_proto_depIdxs = []int32{ - 21, // 0: FriendListRsp.list:type_name -> Cache_FriendData - 0, // 1: FriendApplyListRsp.list:type_name -> FriendBase - 0, // 2: FriendSearchRsp.friends:type_name -> FriendBase - 0, // 3: FriendBlackListRsp.friends:type_name -> FriendBase - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 0, // 0: FriendListRsp.list:type_name -> FriendBase + 0, // 1: FriendApplyListRsp.list:type_name -> FriendBase + 0, // 2: FriendSearchRsp.friend:type_name -> FriendBase + 0, // 3: FriendBlackListRsp.friends:type_name -> FriendBase + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_friend_friend_msg_proto_init() } @@ -1268,7 +1541,6 @@ func file_friend_friend_msg_proto_init() { if File_friend_friend_msg_proto != nil { return } - file_friend_friend_db_proto_init() if !protoimpl.UnsafeEnabled { file_friend_friend_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FriendBase); i { @@ -1355,7 +1627,7 @@ func file_friend_friend_msg_proto_init() { } } file_friend_friend_msg_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FriendAgreeOrRefuseReq); i { + switch v := v.(*FriendAgreeReq); i { case 0: return &v.state case 1: @@ -1367,7 +1639,7 @@ func file_friend_friend_msg_proto_init() { } } file_friend_friend_msg_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FriendAgressOrRefuseRsp); i { + switch v := v.(*FriendAgreeRsp); i { case 0: return &v.state case 1: @@ -1379,7 +1651,7 @@ func file_friend_friend_msg_proto_init() { } } file_friend_friend_msg_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FriendApplyListReq); i { + switch v := v.(*FriendRefuseReq); i { case 0: return &v.state case 1: @@ -1391,7 +1663,7 @@ func file_friend_friend_msg_proto_init() { } } file_friend_friend_msg_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FriendApplyListRsp); i { + switch v := v.(*FriendRefuseRsp); i { case 0: return &v.state case 1: @@ -1403,7 +1675,7 @@ func file_friend_friend_msg_proto_init() { } } file_friend_friend_msg_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FriendSearchReq); i { + switch v := v.(*FriendApplyListReq); i { case 0: return &v.state case 1: @@ -1415,7 +1687,7 @@ func file_friend_friend_msg_proto_init() { } } file_friend_friend_msg_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FriendSearchRsp); i { + switch v := v.(*FriendApplyListRsp); i { case 0: return &v.state case 1: @@ -1427,7 +1699,7 @@ func file_friend_friend_msg_proto_init() { } } file_friend_friend_msg_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FriendBlackListReq); i { + switch v := v.(*FriendSearchReq); i { case 0: return &v.state case 1: @@ -1439,7 +1711,7 @@ func file_friend_friend_msg_proto_init() { } } file_friend_friend_msg_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FriendBlackListRsp); i { + switch v := v.(*FriendSearchRsp); i { case 0: return &v.state case 1: @@ -1451,7 +1723,7 @@ func file_friend_friend_msg_proto_init() { } } file_friend_friend_msg_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FriendBlackAddReq); i { + switch v := v.(*FriendBlackListReq); i { case 0: return &v.state case 1: @@ -1463,7 +1735,7 @@ func file_friend_friend_msg_proto_init() { } } file_friend_friend_msg_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FriendBlackAddRsp); i { + switch v := v.(*FriendBlackListRsp); i { case 0: return &v.state case 1: @@ -1475,7 +1747,7 @@ func file_friend_friend_msg_proto_init() { } } file_friend_friend_msg_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FriendReceiveOrSendReq); i { + switch v := v.(*FriendBlackAddReq); i { case 0: return &v.state case 1: @@ -1487,7 +1759,7 @@ func file_friend_friend_msg_proto_init() { } } file_friend_friend_msg_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FriendReceiveOrSendRsp); i { + switch v := v.(*FriendBlackAddRsp); i { case 0: return &v.state case 1: @@ -1499,7 +1771,7 @@ func file_friend_friend_msg_proto_init() { } } file_friend_friend_msg_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FriendTotalReq); i { + switch v := v.(*FriendDelBlackReq); i { case 0: return &v.state case 1: @@ -1511,6 +1783,78 @@ func file_friend_friend_msg_proto_init() { } } file_friend_friend_msg_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FriendDelBlackRsp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_friend_friend_msg_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FriendReceiveReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_friend_friend_msg_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FriendReceiveRsp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_friend_friend_msg_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FriendGiveReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_friend_friend_msg_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FriendGiveRsp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_friend_friend_msg_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FriendTotalReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_friend_friend_msg_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FriendTotalRsp); i { case 0: return &v.state @@ -1529,7 +1873,7 @@ func file_friend_friend_msg_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_friend_friend_msg_proto_rawDesc, NumEnums: 0, - NumMessages: 21, + NumMessages: 27, NumExtensions: 0, NumServices: 0, }, diff --git a/pb/proto/errorcode.proto b/pb/proto/errorcode.proto index aa9b1b11d..d095cd53d 100644 --- a/pb/proto/errorcode.proto +++ b/pb/proto/errorcode.proto @@ -32,4 +32,5 @@ enum ErrorCode { FriendSelfBlackYet = 1107;//已在自己黑名单中 FriendTargetBlackYet = 1108;//已在对方的黑名单中 FriendApplyError = 1109;//申请失败 + FriendBlackMax = 1110; //黑名单最大数量 } \ No newline at end of file diff --git a/pb/proto/friend/friend_msg.proto b/pb/proto/friend/friend_msg.proto index 67f9f70a8..924a40e3c 100644 --- a/pb/proto/friend/friend_msg.proto +++ b/pb/proto/friend/friend_msg.proto @@ -1,6 +1,5 @@ syntax = "proto3"; option go_package = ".;pb"; -import "friend/friend_db.proto"; message FriendBase { string userId = 1; //ID @@ -18,7 +17,7 @@ message FriendListReq{ } message FriendListRsp{ - repeated Cache_FriendData list = 1; + repeated FriendBase list = 1; } //申请好友 @@ -41,15 +40,20 @@ message FriendDelRsp{ string userId = 2; //用户ID } -//同意或拒绝 -message FriendAgreeOrRefuseReq{ - string friendId = 1; //被同意或拒绝的用户 - bool isAgree = 2; - +//同意 +message FriendAgreeReq{ + repeated string friendIds = 1; //被同意的用户 } -message FriendAgressOrRefuseRsp{ +message FriendAgreeRsp{ + int32 Num = 1;//操作的数量 +} + +//拒绝 +message FriendRefuseReq{ + repeated string friendIds = 1; //被拒绝的用户 +} +message FriendRefuseRsp{ int32 Num = 1;//操作的数量 - bool isAgree = 2; } @@ -63,12 +67,11 @@ message FriendApplyListRsp{ //好友搜索 message FriendSearchReq{ - string friendId = 1; - string nickName = 2; //好友昵称 + string nickName = 1; //好友昵称 } message FriendSearchRsp{ - repeated FriendBase friends = 1; + FriendBase friend = 1; } //黑名单 @@ -90,18 +93,37 @@ message FriendBlackAddRsp{ string userId = 2; } -//赠送或接收 -message FriendReceiveOrSendReq{ +//删除黑名单 +message FriendDelBlackReq{ string friendId = 1; - bool isReceive = 2; } -message FriendReceiveOrSendRsp{ +message FriendDelBlackRsp{ string friendId = 1; string userId = 2; - bool isReceive = 3; } +//接收 +message FriendReceiveReq{ + string friendId = 1; +} + +message FriendReceiveRsp{ + string friendId = 1; + string userId = 2; +} + +//赠送 +message FriendGiveReq{ + string friendId = 1; +} + +message FriendGiveRsp{ + string friendId = 1; + string userId = 2; +} + + //好友数量 message FriendTotalReq{ string friendId = 1; diff --git a/pb/proto/user/user_db.proto b/pb/proto/user/user_db.proto index 8af1ddedd..a2851297b 100644 --- a/pb/proto/user/user_db.proto +++ b/pb/proto/user/user_db.proto @@ -8,7 +8,7 @@ message Cache_UserData { } message DB_UserData { - string UserId = 1; //tags:{bson:"_id"}动态Id + string UserId = 1; // @go_tags(`bson:"_id"`) ID string Account = 2; string NiceName = 3; int32 ServerId = 4; diff --git a/sys/cache/friend.go b/sys/cache/friend.go index c21d472bd..628096486 100644 --- a/sys/cache/friend.go +++ b/sys/cache/friend.go @@ -17,14 +17,15 @@ func getRdsFriendKey(userId string) string { } type IFriend interface { - Friend_Apply(data *pb.Cache_FriendData) (err error) + Friend_Update(data *pb.Cache_FriendData) (err error) Friend_Total(userId string) int32 Friend_Get(userId string) (*pb.Cache_FriendData, error) } -//好友申请 -func (this *Cache) Friend_Apply(data *pb.Cache_FriendData) (err error) { - if err = db.Defsys.Friend_Apply(data); err == nil { +//更新 +func (this *Cache) Friend_Update(data *pb.Cache_FriendData) (err error) { + if err = db.Defsys.Friend_SaveOrUpdate(data); err == nil { + //更新缓存 err = this.redis.Set(getRdsFriendKey(data.UserId), data, 0) } return @@ -47,7 +48,7 @@ func (this *Cache) Friend_Get(userId string) (*pb.Cache_FriendData, error) { if err != nil { if err.Error() == string(redis.RedisNil) { d = &pb.Cache_FriendData{UserId: userId} - err = this.Friend_Apply(d) + err = this.Friend_Update(d) if err != nil { return d, nil } diff --git a/sys/cache/friend_test.go b/sys/cache/friend_test.go index 59e673dd9..cdf51022b 100644 --- a/sys/cache/friend_test.go +++ b/sys/cache/friend_test.go @@ -10,7 +10,7 @@ import ( ) func TestFriendApply(t *testing.T) { - err := cache.Defsys.Friend_Apply(&pb.Cache_FriendData{ + err := cache.Defsys.Friend_Update(&pb.Cache_FriendData{ UserId: "629f159310d6970846f7ef26", FriendIds: []string{"629f147e3d276120561bfa18"}, ApplyIds: []string{"629eb3f4132dc4bb26139659"}, diff --git a/sys/cache/user.go b/sys/cache/user.go index 38e5e0c81..d2074c4f6 100644 --- a/sys/cache/user.go +++ b/sys/cache/user.go @@ -3,6 +3,7 @@ package cache import ( "fmt" "go_dreamfactory/pb" + "go_dreamfactory/sys/db" "go_dreamfactory/lego/sys/log" ) @@ -17,7 +18,10 @@ type IUser interface { } func (this *Cache) Update(data *pb.Cache_UserData) (err error) { - err = this.redis.Set(fmt.Sprintf(Redis_UserCache, data.UserData.UserId), data, -1) + err = db.Defsys.User_Update(data.UserData) + if err == nil { + err = this.redis.Set(fmt.Sprintf(Redis_UserCache, data.UserData.UserId), data, -1) + } return } diff --git a/sys/db/friend.go b/sys/db/friend.go index ba0924330..48336a8b9 100644 --- a/sys/db/friend.go +++ b/sys/db/friend.go @@ -2,6 +2,7 @@ package db import ( "go_dreamfactory/lego/core" + "go_dreamfactory/lego/sys/log" "go_dreamfactory/pb" "go.mongodb.org/mongo-driver/bson" @@ -14,11 +15,12 @@ const ( ) type IFriend interface { - Friend_Apply(data *pb.Cache_FriendData) (err error) + Friend_SaveOrUpdate(data *pb.Cache_FriendData) (err error) + Frined_FindCond(nickName string) *pb.DB_UserData } -//好友申请 -func (this *DB) Friend_Apply(data *pb.Cache_FriendData) (err error) { +//好友 +func (this *DB) Friend_SaveOrUpdate(data *pb.Cache_FriendData) (err error) { err = this.mgo.FindOneAndUpdate(DB_FriendTable, bson.M{"_id": data.UserId}, bson.M{"$set": bson.M{ @@ -32,3 +34,15 @@ func (this *DB) Friend_Apply(data *pb.Cache_FriendData) (err error) { } return } + +func (this *DB) Frined_FindCond(nickName string) *pb.DB_UserData { + var user *pb.DB_UserData + err := this.mgo.FindOne(DB_UserTable, bson.M{ + "nicename": nickName, + }).Decode(&user) + if err != nil { + log.Errorf("findCond err:%v", err) + return nil + } + return user +} diff --git a/sys/db/friend_test.go b/sys/db/friend_test.go index b86c09c46..9d8b10f0c 100644 --- a/sys/db/friend_test.go +++ b/sys/db/friend_test.go @@ -1,6 +1,7 @@ package db import ( + "fmt" "go_dreamfactory/pb" "testing" @@ -8,7 +9,7 @@ import ( ) func TestFriendAdd(t *testing.T) { - err := db.Friend_Apply(&pb.Cache_FriendData{ + err := db.Friend_SaveOrUpdate(&pb.Cache_FriendData{ UserId: "629f159310d6970846f7ef26", FriendIds: []string{ "629f147e3d276120561bfa18", @@ -17,3 +18,10 @@ func TestFriendAdd(t *testing.T) { require.Nil(t, err, nil) } + +func TestFriendFindCond(t *testing.T) { + user := db.Frined_FindCond("乐谷5") + require.NotNil(t, user, nil) + + fmt.Printf("%v", user) +} diff --git a/sys/db/user.go b/sys/db/user.go index 3f897dae0..c20bd4301 100644 --- a/sys/db/user.go +++ b/sys/db/user.go @@ -35,7 +35,7 @@ func (this *DB) User_FindByAccount(user *pb.DB_UserData) (*pb.DB_UserData, error func (this *DB) User_FindById(id string) (*pb.DB_UserData, error) { filter := bson.M{ - "_id": id, + "userid": id, } sr := this.mgo.FindOne(DB_UserTable, filter) user := &pb.DB_UserData{} @@ -53,11 +53,11 @@ func (this *DB) User_Create(user *pb.DB_UserData) (err error) { func (this *DB) User_Update(data *pb.DB_UserData) (err error) { err = this.mgo.FindOneAndUpdate( DB_UserTable, - bson.M{"_id": data.UserId}, + bson.M{"userid": data.UserId}, bson.M{"$set": bson.M{ - "niceName": data.NiceName, + "nicename": data.NiceName, }}, - options.FindOneAndUpdate().SetUpsert(false).SetReturnDocument(options.After), - ).Decode(data) + options.FindOneAndUpdate().SetUpsert(true), + ).Err() return err } diff --git a/utils/strings.go b/utils/strings.go index 82dcea71e..c153704d4 100644 --- a/utils/strings.go +++ b/utils/strings.go @@ -16,12 +16,21 @@ func ParseP(p string) (string, string, bool) { return s[0], s[1], true } - func Find(slice []string, val string) (int, bool) { - for i, item := range slice { - if item == val { - return i, true - } - } - return -1, false -} \ No newline at end of file + for i, item := range slice { + if item == val { + return i, true + } + } + return -1, false +} + +func DeleteString(list []string, ele string) []string { + result := make([]string, 0) + for _, v := range list { + if v != ele { + result = append(result, v) + } + } + return result +}