You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
92 lines
2.8 KiB
92 lines
2.8 KiB
using System; |
|
using System.Collections.Generic; |
|
using System.Text; |
|
using System.Text.Json.Serialization; |
|
|
|
namespace Common.Shared.Application.DaHua |
|
{ |
|
/// <summary> |
|
/// 请求登录令牌的参数实体类 |
|
/// </summary> |
|
public class LoginRequestDto |
|
{ |
|
/// <summary> |
|
/// 授权类型,固定值:password |
|
/// </summary> |
|
[JsonPropertyName("grant_type")] |
|
public string GrantType { get; set; } = "password"; // 默认值 |
|
|
|
/// <summary> |
|
/// 用户名 |
|
/// </summary> |
|
[JsonPropertyName("username")] |
|
public string Username { get; set; } |
|
|
|
/// <summary> |
|
/// 平台密码(需使用RSA公钥加密后的密文) |
|
/// </summary> |
|
[JsonPropertyName("password")] |
|
public string Password { get; set; } |
|
|
|
/// <summary> |
|
/// 凭证ID(在ICC平台申请) |
|
/// </summary> |
|
[JsonPropertyName("client_id")] |
|
public string ClientId { get; set; } |
|
|
|
/// <summary> |
|
/// 凭证密钥(在ICC平台申请) |
|
/// </summary> |
|
[JsonPropertyName("client_secret")] |
|
public string ClientSecret { get; set; } |
|
|
|
/// <summary> |
|
/// RSA公钥(用于服务端验证加密方式,或客户端上传当前使用的公钥) |
|
/// 本身不能空,但是这块不传是在服务端获取的 |
|
/// </summary> |
|
[JsonPropertyName("public_key")] |
|
public string? PublicKey { get; set; } |
|
|
|
/// <summary> |
|
/// 动态验证码(可选) |
|
/// </summary> |
|
[JsonPropertyName("code")] |
|
public string? Code { get; set; } |
|
|
|
/// <summary> |
|
/// 是否启用动态验证码功能:0 关闭,1 开启(默认0) |
|
/// </summary> |
|
[JsonPropertyName("verifyCodeFlag")] |
|
public int VerifyCodeFlag { get; set; } = 0; |
|
} |
|
|
|
/// <summary> |
|
/// 刷新 access_token 的请求参数模型 |
|
/// </summary> |
|
public class RefreshTokenReqDto |
|
{ |
|
/// <summary> |
|
/// 认证类型,固定值:refresh_token |
|
/// </summary> |
|
[JsonPropertyName("grant_type")] |
|
public string GrantType { get; set; } = "refresh_token"; // 默认值,通常固定 |
|
|
|
/// <summary> |
|
/// 客户端ID(与认证接口中一致) |
|
/// </summary> |
|
[JsonPropertyName("client_id")] |
|
public string ClientId { get; set; } |
|
|
|
/// <summary> |
|
/// 客户端密钥(与认证接口中一致) |
|
/// </summary> |
|
[JsonPropertyName("client_secret")] |
|
public string ClientSecret { get; set; } |
|
|
|
/// <summary> |
|
/// 刷新令牌(refresh_token),用于获取新的 access_token |
|
/// </summary> |
|
[JsonPropertyName("refresh_token")] |
|
public string RefreshToken { get; set; } |
|
} |
|
} |