Ejemplo n.º 1
0
        /// <summary>
        /// 启动引擎
        /// </summary>
        public static void BootEngine(EngineParam engineParam)
        {
            #region 配置服务初始化
            IAppConfigManage appConfig      = Get <IAppConfigManage>();
            AppConfigParam   appConfigParam = new AppConfigParam()
            {
                UserConfigPath = engineParam.AppConfigPath
            };
            appConfig.LoadConfigs(appConfigParam);
            #endregion

            #region 日志服务初始化
            ILogContext log = Get <ILogContext>();
            log.Init(@engineParam.LogConfigPath);
            #endregion

            #region 缓存服务初始化
            ScrapyCachePool cache = Get <ICachePool>() as ScrapyCachePool;
            cache.Init();
            ScrapyCachePool.LogDebugEvent += ScrapyCacheLogForDebug;
            ScrapyCachePool.LogInfoEvent  += ScrapyCacheLogForInfo;
            ScrapyCachePool.LogErrorEvent += ScrapyCacheLogForError;
            //客户端缓存配置表
            cache.Get <ClientCacheConfigTable>().LoadDatas(appConfig.CacheLogConfig.基础组缓存表);
            cache.Get <ClientCacheConfigTable>().LoadDatas(appConfig.CacheLogConfig.衍生品缓存表);
            cache.Get <ClientCacheConfigTable>().LoadDatas(appConfig.CacheLogConfig.权益缓存表);
            cache.Get <ClientCacheConfigTable>().LoadDatas(appConfig.CacheLogConfig.固收缓存表);
            //客户端缓存列配置表
            cache.Get <ClientCacheConfigColumnTable>().LoadDatas(appConfig.CacheLogConfig.基础组缓存字段表);
            cache.Get <ClientCacheConfigColumnTable>().LoadDatas(appConfig.CacheLogConfig.衍生品缓存字段表);
            cache.Get <ClientCacheConfigColumnTable>().LoadDatas(appConfig.CacheLogConfig.权益缓存字段表);
            cache.Get <ClientCacheConfigColumnTable>().LoadDatas(appConfig.CacheLogConfig.固收缓存字段表);
            #endregion
        }
Ejemplo n.º 2
0
        public void CacheLoadTest()
        {
            string filePath  = @"E:\前台缓存表配置_OClient_最新版_基础.xlsm";
            string sheetName = "缓存表";

            DataTable sheetData = ExcelUtility.ExcelToDataTable(filePath, sheetName);

            ScrapyCachePool pool = new ScrapyCachePool();

            pool.Init();

            pool.Get <ClientCacheConfigTable>().LoadDatas(sheetData);
            List <ICacheItem> items = pool.Get <ClientCacheConfigTable>().Get("单元信息表");

            Assert.IsTrue(items.Count > 0);
        }