using MessagePack;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Waste.Application
{

    [MessagePackObject]
    public class SuZhouApiBaseDto
    {
        [Key("secret")]
        public string SecretHash { get; set; }

        [Key("nonce")]
        public int Nonce { get; set; }

        [Key("sign")]
        public string Signature { get; set; }

        [Key("time")]
        public long TimeStamp { get; set; }

        [Key("user")]
        public string UserId { get; set; }
    }

    [MessagePackObject]
    public class SuZhouPostApiBaseDto
    {
        [Key("secret")]
        public string SecretHash { get; set; }

        [Key("nonce")]
        public int Nonce { get; set; }

        [Key("sign")]
        public string Signature { get; set; }

        [Key("time")]
        public int TimeStamp { get; set; }
        /// <summary>
        /// 设备ID
        /// </summary>
        [Key("device")]
        public string DeviceId { get; set; }
    }

    [MessagePackObject]
    public class SuZhouPostApiBaseDto<T> : SuZhouPostApiBaseDto
    {
        [Key("data")]
        public T Data { get; set; }
    }

    [MessagePackObject]
    public class SuZhouApiBaseDto<T> : SuZhouApiBaseDto
    {
        [Key("data")]
        public T Data { get; set; }
    }

    [MessagePackObject]
    public class EstatesBaseS2CDto
    {
        /// <summary>
        /// 页码
        /// </summary>
        [Key("PageIndex")]
        public int PageIndex { get; set; }
        /// <summary>
        /// 总页数
        /// </summary>
        [Key("TotalPages")]
        public int TotalPages { get; set; }
        /// <summary>
        /// 总条数
        /// </summary>
        [Key("Itemcount")]
        public int Itemcount { get; set; }
    }
    [MessagePackObject]
    public class EstatesBaseS2CDto<T>:EstatesBaseS2CDto
    {
        [Key("Data")]
        public T Data { get; set; }
    }
    /// <summary>
    /// 添加地产区域信息
    /// </summary>
    [MessagePackObject]
    public class EstatesC2SDto //客户端向服务端请求的DTO
    {
        /// <summary>
        /// 地产区域编码,不可重复, 长度限制2到32
        /// </summary>
        [Key("code")]
        public string Code { get; set; }
        /// <summary>
        /// 名称,长度限制2到32
        /// </summary>
        [Key("name")]
        public string Name { get; set; }
        /// <summary>
        /// 地址,长度限制4到128
        /// </summary>
        [Key("addr")]
        public string Addr { get; set; }
        /// <summary>
        /// 城市编码	，例：320500000000（苏州）
        /// </summary>
        [Key("city")]
        public string City { get; set; }
        /// <summary>
        /// 区域编码	，例：320507000000（相城）
        /// </summary>
        [Key("area")]
        public string Area { get; set; }
        /// <summary>
        /// 街道编码，例：320507105000（渭塘镇）
        /// </summary>
        [Key("street")]
        public string Street { get; set; }
    }
    /// <summary>
    /// 添加地产区域返回信息
    /// </summary>
    [MessagePackObject]
    public class EstatesS2CDto//服务端向客户端返回结果的DTO
    {
        /// <summary>
        /// 地产区域ID
        /// </summary>
        [Key(0)] //服务端向客户端返回的DTO以元组形式编排参数，所以Key标注为index，从0开始.
        public string id { get; set; }
        /// <summary>
        /// 地产区域编码
        /// </summary>
        [Key(1)]
        public string code { get; set; }
        /// <summary>
        /// 地产区域所在地址
        /// </summary>
        [Key(2)]
        public string addr { get; set; }
        /// <summary>
        /// 城市编码
        /// </summary>
        [Key(3)]
        public string city { get; set; }
        /// <summary>
        /// 区域编码
        /// </summary>
        [Key(4)]
        public string area { get; set; }
        /// <summary>
        /// 街道编码
        /// </summary>
        [Key(5)]
        public string street { get; set; }
    }

    /// <summary>
    /// 添加采集点信息
    /// </summary>
    [MessagePackObject]
    public class CollectC2SDto //客户端向服务端请求的DTO
    {
        /// <summary>
        /// 编码,不可重复, 长度限制2到32
        /// </summary>
        [Key("code")]
        public string Code { get; set; }
        /// <summary>
        /// 名称,长度限制2到32
        /// </summary>
        [Key("name")]
        public string Name { get; set; }
        /// <summary>
        /// 地址,长度限制4到128
        /// </summary>
        [Key("addr")]
        public string Addr { get; set; }
        /// <summary>
        /// 地产区域ID
        /// </summary>
        [Key("estate")]
        public string Estate { get; set; }
    }
    /// <summary>
    /// 添加采集点返回信息
    /// </summary>
    [MessagePackObject]
    public class CollectS2CDto//服务端向客户端返回结果的DTO
    {
        /// <summary>
        /// 采集点ID
        /// </summary>
        [Key(0)] //服务端向客户端返回的DTO以元组形式编排参数，所以Key标注为index，从0开始.
        public string id { get; set; }
        /// <summary>
        /// 编码
        /// </summary>
        [Key(1)]
        public string code { get; set; }
        /// <summary>
        /// 名称
        /// </summary>
        [Key(2)]
        public string name { get; set; }
        /// <summary>
        /// 地址
        /// </summary>
        [Key(3)]
        public string addr { get; set; }
    }
    /// <summary>
    /// 后台推送数据
    /// </summary>
    public class GarbagePltC2SDto: GarbageC2SDto
    {
        /// <summary>
        /// 设备ID
        /// </summary>
        public string deviceid { get; set; }
        /// <summary>
        /// secret
        /// </summary>
        public string secret { get; set; }
        /// <summary>
        /// secrethash
        /// </summary>
        public string secrethash { get; set; }
    }

    /// <summary>
    /// 向服务端推送测试用垃圾采集数据
    /// </summary>
    [MessagePackObject]
    public class GarbageC2SDto //客户端向服务端请求的DTO
    {
        /// <summary>
        /// 垃圾称重数据,64位浮点进度，单位为千克
        /// </summary>
        [Key("weight")]
        public double Weight { get; set; }
        /// <summary>
        /// 垃圾桶编码
        /// </summary>
        [Key("trash")]
        public string Trash { get; set; }
        /// <summary>
        /// 垃圾类型,缺省类型 : 0,厨余垃圾 : 1,可回收物 : 2,有害垃圾 : 3,其他垃圾 : 4
        /// </summary>
        [Key("type")]
        public int Type { get; set; }
        /// <summary>
        /// 数据扫描时间,UNIX时间戳
        /// </summary>
        [Key("scanningTime")]
        public int ScanningTime { get; set; }
        /// <summary>
        /// 设备状态,使用中 : 0:使用中,异常 : 1,检修 : 2,检修结束 : 3,启用 : 4,未知 : 5
        /// </summary>
        [Key("d_status")]
        public int DStatus { get; set; }
    }
    /// <summary>
    /// Hello测试
    /// </summary>
    [MessagePackObject]
    public class HelloC2SDto //客户端向服务端请求的DTO
    {
        [Key("greet")]
        public string Greet { get; set; }
    }
    /// <summary>
    /// Hello测试返回
    /// </summary>
    [MessagePackObject]
    public class HelloS2CDto //服务端向客户端返回结果的DTO
    {
        [Key(0)] //服务端向客户端返回的DTO以元组形式编排参数，所以Key标注为index，从0开始.
        public string Message { get; set; }

        [Key(1)]
        public int Code { get; set; }
    }

    [MessagePackObject]
    public class FailS2CDto //错误的时候服务端返回的数据
    {

        [Key(0)]
        public string msg { get; set; }

        [Key(1)] //服务端向客户端返回的DTO以元组形式编排参数，所以Key标注为index，从0开始.
        public int code { get; set; }
    }
}
