From 65b97a090ea5001f859fcb2a1d17bbcc8a74cdd6 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Fri, 9 Jun 2023 18:14:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/imodule.go | 2 +- modules/sys/module.go | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/comm/imodule.go b/comm/imodule.go index d9f929d38..0fa45a827 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -36,7 +36,7 @@ type ( CheckTaskCond(session IUserSession, id int32) CheckMlineCond(session IUserSession, id int32) // 查询opencond 配置 - GetOpenCondCfgById(id string) (data *cfg.GameOpencondData, err error) + GetOpenCondCfgById(uid string, id string) (bOpen bool, errdata *pb.ErrorData) } //邮件业务模块对外接口定义 提供给其他模块使用的 diff --git a/modules/sys/module.go b/modules/sys/module.go index 5d3dff47a..8fc26c47d 100644 --- a/modules/sys/module.go +++ b/modules/sys/module.go @@ -95,6 +95,20 @@ func (this *ModuleSys) AutoActivate(session comm.IUserSession, cids []string) bo return true } -func (this *ModuleSys) GetOpenCondCfgById(id string) (data *cfg.GameOpencondData, err error) { - return this.configure.GetOpenCondCfgById(id) +func (this *ModuleSys) GetOpenCondCfgById(uid string, id string) (bOpen bool, errdata *pb.ErrorData) { + + conf, err := this.configure.GetOpenCondCfgById(id) + if err != nil { + bOpen = false + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ConfigNoFound, + Title: pb.ErrorCode_ConfigNoFound.ToString(), + Message: err.Error(), + } + return + } + if this.ValidCond(uid, conf) != "" { + bOpen = true + } + return }