package friend import ( "go_dreamfactory/comm" "go_dreamfactory/pb" ) func (this *apiComp) ApplyListCheck(session comm.IUserSession, req *pb.Friend_ApplyList_Req) (chk map[string]interface{}, code comm.ErrorCode) { chk = make(map[string]interface{}) self := &pb.DB_FriendData{UId: session.GetUserId()} err := this.module.modelFriend.Get(session.GetUserId(), self) if self == nil || err != nil { code = comm.ErrorCode{Code: pb.ErrorCode_FriendSelfNoData} return } chk["self"] = self return } //申请列表 func (this *apiComp) ApplyList(session comm.IUserSession, chk map[string]interface{}, req *pb.Friend_ApplyList_Req) (code pb.ErrorCode) { var ( self *pb.DB_FriendData rsp *pb.Friend_ApplyList_Rsp list []*pb.FriendBase ) defer func() { if code == pb.ErrorCode_Success { rsp = &pb.Friend_ApplyList_Rsp{ List: list, } } session.SendMsg(string(this.module.GetType()), Friend_SubType_ApplyList, rsp) }() if v, ok := chk["self"]; ok { self = v.(*pb.DB_FriendData) for _, userId := range self.ApplyIds { //TODO 组装FriendBase明细数据 list = append(list, &pb.FriendBase{ UserId: userId, }) } } return }