Exemplo n.º 1
0
        /// <summary>
        /// 清除保养活动车型配置服务缓存
        /// </summary>
        /// <param name="vehicleIds"></param>
        /// <returns></returns>
        public bool CleanBaoYangActivityVehicleCache(List <string> vehicleIds)
        {
            var result = true;

            try
            {
                if (vehicleIds != null && vehicleIds.Any())
                {
                    var keyPrefix = "BaoYangActivityIdForVehicle/";
                    var manager   = new BaoYangManager();
                    var keys      = vehicleIds.Select(s => $"{keyPrefix}{s}").ToList();
                    result = manager.CleanBaoYangCaches(keys);
                }
            }
            catch (Exception ex)
            {
                result = false;
                Logger.Error("CleanBaoYangActivityVehicleCache", ex);
            }
            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 清除保养活动地区配置服务缓存
        /// </summary>
        /// <param name="regionIds"></param>
        /// <returns></returns>
        public bool CleanBaoYangActivityRegionCache(List <int> regionIds)
        {
            var result = true;

            try
            {
                if (regionIds != null && regionIds.Any())
                {
                    var keyPrefix = "BaoYangActivityIdForRegion/";
                    var manager   = new BaoYangManager();
                    var keys      = regionIds.Select(s => $"{keyPrefix}{s}").ToList();
                    result = manager.CleanBaoYangCaches(keys);
                }
            }
            catch (Exception ex)
            {
                result = false;
                Logger.Error("CleanBaoYangActivityRegionCache", ex);
            }
            return(result);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 清除机油粘度优先级配置服务缓存
        /// </summary>
        /// <param name="regionIds"></param>
        /// <returns></returns>
        public bool RemoveOilViscosityPriorityConfigCache(string configType, string originViscosity)
        {
            var result = false;

            try
            {
                if (!string.IsNullOrWhiteSpace(configType) && !string.IsNullOrWhiteSpace(originViscosity))
                {
                    var cacheKey = "BaoYangOilViscosityPriorityConfig/{0}/{1}";
                    var manager  = new BaoYangManager();
                    var key      = string.Format(cacheKey, configType, originViscosity);
                    result = manager.CleanBaoYangCaches(new List <string> {
                        key
                    });
                }
            }
            catch (Exception ex)
            {
                result = false;
                Logger.Error("RemoveOilViscosityPriorityConfigCache", ex);
            }
            return(result);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 清除保养活动配置缓存
        /// </summary>
        /// <param name="activityNum"></param>
        /// <returns></returns>
        public bool CleanBaoYangActivitySettingCache(string activityNum)
        {
            var result = true;

            try
            {
                if (!string.IsNullOrWhiteSpace(activityNum))
                {
                    var keyPrefix = "BaoYangActivitySetting/";
                    var manager   = new BaoYangManager();
                    var keys      = new List <string>()
                    {
                        $"{keyPrefix}{activityNum}"
                    };
                    result = manager.CleanBaoYangCaches(keys);
                }
            }
            catch (Exception ex)
            {
                result = false;
                Logger.Error("CleanBaoYangActivitySettingCache", ex);
            }
            return(result);
        }