只需一步,快速开始
分布式系统框架(V2.0) 轻松承载百亿数据,千万流量!讨论专区 - 源码下载 - 官方教程
HttpHelper爬虫框架(V2.7-含.netcore) HttpHelper官方出品,爬虫框架讨论区 - 源码下载 - 在线测试和代码生成
HttpHelper爬虫类(V2.0) 开源的爬虫类,支持多种模式和属性 源码 - 代码生成器 - 讨论区 - 教程- 例子
<configSections> <section name="beitmemcached" type="System.Configuration.NameValueSectionHandler" /> </configSections> <beitmemcached> <add key="memcached" value="116.255.230.146:11211" /> <add key="memcached_resume_search" value="116.255.230.146:11211" /> </beitmemcached>
/// <summary> /// Memcached对象 /// </summary> private MemcachedClient mmc = MemcachedClient.GetInstance(DALConfig.memcached_resume_search); /// <summary> /// 简历ID的MemcachedKey /// </summary> private readonly static string ResumeIdsKey = "resumeids";
/// <summary> /// 根据简历id列表获取简历信息列表 /// </summary> /// <param name="ids">简历id列表</param> /// <returns></returns> public List<My_ResumeQueryInfo_MG> SearchNewResumeByIDs(IEnumerable<int> ids, IMongoSortBy sortBy = null) { if (sortBy == null) { sortBy = SortBy.Descending("date"); } string strQueryHasCode = string.Join(",", ids).GetHashCode().ToString(); var mmcData = mmc.Get(ResumeInfoKey + strQueryHasCode); List<My_ResumeQueryInfo_MG> list = null; if (mmcData != null) { string strmmc = mmcData.ToString(); if (strmmc.Length > 0) { list = JsonHelper.jsonDes<List<My_ResumeQueryInfo_MG>>(strmmc) as List<My_ResumeQueryInfo_MG>; foreach (My_ResumeQueryInfo_MG item in list) { item.UpdateDate = item.UpdateDate.ToLocalTime(); } } else { list = new List<My_ResumeQueryInfo_MG>(); } } else { if (!ids.Any()) return new List<My_ResumeQueryInfo_MG>(); list = new List<My_ResumeQueryInfo_MG>(cur); if (list != null && list.Count > 0) { mmc.Set(ResumeInfoKey + strQueryHasCode, JsonHelper.json(list), DateTime.Now.AddMinutes(60)); } } return list; }
使用道具 举报
本版积分规则 发表回复 回帖后跳转到最后一页
|手机版|小黑屋|手机版|联系我们|关于我们|广告合作|苏飞论坛 ( 豫ICP备18043678号-2)
GMT+8, 2025-2-23 07:58
© 2014-2021