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.

115 lines
3.0 KiB
C#

9 months ago
using System;
using Newtonsoft.Json;
namespace POSV.HttpApi
{
[Serializable]
[JsonObject(MemberSerialization.OptIn)]
public class OpenApi
{
/// <summary>
/// 租户ID
/// </summary>
[JsonProperty(PropertyName = "tenantId")]
public string TenantId { get; set; }
/// <summary>
/// API的接口类型
/// </summary>
public ApiType ApiType { get; set; }
/// <summary>
/// 应用标识
/// </summary>
[JsonProperty(PropertyName = "appKey")]
public string AppKey { get; set; }
/// <summary>
/// 应用密钥
/// </summary>
[JsonProperty(PropertyName = "appSecret")]
public string AppSecret { get; set; }
/// <summary>
/// 服务器地址,包含端口
/// </summary>
[JsonProperty(PropertyName = "url")]
public string Url { get; set; }
/// <summary>
/// 服务器地址包含端口不需要验证AppKey
/// </summary>
[JsonProperty(PropertyName = "open")]
public string Open { get; set; }
/// <summary>
/// 本地化类型默认zh_CN
/// </summary>
[JsonProperty(PropertyName = "locale")]
public string Locale { get; set; }
/// <summary>
/// 报文的格式支持XML和JSON默认JSON
/// </summary>
[JsonProperty(PropertyName = "format")]
public string Format { get; set; }
/// <summary>
/// 客户端类型(apple,iPad,iPhone,Android,desktop,WP,web)
/// </summary>
[JsonProperty(PropertyName = "client")]
public string Client { get; set; }
/// <summary>
/// 服务方法的版本号
/// </summary>
[JsonProperty(PropertyName = "version")]
public string Version { get; set; }
/// <summary>
/// 负载均衡方式
/// </summary>
[JsonProperty(PropertyName = "routing")]
public int Routing { get; set; }
/// <summary>
/// 说明
/// </summary>
[JsonProperty(PropertyName = "memo")]
public string Memo { get; set; }
public override int GetHashCode()
{
return (AppKey + AppSecret).GetHashCode();
}
}
public class ServerUrls
{
/// <summary>
/// 服务器Id
/// </summary>
[JsonProperty(PropertyName = "id")]
public string Id { get; set; }
/// <summary>
/// Http或者Https
/// </summary>
[JsonProperty(PropertyName = "protocol")]
public string Protocol { get { return "https"; } }
/// <summary>
/// 服务器地址,包含端口
/// </summary>
[JsonProperty(PropertyName = "url")]
public string Url { get; set; }
/// <summary>
/// 服务器备注说明
/// </summary>
[JsonProperty(PropertyName = "memo")]
public string Memo { get; set; }
}
}