26 lines
793 B
C#
26 lines
793 B
C#
|
|
using EasyInject.Attributes;
|
|
using Newtonsoft.Json;
|
|
using Newtonsoft.Json.Linq;
|
|
using UnityEngine;
|
|
|
|
|
|
/// <summary>
|
|
/// 与后台 WMS 库存连接
|
|
/// </summary>
|
|
[Component("WmsStorageWebsocket")]
|
|
public class WmsStorageWebsocket : AbstractWebSocketChannle
|
|
{
|
|
public override string _url => string.Format("ws://{0}:{1}/{2}", GlobalConfig.serverIp, GlobalConfig.serverPort, GlobalConfig.wsStorageMonitorAddress);
|
|
|
|
public override string Description => "与后台 WMS 库存信息";
|
|
|
|
public override object MesageFilter(string message)
|
|
{
|
|
JObject keys = JObject.Parse(message);
|
|
string json = keys["locationResult"].ToString();
|
|
LocationStorageInfo locationStorageInfo = JsonConvert.DeserializeObject<LocationStorageInfo>(json);
|
|
return locationStorageInfo;
|
|
}
|
|
}
|