TeleSharp.Generator refactoring

Fix naming for models properties (Use JsonProperty instead)
Move models to separate folder
Rename models

Remove unused references in Program.cs
Use string instead of String
This commit is contained in:
CheshireCaat 2020-01-26 05:03:28 +03:00
parent 79cf25d257
commit d42a367cf4
7 changed files with 148 additions and 117 deletions

View file

@ -0,0 +1,20 @@
using System.Collections.Generic;
using Newtonsoft.Json;
namespace TeleSharp.Generator.Models
{
internal class TlConstructor
{
[JsonProperty("id")]
public int Id { get; set; }
[JsonProperty("predicate")]
public string Predicate { get; set; }
[JsonProperty("params")]
public List<TlParam> Params { get; set; }
[JsonProperty("type")]
public string Type { get; set; }
}
}

View file

@ -0,0 +1,20 @@
using System.Collections.Generic;
using Newtonsoft.Json;
namespace TeleSharp.Generator.Models
{
internal class TlMethod
{
[JsonProperty("id")]
public int Id { get; set; }
[JsonProperty("method")]
public string Method { get; set; }
[JsonProperty("params")]
public List<TlParam> Params { get; set; }
[JsonProperty("type")]
public string Type { get; set; }
}
}

View file

@ -0,0 +1,13 @@
using Newtonsoft.Json;
namespace TeleSharp.Generator.Models
{
internal class TlParam
{
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("type")]
public string Type { get; set; }
}
}

View file

@ -0,0 +1,14 @@
using System.Collections.Generic;
using Newtonsoft.Json;
namespace TeleSharp.Generator.Models
{
internal class TlSchema
{
[JsonProperty("constructors")]
public List<TlConstructor> Constructors { get; set; }
[JsonProperty("methods")]
public List<TlMethod> Methods { get; set; }
}
}