From 34de6aa72dc8ec3ac44e479ba7c832c93feb7be9 Mon Sep 17 00:00:00 2001 From: liwei <2211068034@qq.com> Date: Mon, 26 Jun 2023 17:43:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E7=AB=9E=E6=8A=80=E5=9C=BA?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=98=B2=E5=AE=88=E9=98=B5=E5=9E=8B=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/arena/api_setdefformt.go | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/modules/arena/api_setdefformt.go b/modules/arena/api_setdefformt.go index c1743b1a9..d75f85346 100644 --- a/modules/arena/api_setdefformt.go +++ b/modules/arena/api_setdefformt.go @@ -5,13 +5,29 @@ import ( "go_dreamfactory/pb" ) -//参数校验 +// 参数校验 func (this *apiComp) SetDefFormtCheck(session comm.IUserSession, req *pb.ArenaSetDefFormtReq) (errdata *pb.ErrorData) { - + if len(req.Formt) == 0 { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_DBError.ToString(), + Message: "阵容 不能为空!", + } + } + for _, v := range req.Formt { + if v != "" { + return + } + } + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_DBError.ToString(), + Message: "阵容 不能为空!", + } return } -///设置防守阵型 +// /设置防守阵型 func (this *apiComp) SetDefFormt(session comm.IUserSession, req *pb.ArenaSetDefFormtReq) (errdata *pb.ErrorData) { var ( info *pb.DBArenaUser @@ -51,7 +67,6 @@ func (this *apiComp) SetDefFormt(session comm.IUserSession, req *pb.ArenaSetDefF Title: pb.ErrorCode_DBError.ToString(), Message: err.Error(), } - return } session.SendMsg(string(this.module.GetType()), "setdefformt", &pb.ArenaSetDefFormtResp{Issucc: true})