CacheAutorize.cs 1.26 KB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Quiz.Utility.Cache;
using WeixinApi;

namespace WeiXinCenter.Cache
{
    public class CacheAutorize
    {
        CacheItem<Dictionary<string, WeixinAccount>> _cacheitem;

        public Dictionary<string, WeixinAccount> CacheData { get { return _cacheitem.CacheData; } }

        public CacheAutorize()
        {
            _cacheitem = new CacheItem<Dictionary<string, WeixinAccount>>(Init);
            _cacheitem.InitCache();
        }

        public void Refresh()
        {
            _cacheitem.InitCache();
        }

        ~CacheAutorize()
        {
            _cacheitem.Dispose();
        }

        Dictionary<string, WeixinAccount> Init()
        {
            Dictionary<string, WeixinAccount> wxdic = new Dictionary<string, WeixinAccount>();

            //wxdic.Add("zjjd", new WeixinAccount("gh_a18fefb4fe8c", "wx04cedebd071a3f27", "74972a74784bcd6d430f72fce0d40f33"));
            //wxdic.Add("zkydt", new WeixinAccount("gh_9f52bf7b7128", "wx2b97f56897756cbb", "de630194fb3c3f54720b4f70b2aa7920"));
            wxdic.Add("kqjt", new WeixinAccount("gh_307f246840ea", "wxb85b19202efd15f9", "583fbd26bea7de6e4f2925db98ee9dab"));

            return wxdic;
        }
    }
}