go_dreamfactory/modules/friend/api_blacklist.go
2022-06-15 19:25:55 +08:00

45 lines
984 B
Go

package friend
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
)
func (this *ApiComp) Blacklist_Check(session comm.IUserSession, req *pb.FriendBlackListReq) (chk map[string]interface{}, code pb.ErrorCode) {
return
}
//黑名单
func (this *ApiComp) Blacklist(session comm.IUserSession, chk map[string]interface{}, req *pb.FriendBlackListReq) (err error) {
var (
code pb.ErrorCode
self *pb.DB_FriendData
rsp *pb.FriendBlackListRsp
list []*pb.FriendBase
)
defer func() {
if code == pb.ErrorCode_Success {
rsp = &pb.FriendBlackListRsp{
Friends: list,
}
}
session.SendMsg(string(this.module.GetType()), Friend_SubType_Blacklist, code, rsp)
}()
err = this.module.model_friend.GetObj(session.GetUserId(), self)
if self == nil || err != nil {
code = pb.ErrorCode_FriendSelfNoData
return
}
for _, userId := range self.BlackIds {
//TODO 完善FriendBase信息
list = append(list, &pb.FriendBase{
UserId: userId,
})
}
return nil
}