Beispiel #1
0
        /// <summary>
        /// 获取首页精选全景作品列表
        /// </summary>
        /// <param name="count"></param>
        /// <returns></returns>
        public static async Task <IEnumerable <Pano> > GetIndexListAsync(int count)
        {
            string path = "api/frontsite/indexpanos";
            string key  = GetCacheKey(path);

            if (!CacheProvider.TryGet(key, out IEnumerable <Pano> list))
            {
                list = await HandleRequestAsync <IEnumerable <Pano> >(HttpMethod.Get, path, new { count });

                if (list.Any())
                {
                    CacheProvider.Set(key, list, TimeSpan.FromMinutes(5));
                }
            }

            return(list);
        }
Beispiel #2
0
        /// <summary>
        /// 获取作品市场分类列表
        /// </summary>
        /// <returns></returns>
        public static async Task <IEnumerable <MarketPanoType> > GetPanoMarketTypeListAsync()
        {
            string path = "api/pmarket/types";
            string key  = GetCacheKey(path);

            if (!CacheProvider.TryGet(key, out IEnumerable <MarketPanoType> list))
            {
                list = await HandleRequestAsync <IEnumerable <MarketPanoType> >(HttpMethod.Get, path);

                if (list.Any())
                {
                    CacheProvider.Set(key, list, TimeSpan.FromMinutes(5));
                }
            }

            return(list);
        }
Beispiel #3
0
        /// <summary>
        /// 获取标签列表
        /// </summary>
        /// <returns></returns>
        public static async Task <IEnumerable <Tags> > GetTagsListAsync()
        {
            string path = "api/frontsite/tags";
            string key  = GetCacheKey(path);

            if (!CacheProvider.TryGet(key, out IEnumerable <Tags> list))
            {
                list = await HandleRequestAsync <IEnumerable <Tags> >(HttpMethod.Get, path);

                if (list.Any())
                {
                    CacheProvider.Set(key, list, TimeSpan.FromMinutes(5));
                }
            }

            return(list);
        }