RawMsg.cs 1.1 KB
Newer Older
1 2
using Newtonsoft.Json;
using System;
麦壳饼's avatar
麦壳饼 已提交
3 4 5 6
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

7
namespace IoTSharp.Data
麦壳饼's avatar
麦壳饼 已提交
8
{
麦壳饼's avatar
麦壳饼 已提交
9 10
    public class Playload
    {
11 12 13
        [JsonProperty(PropertyName = "ts")]
        public long Ticks { get; set; } = DateTime.Now.Ticks;
        [JsonProperty(PropertyName = "devicestatus")]
麦壳饼's avatar
麦壳饼 已提交
14
        public DeviceStatus DeviceStatus { get; set; } = DeviceStatus.Good;
15
        [JsonProperty(PropertyName = "values")]
麦壳饼's avatar
麦壳饼 已提交
16 17 18
        public Dictionary<string, object> Values { get; set; } = new();
    }
    public enum DeviceStatus
麦壳饼's avatar
麦壳饼 已提交
19
    {
麦壳饼's avatar
麦壳饼 已提交
20 21 22 23
        Good,
        PartGood,
        Bad,
        UnKnow
麦壳饼's avatar
麦壳饼 已提交
24
    }
麦壳饼's avatar
麦壳饼 已提交
25
    
麦壳饼's avatar
麦壳饼 已提交
26 27 28
    public class RawMsg
    {
        public MsgType MsgType { get; set; }
麦壳饼's avatar
麦壳饼 已提交
29
        public DateTime ts { get; set; } = DateTime.Now;
麦壳饼's avatar
麦壳饼 已提交
30
        public DeviceStatus DeviceStatus { get; set; } = DeviceStatus.Good;
麦壳饼's avatar
麦壳饼 已提交
31
        public Guid DeviceId { get;   set; }
麦壳饼's avatar
麦壳饼 已提交
32 33 34
        public Dictionary<string, object> MsgBody { get;  set; }
        public DataSide DataSide { get;  set; }
        public DataCatalog DataCatalog { get;  set; }
麦壳饼's avatar
麦壳饼 已提交
35 36
    }
}