154 lines
4.6 KiB
C#
154 lines
4.6 KiB
C#
using Core.Web.WebHelper;
|
|
using Core.Web.WebHelper.UserRight;
|
|
using CRM.Core.BLL.Base;
|
|
using CRM.Core.BLL.EventBus.Events;
|
|
using CRM.Core.BLL.Res;
|
|
using CRM.Core.BLL.Soft;
|
|
using CRM.Core.BLL.Util;
|
|
using CRM.Core.BLL.Wx;
|
|
using CRM.Core.Common.EventBus;
|
|
using CRM.Core.Common.Layui;
|
|
using CRM.Core.Common.WebHelper;
|
|
using CRM.Core.DTO;
|
|
using CRM.Core.DTO.Ord;
|
|
using CRM.Core.Model.Entity;
|
|
using CRM.Core.Model.Enum;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Web;
|
|
using System.Web.Mvc;
|
|
using WX.CRM.Common;
|
|
using CRM.Core.BLL.Level2;
|
|
using CRM.Core.BLL;
|
|
using CRM.Core.BLL.FB;
|
|
using CRM.Core.Model.EntityFB;
|
|
using CRM.Core.Model;
|
|
using System.Data;
|
|
using System.Configuration;
|
|
using Core.Web.App_Start;
|
|
using CRM.Core.BLL.Application.Order;
|
|
using Newtonsoft.Json;
|
|
using WX.CRM.WebHelper;
|
|
using WX.CRM.Common.BlowFish;
|
|
|
|
namespace Core.Web.Controllers
|
|
{
|
|
public class CmsLiveRoomController : BaseController
|
|
{
|
|
private CACHE_BL cache_BL = new CACHE_BL();
|
|
|
|
public CmsLiveRoomController()
|
|
{
|
|
}
|
|
|
|
[AuthorizeRedirect(RightsConfig.CONST_直播间, ToolBarConfig.CONST_NotButton, true)]
|
|
[HttpGet]
|
|
public ActionResult Index()
|
|
{
|
|
ViewBag.rightCode = RightsConfig.CONST_直播间;
|
|
|
|
return View();
|
|
}
|
|
|
|
[HttpPost]
|
|
[AuthorizeRedirect(RightsConfig.CONST_直播间, ToolBarConfig.CONST_NotButton, false)]
|
|
public JsonResult Index(Laypage pager, string columns, RoomliveQueryDto dto)
|
|
{
|
|
try
|
|
{
|
|
List<RoomLiveModel> list = new List<RoomLiveModel>();
|
|
var cmsSetting = cache_BL.GetValue_Parameter("cmsurl");
|
|
if (string.IsNullOrWhiteSpace(cmsSetting))
|
|
{
|
|
cmsSetting = "https://inapi.hc.dn8188.com";
|
|
}
|
|
var url = $"{cmsSetting.Trim('/')}/Read/QueryZhiBoVideo.html";
|
|
var param = $"pindex={pager.page}&psize={pager.limit}";
|
|
if (!string.IsNullOrWhiteSpace(dto.Name))
|
|
{
|
|
param += $"&title={dto.Name}";
|
|
}
|
|
if (!string.IsNullOrWhiteSpace(dto.ChosenDateStart))
|
|
{
|
|
param += $"&stime={dto.ChosenDateStart}";
|
|
}
|
|
if (!string.IsNullOrWhiteSpace(dto.ChosenDateEnd))
|
|
{
|
|
var date = Convert.ToDateTime(dto.ChosenDateEnd).AddDays(1);
|
|
param += $"&etime={dto.ChosenDateEnd}";
|
|
}
|
|
var cmsdata = Utility.GetData(url, param, Encoding.UTF8);
|
|
var cmdList = JsonConvert.DeserializeObject<CmsData>(cmsdata);
|
|
if (cmdList.s.HasValue && cmdList.s.Value)
|
|
{
|
|
list = cmdList.d.list;
|
|
pager.count = cmdList.d.recordcount;
|
|
}
|
|
var data = new LayuiData<RoomLiveModel>()
|
|
{
|
|
msg = "数据加载成功!",
|
|
count = pager.count,
|
|
code = 0,
|
|
data = list
|
|
};
|
|
return Json(data, JsonRequestBehavior.AllowGet);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogHelper.Error(ex.ToString());
|
|
return Json(new { }, JsonRequestBehavior.AllowGet);
|
|
}
|
|
}
|
|
|
|
[AuthorizeRedirect(RightsConfig.CONST_直播间, ToolBarConfig.CONST_NotButton, true)]
|
|
[HttpGet]
|
|
public ActionResult Play(string url)
|
|
{
|
|
ViewBag.url = url;
|
|
return View();
|
|
}
|
|
}
|
|
|
|
public class RoomliveQueryDto : SearchPageBase
|
|
{
|
|
/// <summary>
|
|
/// 名称
|
|
/// </summary>
|
|
public string Name { get; set; }
|
|
|
|
/// <summary>
|
|
/// 入选时间
|
|
/// </summary>
|
|
public string ChosenDateStart { get; set; }
|
|
|
|
/// <summary>
|
|
/// 入选时间
|
|
/// </summary>
|
|
public string ChosenDateEnd { get; set; }
|
|
}
|
|
|
|
public class RoomLiveModel
|
|
{
|
|
public string uri { get; set; }
|
|
public string title { get; set; }
|
|
public DateTime? start_time { get; set; }
|
|
public DateTime? stop_time { get; set; }
|
|
public string duration { get; set; }
|
|
public DateTime? ctime { get; set; }
|
|
}
|
|
|
|
public class CmsData
|
|
{
|
|
public bool? s { get; set; }
|
|
public d d { get; set; }
|
|
}
|
|
|
|
public class d
|
|
{
|
|
public int recordcount { get; set; }
|
|
public List<RoomLiveModel> list { get; set; }
|
|
}
|
|
} |