From 60a36c51b7139b6215c524e59f8db5080a4684b1 Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Thu, 20 Oct 2022 17:33:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A9=E6=88=98=E8=8B=B1=E9=9B=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/imodule.go | 2 +- modules/friend/module.go | 4 ++-- pb/friend_db.pb.go | 18 +++++++++--------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/comm/imodule.go b/comm/imodule.go index e082762fb..8ac6d876a 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -154,7 +154,7 @@ type ( // 获取好友列表 GetFriendList(uid string) []string // 使用好友助战英雄 好友ID:friendId - UseAssistHero(uid, nickName, friendId string) (*pb.DBHero, error) + UseAssistHero(uid, friendId string) (*pb.DBHero, error) } //聊天系统 diff --git a/modules/friend/module.go b/modules/friend/module.go index fd83055d6..0d1f468fe 100644 --- a/modules/friend/module.go +++ b/modules/friend/module.go @@ -78,7 +78,7 @@ func (this *Friend) GetFriendList(uid string) (uids []string) { } // 使用好友助战英雄 -func (this *Friend) UseAssistHero(uid, nickName, friendId string) (*pb.DBHero, error) { +func (this *Friend) UseAssistHero(uid, friendId string) (*pb.DBHero, error) { //指定好友 friend := this.modelFriend.GetFriend(friendId) @@ -88,7 +88,7 @@ func (this *Friend) UseAssistHero(uid, nickName, friendId string) (*pb.DBHero, e //更新助战记录和助战分数 friend.ZhuzhanScore++ friend.Record = append(friend.Record, &pb.ZhuZhanRecord{ - Name: nickName, + Uid: uid, Zhuzhantime: time.Now().Unix(), }) update := map[string]interface{}{ diff --git a/pb/friend_db.pb.go b/pb/friend_db.pb.go index 321dcdf25..bf7f69922 100644 --- a/pb/friend_db.pb.go +++ b/pb/friend_db.pb.go @@ -161,7 +161,7 @@ type ZhuZhanRecord struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name" bson:"name"` //好友昵称 + Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid" bson:"uid"` //好友Id Zhuzhantime int64 `protobuf:"varint,2,opt,name=zhuzhantime,proto3" json:"zhuzhantime" bson:"zhuzhanTime"` //上次助战时间 } @@ -197,9 +197,9 @@ func (*ZhuZhanRecord) Descriptor() ([]byte, []int) { return file_friend_friend_db_proto_rawDescGZIP(), []int{1} } -func (x *ZhuZhanRecord) GetName() string { +func (x *ZhuZhanRecord) GetUid() string { if x != nil { - return x.Name + return x.Uid } return "" } @@ -240,12 +240,12 @@ var file_friend_friend_db_proto_rawDesc = []byte{ 0x75, 0x7a, 0x68, 0x61, 0x6e, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x5a, 0x68, 0x75, 0x5a, 0x68, 0x61, 0x6e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, - 0x72, 0x64, 0x22, 0x45, 0x0a, 0x0d, 0x5a, 0x68, 0x75, 0x5a, 0x68, 0x61, 0x6e, 0x52, 0x65, 0x63, - 0x6f, 0x72, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x7a, 0x68, 0x75, 0x7a, 0x68, - 0x61, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x7a, 0x68, - 0x75, 0x7a, 0x68, 0x61, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, - 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x64, 0x22, 0x43, 0x0a, 0x0d, 0x5a, 0x68, 0x75, 0x5a, 0x68, 0x61, 0x6e, 0x52, 0x65, 0x63, + 0x6f, 0x72, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x7a, 0x68, 0x75, 0x7a, 0x68, 0x61, 0x6e, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x7a, 0x68, 0x75, 0x7a, + 0x68, 0x61, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var (