using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CB.Cache;
using CB.Entity;
namespace CB.Data
{
public partial class Caches
{
///
/// 走势图表帮助文章列表(限走势图表使用)
///
/// 文章分类ID
///
public static IList GetHelpList(int cid)
{
var key = CacheKeys.TopicList + "-" + cid.ToString();
var cache = CBCache.GetCacheService();
IList list = cache.GetObject(key) as IList;
if (null == list)
{
list = TopicService.ToList(new TopicInfo() { Cid = cid });
cache.AddObject(key, list);
}
return list;
}
///
/// 走势图表帮助文章列表(限走势图表使用)
///
/// 文章分类ID
/// 记录条数
///
public static IList GetHelpList(int cid, int topSize)
{
var list = GetHelpList(cid);
if (null == list || 0 >= list.Count)
return null;
IList r = new List();
int count = list.Count;
count = topSize >= count ? count : topSize;
for (int i = 0; i < count; i++)
{
r.Add(list[i]);
}
return r;
}
}
}