Exemple #1
0
    public AssetInfo <T> GetAssetCache <T>(string sPath, IAssetLoader loader) where T : UnityEngine.Object
    {
        sPath = sPath.ToLower();
        Cache cache = m_AssetCache.GetCache(sPath);

        if (cache == null)
        {
            if (loader is ABAssetLoader)
            {
                cache = new ABAssetInfo <T>(sPath, m_AssetCache);
            }
            else
            {
                cache = new AssetInfo <T>(sPath, m_AssetCache);
            }
        }
        m_AssetCache.AddCacheToDic(sPath, cache);

        AssetInfo <T> assetInfo = cache as AssetInfo <T>;

        if (assetInfo != null)
        {
            assetInfo.AddRef();
            return(assetInfo);
        }
        else
        {
            return(null);
        }
    }
        public string HariStyleListList([FromBody] SUIDPAGE model)
        {
            string value = CodeHelp.GetResults(0, "失败", "");

            if (string.IsNullOrEmpty(model.suid.ToString()))
            {
                value = CodeHelp.GetResults(0, "失败", "沙龙ID不能为空");
            }
            else
            {
                if (!CHKsal(model.suid.ToString()))
                {
                    value = CodeHelp.GetResults(0, "无法找到页面,该沙龙暂时不提供此服务。", "沙龙未开通");
                    return(value);
                }
                var str = CacheManage.GetCache("SearchHotHair" + model.suid);
                if (str == null)
                {
                    int                  pageindex = 1;
                    int                  pagesize  = 100;
                    int                  rowcount  = 0;
                    int                  pagecount = 0;
                    HairListService      hise      = new HairListService();
                    List <HariStyleList> list      = new List <HariStyleList>();
                    //获取沙龙发型师信息
                    list = hise.GetHariStyleListList(model.suid, pageindex, pagesize, out rowcount, out pagecount);
                    if (list != null && list.Count > 0)
                    {
                        string saloninfo = cacheInfo(model.suid.ToString());
                        if (!string.IsNullOrEmpty(saloninfo))
                        {
                            saloninfo = saloninfo.Replace("|*-*|", "`");
                            string[] info = saloninfo.Split('`');
                            list[0].salonname = info[0];
                            list[0].salonlogo = info[1];
                        }
                        value = CodeHelp.GetResults(1, "成功", list).ToLower();
                        CacheManage.SetCacheMinutes("SearchHotHair" + model.suid, value, 60);
                    }
                    else
                    {
                        value = CodeHelp.GetResults(0, "尚未绑定发型师", "");
                    }
                }
                else
                {
                    try
                    {
                        value = str.ToString();
                    }
                    catch
                    {
                        value = CodeHelp.GetResults(0, "失败", "未取到数据");
                    }
                }
            }
            return(value);
        }
Exemple #3
0
    public ABInfo GetABCache(string sPath)
    {
        Cache cache = m_ABCache.GetCache(sPath);

        if (cache == null)
        {
            cache = new ABInfo(sPath, m_ABCache);
        }
        m_ABCache.AddCacheToDic(sPath, cache);
        ABInfo abInfo = cache as ABInfo;

        if (abInfo != null)
        {
            abInfo.AddRef();
            return(abInfo);
        }
        else
        {
            return(null);
        }
    }
        /// <summary>
        /// 获取沙龙昵称和logo
        /// </summary>
        /// <param name="suid"></param>
        /// <returns></returns>
        private string cacheInfo(string suid)
        {
            string info = "";

            try
            {
                info = CacheManage.GetCache("suid:" + suid).ToString();
            }
            catch
            {
                List <AllSalon> list = new List <AllSalon>();
                SalonService    sa   = new SalonService();
                //取沙龙的基本信息和环境图
                list = sa.GetSalonInfo(new Guid(suid), 3);
                if (list.Any())
                {
                    info = list[0].Nickname + "|*-*|" + list[0].Logo;
                    CacheManage.SetCacheMinutes("suid:" + suid, info, 90);
                }
            }
            return(info);
        }