using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FCS.Common;
using FCS.Interface;
using FCS.Models.Entity;
using Quartz;
namespace FCS.Crawler.Basketball
{
///
/// 篮球赛事
/// 制作人:海棠
///
public class B_EventsJob : CommonJob
{
private List eventsList;
public B_EventsJob()
{
eventsList = services.Query().ToList();
}
public List GetEventList()
{
var id = string.Empty;
if (eventsList.Count == 2)
return eventsList;
else
{
services.Delete();
services.SqlBulkCopyAdd(GetAddData());
eventsList = services.Query().ToList();
}
return eventsList;
}
///
/// 得到新增数据
///
///
private IEnumerable GetAddData()
{
var eventNameList = new List() {
ConfigurationManager.AppSettings["NBAEventName"],
ConfigurationManager.AppSettings["CBAEventName"],
};
foreach (var item in eventNameList)
{
yield return new B_Events
{
Id = CommonHelper.GetGuid().ToString(),
Name = item,
CreateDateTime = DateTime.Now,
Describe = item,
Sort = 1
};
}
}
}
}