You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.9 KiB
C#

1 month ago
using System;
using System.Collections.Generic;
using System.Linq;
using Swan.Formatters;
namespace KevDrawServer
{
public class JsEvent
{
public JsEvent(string type)
{
Type = type;
Data = new Dictionary<string, string>();
}
[Newtonsoft.Json.JsonProperty("drawerToken")]
public string Token { get; set; } = string.Empty;
[Newtonsoft.Json.JsonProperty("userID")]
public string UserID { get; set; } = string.Empty;
[Newtonsoft.Json.JsonProperty("cmdID")]
public string CmdID { get; set; } = string.Empty;
[Newtonsoft.Json.JsonProperty("type")]
public string Type { get; private set; }
[Newtonsoft.Json.JsonProperty("data")]
public object Data { get; set; }
/// <summary>
/// Gets or sets 是否执行成功.
/// </summary>
[Newtonsoft.Json.JsonProperty("success")]
public bool Success { get; set; } = false;
}
1 month ago
1 month ago
//public class JsDataRow
//{
// [Newtonsoft.Json.JsonProperty("columns")]
// public List<string> Columns { get; set; }
// public static List<JsDataRow> GenerateLargeTable()
// {
// var random = new Random();
// const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
// var rows = new List<JsDataRow>();
// for (var i = 0; i < 1000; i++)
// {
// var row = new JsDataRow();
// var cols = new List<string>();
// for (var j = 0; j < 10; j++)
// {
// cols.Add(new string(
// Enumerable.Repeat(chars, 20)
// .Select(s => s[random.Next(s.Length)]).ToArray()));
// }
// row.Columns = cols;
// rows.Add(row);
// }
// return rows;
// }
//}
}