|
|
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; }
|
|
|
}
|
|
|
}
|