From dd93a8956b6d26e452659f65c067f49dcae501af Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Fri, 25 Aug 2023 17:58:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=85=AC=E4=BC=9A=E5=90=8C?= =?UTF-8?q?=E6=84=8Fcd=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/sociaty/api_cross_agree.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/modules/sociaty/api_cross_agree.go b/modules/sociaty/api_cross_agree.go index 9969e98a1..1fdb46ad6 100644 --- a/modules/sociaty/api_cross_agree.go +++ b/modules/sociaty/api_cross_agree.go @@ -2,9 +2,11 @@ package sociaty import ( "errors" + "fmt" "go_dreamfactory/comm" "go_dreamfactory/lego/sys/log" "go_dreamfactory/pb" + "go_dreamfactory/utils" ) // 公会申请-同意 @@ -25,6 +27,26 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.SociatyAgreeReq) ( return } + // userex + userEx, err := this.module.ModuleUser.GetUserExpand(req.Uid) + if err != nil { + this.module.Error("GetRemoteUserExpand", log.Field{Key: "uid", Value: req.Uid}, log.Field{Key: "err", Value: err.Error()}) + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_UserNofound, + Title: pb.ErrorCode_UserNofound.ToString(), + } + return + } + + if utils.IsInCDHour(userEx.SociatyCd) { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_SociatyCDLimit, + Title: pb.ErrorCode_SociatyCDLimit.ToString(), + Message: fmt.Sprintf("CD内[%v]不允许申请", userEx.SociatyCd), + } + return + } + uid := session.GetUserId() sociaty := this.module.modelSociaty.getUserSociaty(uid) if sociaty == nil {