mirror of
https://github.com/sochix/TLSharp.git
synced 2026-04-05 14:37:04 +00:00
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:
parent
79cf25d257
commit
d42a367cf4
7 changed files with 148 additions and 117 deletions
20
TeleSharp.Generator/Models/TlConstructor.cs
Normal file
20
TeleSharp.Generator/Models/TlConstructor.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
20
TeleSharp.Generator/Models/TlMethod.cs
Normal file
20
TeleSharp.Generator/Models/TlMethod.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
13
TeleSharp.Generator/Models/TlParam.cs
Normal file
13
TeleSharp.Generator/Models/TlParam.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
14
TeleSharp.Generator/Models/TlSchema.cs
Normal file
14
TeleSharp.Generator/Models/TlSchema.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue