12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- using Microsoft.AspNetCore.Mvc;
- using WMS.BZWeb;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Linq;
- using System.Reflection;
- using System.Web;
- using WMS.Info.Models.WCSDeviceMonitor;
- using Microsoft.Extensions.DependencyInjection;
- using FreeRedis;
- using WCS.Entity.Protocol.DataStructure;
- using MessagePack;
- namespace WMS.BZWeb
- {
- [Area("DeviceMonitorManager")]
- public class FJDeviceMonitorController : MvcControllerBase
- {
- private readonly RedisClient _FJRedis;
- //交互点
- public readonly List<int> InteractionPointFirstFloor = new List<int> { 1001 };
- public readonly List<int> InteractionPointSecondFloor = new List<int> { 1001 };
- public FJDeviceMonitorController(IServiceProvider serviceProvider)
- {
- var redisDict = serviceProvider.GetRequiredService<Dictionary<string, RedisClient>>();
- if (redisDict.Any())
- {
- _FJRedis = redisDict["FJRedis"];
- _FJRedis.Serialize = obj => MessagePackSerializer.Serialize(obj);// JsonConvert.SerializeObject(obj);
- _FJRedis.DeserializeRaw = (bytes, type) => MessagePackSerializer.Deserialize(type, bytes);// JsonConvert.DeserializeObject(json, type);
- }
-
- }
- #region 视图功能
- // GET: DeviceMonitorManager/FJDeviceMonitor
- public ActionResult Index()
- {
- return View();
- }
- /// <summary>
- /// 表单页
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult DDJDetail()
- {
- return View();
- }
- #endregion
- /// <summary>
- /// 获取设备信息
- /// </summary>
- /// <param name="code"></param>
- /// <returns></returns>
- [HttpGet]
- //////[AjaxOnly]
- public ActionResult GetDeviceData(string code)
- {
- //DeviceDataPack dp = new DeviceDataPack();
- return null;
- }
- }
- }
|