diff --git a/modules/friend/api_cross_apply.go b/modules/friend/api_cross_apply.go index 6b56ee154..ce967054b 100644 --- a/modules/friend/api_cross_apply.go +++ b/modules/friend/api_cross_apply.go @@ -154,6 +154,20 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.FriendApplyReq) (e log.Field{Key: "err", Value: err.Error()}, ) } + if _, ok := utils.Find(self.Weapplyids, req.FriendId); !ok { + target.Weapplyids = append(target.Weapplyids, req.FriendId) + if err = this.module.modelFriend.Change(session.GetUserId(), map[string]interface{}{ + "weapplyids": target.Weapplyids, + }); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Title: pb.ErrorCode_DBError.ToString(), + Message: err.Error(), + } + return + } + } + resp := &pb.FriendApplyResp{ UserId: session.GetUserId(), FriendId: req.FriendId, diff --git a/pb/entertain_db.pb.go b/pb/entertain_db.pb.go index 58518dbf0..d4c5dc9e0 100644 --- a/pb/entertain_db.pb.go +++ b/pb/entertain_db.pb.go @@ -399,28 +399,27 @@ type DBXXLData 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" bson:"uid"` //用户ID - Reward map[int32]int32 `protobuf:"bytes,3,rep,name=reward,proto3" json:"reward" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // key 配置表唯一ID - Card map[string]int32 `protobuf:"bytes,4,rep,name=card,proto3" json:"card" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // key 卡id value 数量(可为0) - Rtime int64 `protobuf:"varint,5,opt,name=rtime,proto3" json:"rtime"` // 刷新时间 (客户端不用) - Playtype []int32 `protobuf:"varint,6,rep,packed,name=playtype,proto3" json:"playtype"` // 每天随机玩法 - // map boxid = 7; // 宝箱 key 宝箱id value 可领取的时间 - Box []*BoxData `protobuf:"bytes,7,rep,name=box,proto3" json:"box"` - Roomid string `protobuf:"bytes,8,opt,name=roomid,proto3" json:"roomid"` // 房间id 重连用 - ServicePath string `protobuf:"bytes,9,opt,name=servicePath,proto3" json:"servicePath"` // 目标服务节点 重连RPC用 - Etime int64 `protobuf:"varint,10,opt,name=etime,proto3" json:"etime"` // 赛季结束时间 - Touxiang int32 `protobuf:"varint,11,opt,name=touxiang,proto3" json:"touxiang"` // 今天投降的次数 - Skill map[int32]int32 `protobuf:"bytes,12,rep,name=skill,proto3" json:"skill" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // key 技能id value 数量(可为0) - Liansheng int32 `protobuf:"varint,13,opt,name=liansheng,proto3" json:"liansheng"` // 连胜 - Freeprogress int32 `protobuf:"varint,14,opt,name=freeprogress,proto3" json:"freeprogress"` //已领取进度 - Payprogress int32 `protobuf:"varint,15,opt,name=payprogress,proto3" json:"payprogress"` - Vip bool `protobuf:"varint,16,opt,name=vip,proto3" json:"vip"` // 是否购买 - Maxconsumeexp int32 `protobuf:"varint,17,opt,name=maxconsumeexp,proto3" json:"maxconsumeexp"` // 最大赛季积分 - Consumeexp int32 `protobuf:"varint,18,opt,name=consumeexp,proto3" json:"consumeexp"` //赛季积分 - Maxsocre int32 `protobuf:"varint,19,opt,name=maxsocre,proto3" json:"maxsocre"` // 单局最大得分 - Uinfo *BaseUserInfo `protobuf:"bytes,20,opt,name=uinfo,proto3" json:"uinfo"` //用户基础 - Taskprogess int32 `protobuf:"varint,21,opt,name=taskprogess,proto3" json:"taskprogess"` // 任务奖励进度 + 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" bson:"uid"` //用户ID + Reward map[int32]int32 `protobuf:"bytes,3,rep,name=reward,proto3" json:"reward" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // key 配置表唯一ID + Card map[string]int32 `protobuf:"bytes,4,rep,name=card,proto3" json:"card" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // key 卡id value 数量(可为0) + Rtime int64 `protobuf:"varint,5,opt,name=rtime,proto3" json:"rtime"` // 刷新时间 (客户端不用) + Playtype []int32 `protobuf:"varint,6,rep,packed,name=playtype,proto3" json:"playtype"` // 每天随机玩法 + Box []*BoxData `protobuf:"bytes,7,rep,name=box,proto3" json:"box"` + Roomid string `protobuf:"bytes,8,opt,name=roomid,proto3" json:"roomid"` // 房间id 重连用 + ServicePath string `protobuf:"bytes,9,opt,name=servicePath,proto3" json:"servicePath"` // 目标服务节点 重连RPC用 + Etime int64 `protobuf:"varint,10,opt,name=etime,proto3" json:"etime"` // 赛季结束时间 + Touxiang int32 `protobuf:"varint,11,opt,name=touxiang,proto3" json:"touxiang"` // 今天投降的次数 + Skill map[int32]int32 `protobuf:"bytes,12,rep,name=skill,proto3" json:"skill" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // key 技能id value 数量(可为0) + Liansheng int32 `protobuf:"varint,13,opt,name=liansheng,proto3" json:"liansheng"` // 连胜 + Freeprogress int32 `protobuf:"varint,14,opt,name=freeprogress,proto3" json:"freeprogress"` //已领取进度 + Payprogress int32 `protobuf:"varint,15,opt,name=payprogress,proto3" json:"payprogress"` + Vip bool `protobuf:"varint,16,opt,name=vip,proto3" json:"vip"` // 是否购买 + Maxconsumeexp int32 `protobuf:"varint,17,opt,name=maxconsumeexp,proto3" json:"maxconsumeexp"` // 最大赛季积分 + Consumeexp int32 `protobuf:"varint,18,opt,name=consumeexp,proto3" json:"consumeexp"` //赛季积分 + Maxsocre int32 `protobuf:"varint,19,opt,name=maxsocre,proto3" json:"maxsocre"` // 单局最大得分 + Uinfo *BaseUserInfo `protobuf:"bytes,20,opt,name=uinfo,proto3" json:"uinfo"` //用户基础 + Taskprogess int32 `protobuf:"varint,21,opt,name=taskprogess,proto3" json:"taskprogess"` // 任务奖励进度 } func (x *DBXXLData) Reset() { diff --git a/pb/friend_db.pb.go b/pb/friend_db.pb.go index 2b203750a..a09beea2f 100644 --- a/pb/friend_db.pb.go +++ b/pb/friend_db.pb.go @@ -39,6 +39,7 @@ type DBFriend struct { Hero *DBHero `protobuf:"bytes,12,opt,name=hero,proto3" json:"hero" bson:"hero"` //助战英雄副本 AssistScore int32 `protobuf:"varint,13,opt,name=assistScore,proto3" json:"assistScore" bson:"assistScore"` //助战分数合计 Record []*AssistRecord `protobuf:"bytes,14,rep,name=record,proto3" json:"record" bson:"record"` // 助战记录 + Weapplyids []string `protobuf:"bytes,15,rep,name=weapplyids,proto3" json:"weapplyids" bson:"weapplyids"` //我申请的用户ID } func (x *DBFriend) Reset() { @@ -171,6 +172,13 @@ func (x *DBFriend) GetRecord() []*AssistRecord { return nil } +func (x *DBFriend) GetWeapplyids() []string { + if x != nil { + return x.Weapplyids + } + return nil +} + //助战记录 type AssistRecord struct { state protoimpl.MessageState @@ -329,7 +337,7 @@ var file_friend_friend_db_proto_rawDesc = []byte{ 0x0a, 0x16, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2f, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x12, 0x68, 0x65, 0x72, 0x6f, 0x2f, 0x68, 0x65, 0x72, 0x6f, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0a, 0x63, 0x6f, - 0x6d, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa3, 0x03, 0x0a, 0x08, 0x44, 0x42, 0x46, + 0x6d, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc3, 0x03, 0x0a, 0x08, 0x44, 0x42, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, @@ -355,7 +363,9 @@ var file_friend_friend_db_proto_rawDesc = []byte{ 0x63, 0x6f, 0x72, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x61, 0x73, 0x73, 0x69, 0x73, 0x74, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x25, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x41, 0x73, 0x73, 0x69, 0x73, 0x74, - 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, 0x64, + 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x1e, + 0x0a, 0x0a, 0x77, 0x65, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x69, 0x64, 0x73, 0x18, 0x0f, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x0a, 0x77, 0x65, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x69, 0x64, 0x73, 0x22, 0x64, 0x0a, 0x0c, 0x41, 0x73, 0x73, 0x69, 0x73, 0x74, 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, 0x1e, 0x0a, 0x0a, 0x61, 0x73, 0x73, 0x69, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02,