49 lines
996 B
Go
49 lines
996 B
Go
package friend
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/pb"
|
|
|
|
"google.golang.org/protobuf/proto"
|
|
)
|
|
|
|
func (this *apiComp) BlacklistCheck(session comm.IUserSession, req *pb.FriendBlackListReq) (code pb.ErrorCode) {
|
|
return
|
|
}
|
|
|
|
//黑名单
|
|
func (this *apiComp) Blacklist(session comm.IUserSession, req *pb.FriendBlackListReq) (code pb.ErrorCode, data proto.Message) {
|
|
var (
|
|
self *pb.DBFriend
|
|
Resp *pb.FriendBlackListResp
|
|
list []*pb.FriendBase
|
|
)
|
|
|
|
defer func() {
|
|
Resp = &pb.FriendBlackListResp{
|
|
Friends: list,
|
|
}
|
|
|
|
err := session.SendMsg(string(this.moduleFriend.GetType()), FriendSubTypeBlacklist, Resp)
|
|
if err != nil {
|
|
code = pb.ErrorCode_SystemError
|
|
return
|
|
}
|
|
}()
|
|
|
|
self = this.moduleFriend.modelFriend.GetFriend(session.GetUserId())
|
|
if self == nil {
|
|
code = pb.ErrorCode_FriendSelfNoData
|
|
return
|
|
}
|
|
|
|
for _, userId := range self.BlackIds {
|
|
base := this.setDefaultFriendUserBaseInfo(userId)
|
|
if base != nil {
|
|
list = append(list, base)
|
|
}
|
|
}
|
|
|
|
return
|
|
}
|