好友系统-申请列表
This commit is contained in:
parent
b9f36e1e32
commit
f0fbbb13c1
@ -154,6 +154,20 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.FriendApplyReq) (e
|
|||||||
log.Field{Key: "err", Value: err.Error()},
|
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{
|
resp := &pb.FriendApplyResp{
|
||||||
UserId: session.GetUserId(),
|
UserId: session.GetUserId(),
|
||||||
FriendId: req.FriendId,
|
FriendId: req.FriendId,
|
||||||
|
@ -405,7 +405,6 @@ type DBXXLData struct {
|
|||||||
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)
|
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"` // 刷新时间 (客户端不用)
|
Rtime int64 `protobuf:"varint,5,opt,name=rtime,proto3" json:"rtime"` // 刷新时间 (客户端不用)
|
||||||
Playtype []int32 `protobuf:"varint,6,rep,packed,name=playtype,proto3" json:"playtype"` // 每天随机玩法
|
Playtype []int32 `protobuf:"varint,6,rep,packed,name=playtype,proto3" json:"playtype"` // 每天随机玩法
|
||||||
// map<int32,int64> boxid = 7; // 宝箱 key 宝箱id value 可领取的时间
|
|
||||||
Box []*BoxData `protobuf:"bytes,7,rep,name=box,proto3" json:"box"`
|
Box []*BoxData `protobuf:"bytes,7,rep,name=box,proto3" json:"box"`
|
||||||
Roomid string `protobuf:"bytes,8,opt,name=roomid,proto3" json:"roomid"` // 房间id 重连用
|
Roomid string `protobuf:"bytes,8,opt,name=roomid,proto3" json:"roomid"` // 房间id 重连用
|
||||||
ServicePath string `protobuf:"bytes,9,opt,name=servicePath,proto3" json:"servicePath"` // 目标服务节点 重连RPC用
|
ServicePath string `protobuf:"bytes,9,opt,name=servicePath,proto3" json:"servicePath"` // 目标服务节点 重连RPC用
|
||||||
|
@ -39,6 +39,7 @@ type DBFriend struct {
|
|||||||
Hero *DBHero `protobuf:"bytes,12,opt,name=hero,proto3" json:"hero" bson:"hero"` //助战英雄副本
|
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"` //助战分数合计
|
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"` // 助战记录
|
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() {
|
func (x *DBFriend) Reset() {
|
||||||
@ -171,6 +172,13 @@ func (x *DBFriend) GetRecord() []*AssistRecord {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *DBFriend) GetWeapplyids() []string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Weapplyids
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
//助战记录
|
//助战记录
|
||||||
type AssistRecord struct {
|
type AssistRecord struct {
|
||||||
state protoimpl.MessageState
|
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,
|
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,
|
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,
|
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,
|
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,
|
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,
|
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,
|
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,
|
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,
|
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, 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,
|
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,
|
0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x73, 0x73, 0x69, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02,
|
||||||
|
Loading…
Reference in New Issue
Block a user