package sys import ( "go_dreamfactory/comm" "go_dreamfactory/lego/core" "go_dreamfactory/modules" ) type ModelSys struct { modules.MCompModel moduleSys *ModuleSys service core.IService } func (this *ModelSys) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { this.TableName = comm.TableSys err = this.MCompModel.Init(service, module, comp, options) this.moduleSys = module.(*ModuleSys) this.service = service return } // 是否允许访问功能,条件:玩家等级 func (this *ModelSys) IsAccess(funName string, userLv int32) bool { conf := this.moduleSys.configure.getFuncCfg(funName) if conf != nil { return userLv >= conf.Main } return false }