48 lines
1.0 KiB
Go
48 lines
1.0 KiB
Go
package friend
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/pb"
|
|
|
|
"google.golang.org/protobuf/proto"
|
|
)
|
|
|
|
func (this *apiComp) ApplyListCheck(session comm.IUserSession, req *pb.FriendApplyListReq) (code pb.ErrorCode) {
|
|
return
|
|
}
|
|
|
|
//申请列表
|
|
func (this *apiComp) ApplyList(session comm.IUserSession, req *pb.FriendApplyListReq) (code pb.ErrorCode, data proto.Message) {
|
|
var (
|
|
self *pb.DBFriend
|
|
Resp *pb.FriendApplyListResp
|
|
list []*pb.FriendBase
|
|
)
|
|
|
|
defer func() {
|
|
if code == pb.ErrorCode_Success {
|
|
Resp = &pb.FriendApplyListResp{
|
|
List: list,
|
|
}
|
|
}
|
|
if err := session.SendMsg(string(this.moduleFriend.GetType()), FriendSubTypeApplyList, Resp); err != nil {
|
|
code = pb.ErrorCode_SystemError
|
|
}
|
|
}()
|
|
|
|
self = this.moduleFriend.modelFriend.GetFriend(session.GetUserId())
|
|
if self == nil {
|
|
code = pb.ErrorCode_FriendSelfNoData
|
|
return
|
|
}
|
|
|
|
for _, userId := range self.ApplyIds {
|
|
base := this.setDefaultFriendUserBaseInfo(userId)
|
|
if base != nil {
|
|
list = append(list, base)
|
|
}
|
|
}
|
|
|
|
return
|
|
}
|