using PushApi.Act.BLL;
using PushApi.Act.Models.Trial;
using PushPlatform.Common.Model;
using PushPlatform.Common.Util;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace PushPf.Api.Controllers
{
    public class TrialController : ApiController
    {
        #region 91Trial访视提醒
        /// <summary>
        /// 91Trial访视提醒
        /// </summary>
        /// <param name="proCfgId">推送配置表Id</param>
        /// <returns></returns>
        [HttpGet]
        public HttpResponseMessage VisitRemind(string proCfgId)
        {
            HttpStatusCode statusCode = HttpStatusCode.OK;
            APIResult<List<DataMessage>> model = new APIResult<List<DataMessage>>();
            try
            {
                if (string.IsNullOrEmpty(proCfgId))
                {
                    model.Result = 0;
                    model.Msg = "配置不能为空";
                    return Request.CreateResponse(statusCode, model);
                }
                model = TrialBLL.VisitRemind(proCfgId);
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
                model.Result = 0;
                model.Msg = "异常，请联系管理员";
            }
            return Request.CreateResponse(statusCode, model);
        }
        #endregion
    }
}
