using DSWeb.Common.DB; using DSWeb.Common.Extentions; using DSWeb.Common.Helper; using JobReqWebData; using log4net; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Quartz.Impl; using RabbitMQ.Client; using RabbitMQ.Client.Events; using System; using System.Collections.Generic; using System.ComponentModel; using System.Configuration; using System.Data; using System.Data.SqlClient; using System.Linq; using System.Text; using System.Threading.Tasks; using Topshelf; namespace DSWeb.Service.Output.DingtalkUserList { public class DingtalkUserListService : ServiceControl { private static ILog logger = LogManager.GetLogger("DingtalkUserListService"); private IConnection mqConn; public bool Start(HostControl hostControl) { // 开始具体的业务逻辑 logger.Debug("开始运行"); //只调用一下ds7的公开接口 var dsurl = ConfigurationManager.AppSettings["DS7URL"] + "CommMng/PublicAPI/DingTalkUserList"; var rtn = JobReqWebData.WebRequestHelper.DoGet(dsurl); return true; } public bool Stop(HostControl hostControl) { // 结束 logger.Debug("停止运行"); //StdSchedulerFactory.GetDefaultScheduler().Shutdown(); mqConn.Close(); return true; } } }