package sociaty import ( "go_dreamfactory/comm" "go_dreamfactory/lego/sys/log" "go_dreamfactory/pb" "google.golang.org/protobuf/proto" ) // 公会BOSS 赛季排行榜 func (this *apiComp) BrankCheck(session comm.IUserSession, req *pb.SociatyBRankReq) (code pb.ErrorCode) { return } func (this *apiComp) Brank(session comm.IUserSession, req *pb.SociatyBRankReq) (code pb.ErrorCode, data proto.Message) { if code = this.BrankCheck(session, req); code != pb.ErrorCode_Success { return } uid := session.GetUserId() sociaty := this.module.modelSociaty.getUserSociaty(uid) if sociaty != nil && sociaty.Id == "" { code = pb.ErrorCode_SociatyNoFound this.module.Error("当前玩家所在的公会未找到", log.Field{Key: "uid", Value: uid}) return } sri := this.module.modelSociatyBoss.rank(sociaty.Name, req.RankType) rsp := &pb.SociatyBRankResp{ Rank: sri, } if err := session.SendMsg(string(this.module.GetType()), SociatySubTypeBrank, rsp); err != nil { code = pb.ErrorCode_SystemError } return }