using Mall.Education.Models;
using Mall.Education.RabbitMQ;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading.Tasks;

namespace Mall.Education
{
    partial class RebornTimerServer : ServiceBase
    {
        public RebornTimerServer()
        {
            InitializeComponent();
        }

        /// <summary>
        ///  在此处添加代码以启动服务。
        /// </summary>
        /// <param name="args"></param>
        protected override void OnStart(string[] args)
        {
            RabbitConfig rabbit = new RabbitConfig()
            {
                HostName = "47.96.25.130",
                Port = 5672,
                UserName = "guest",
                Password = "viitto2019",
                QueenName = RabbitKey.QUEEN_GENERATE_EDUCARION
            };
            Task.Factory.StartNew(() => RabbiMQManager.DealWithMessage(rabbit));
        }

        /// <summary>
        /// 在此处添加代码以执行停止服务所需的关闭操作。
        /// </summary>
        protected override void OnStop()
        {
        }
    }
}
