12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using CP.Cache;
- using CP.Model;
- namespace CP.Business
- {
- public class FcshsslBll
- {
- /// <summary>
- /// 缓存
- /// </summary>
- static WMCache cache = WMCache.GetCacheService();
- /// <summary>
- /// 获取最近多少天数据
- /// </summary>
- /// <param name="gpenum">高频枚举类型</param>
- /// <param name="pagesize">每天的开奖期数</param>
- /// <param name="n">多少天</param>
- /// <returns></returns>
- public static List<FcshsslInfo> GetList(int pagesize,int n = 30)
- {
- string key = $"DATA-{GPEnum.fcshssl.ToString()}-{pagesize*n}";
- List<FcshsslInfo> list = cache.GetObject<List<FcshsslInfo>>(key);
- if (list == null)
- {
- list = FcshsslData.GetList(pagesize * n);
- cache.AddObject(key, list, (int)CacheTime.Mintime);
- }
- return list;
- }
- /// <summary>
- /// 获取指定时间内的数据
- /// </summary>
- /// <param name="gpenum">枚举</param>
- /// <param name="sqi">开始时间</param>
- /// <param name="eqi">结束时间</param>
- /// <returns></returns>
- public static List<FcshsslInfo> GetDayKjList(DateTime sqi, DateTime eqi)
- {
- string key = $"DATA-{GPEnum.fcshssl.ToString()}-{sqi}-{eqi}";
- List<FcshsslInfo> list = cache.GetObject<List<FcshsslInfo>>(key);
- if (list == null)
- {
- list = FcshsslData.GetOneDayKjList(sqi,eqi);
- cache.AddObject(key, list, (int)CacheTime.Expert);
- }
- return list;
- }
- }
- }
|