128 lines
3.4 KiB
C#
128 lines
3.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
using System.Globalization;
|
|
using Newtonsoft.Json;
|
|
using Newtonsoft.Json.Converters;
|
|
using VideoConcat.Common.Api.Common;
|
|
|
|
namespace VideoConcat.Common.Api.Base
|
|
{
|
|
|
|
public partial class UserLoginResponse
|
|
{
|
|
[JsonProperty("user")]
|
|
public User User { get; set; }
|
|
|
|
[JsonProperty("token")]
|
|
public string Token { get; set; }
|
|
|
|
[JsonProperty("expiresAt")]
|
|
public long ExpiresAt { get; set; }
|
|
}
|
|
|
|
public partial class User
|
|
{
|
|
[JsonProperty("ID")]
|
|
public long Id { get; set; }
|
|
|
|
[JsonProperty("CreatedAt")]
|
|
public DateTimeOffset CreatedAt { get; set; }
|
|
|
|
[JsonProperty("UpdatedAt")]
|
|
public DateTimeOffset UpdatedAt { get; set; }
|
|
|
|
[JsonProperty("uuid")]
|
|
public Guid Uuid { get; set; }
|
|
|
|
[JsonProperty("userName")]
|
|
public string UserName { get; set; }
|
|
|
|
[JsonProperty("nickName")]
|
|
public string NickName { get; set; }
|
|
|
|
[JsonProperty("headerImg")]
|
|
public Uri HeaderImg { get; set; }
|
|
|
|
[JsonProperty("authorityId")]
|
|
public long AuthorityId { get; set; }
|
|
|
|
[JsonProperty("authority")]
|
|
public Authority Authority { get; set; }
|
|
|
|
[JsonProperty("authorities")]
|
|
public List<Authority> Authorities { get; set; }
|
|
|
|
[JsonProperty("phone")]
|
|
public string Phone { get; set; }
|
|
|
|
[JsonProperty("email")]
|
|
public string Email { get; set; }
|
|
|
|
[JsonProperty("enable")]
|
|
public long Enable { get; set; }
|
|
|
|
[JsonProperty("originSetting")]
|
|
public object OriginSetting { get; set; }
|
|
}
|
|
|
|
public partial class Authority
|
|
{
|
|
[JsonProperty("CreatedAt")]
|
|
public DateTimeOffset CreatedAt { get; set; }
|
|
|
|
[JsonProperty("UpdatedAt")]
|
|
public DateTimeOffset UpdatedAt { get; set; }
|
|
|
|
[JsonProperty("DeletedAt")]
|
|
public object DeletedAt { get; set; }
|
|
|
|
[JsonProperty("authorityId")]
|
|
public long AuthorityId { get; set; }
|
|
|
|
[JsonProperty("authorityName")]
|
|
public string AuthorityName { get; set; }
|
|
|
|
[JsonProperty("parentId")]
|
|
public long ParentId { get; set; }
|
|
|
|
[JsonProperty("dataAuthorityId")]
|
|
public object DataAuthorityId { get; set; }
|
|
|
|
[JsonProperty("children")]
|
|
public object Children { get; set; }
|
|
|
|
[JsonProperty("menus")]
|
|
public object Menus { get; set; }
|
|
|
|
[JsonProperty("defaultRouter")]
|
|
public string DefaultRouter { get; set; }
|
|
}
|
|
|
|
public partial class UserLoginResponse
|
|
{
|
|
public static UserLoginResponse FromJson(string json)
|
|
{
|
|
return JsonConvert.DeserializeObject<UserLoginResponse>(json, Converter.Settings);
|
|
}
|
|
}
|
|
|
|
public static class Serialize
|
|
{
|
|
public static string ToJson(this UserLoginResponse self) => JsonConvert.SerializeObject(self, Converter.Settings);
|
|
}
|
|
|
|
internal static class Converter
|
|
{
|
|
public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings
|
|
{
|
|
MetadataPropertyHandling = MetadataPropertyHandling.Ignore,
|
|
DateParseHandling = DateParseHandling.None,
|
|
Converters =
|
|
{
|
|
new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal }
|
|
},
|
|
};
|
|
}
|
|
}
|