JuHeAPIResult.cs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections.Specialized;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace OASystem.Domain.ViewModels.JuHeExchangeRate
  8. {
  9. /// <summary>
  10. /// 聚合接口 Result
  11. /// </summary>
  12. public class JuHeAPIResult
  13. {
  14. /// <summary>
  15. /// 服务级错误码
  16. /// 202301 查询不到结果
  17. /// </summary>
  18. public int Error_code { get; set; }
  19. /// <summary>
  20. /// 系统级错误码
  21. /// 错误码 说明 旧版本(resultcode)
  22. /// 10001 错误的请求KEY 101
  23. /// 10002 该KEY无请求权限 102
  24. /// 10003 KEY过期 103
  25. /// 10004 错误的OPENID 104
  26. /// 10005 应用未审核超时,请提交认证 105
  27. /// 10007 未知的请求源 107
  28. /// 10008 被禁止的IP 108
  29. /// 10009 被禁止的KEY 109
  30. /// 10011 当前IP请求超过限制 111
  31. /// 10012 请求超过次数限制 112
  32. /// 10013 测试KEY超过请求限制 113
  33. /// 10014 系统内部异常(调用充值类业务时,请务必联系客服或通过订单查询接口检测订单,避免造成损失) 114
  34. /// 10020 接口维护 120
  35. /// 10021 接口停用 121
  36. /// </summary>
  37. public string? Resultcode { get; set; }
  38. /// <summary>
  39. /// 消息
  40. /// </summary>
  41. public string? Reason { get; set; }
  42. /// <summary>
  43. /// 数据源
  44. /// </summary>
  45. public object? Result { get; set; }
  46. public JuHeAPIResult() { }
  47. public JuHeAPIResult(int code, string reason)
  48. {
  49. Error_code = code;
  50. Resultcode = "-1 参数错误";
  51. Reason = reason;
  52. Result = new { };
  53. }
  54. public JuHeAPIResult(int code,string resultcode,string reason,object? result)
  55. {
  56. Error_code = code;
  57. Resultcode = resultcode;
  58. Reason = reason;
  59. Result = result;
  60. }
  61. }
  62. /// <summary>
  63. /// 汇率接口 返回实体类
  64. /// </summary>
  65. public class ExchangeRateModel
  66. {
  67. /// <summary>
  68. /// 货币名称
  69. /// </summary>
  70. public string? Name { get; set; }
  71. /// <summary>
  72. /// 现汇买入价
  73. /// </summary>
  74. public string? FBuyPri { get; set; }
  75. /// <summary>
  76. /// 现钞买入价
  77. /// </summary>
  78. public string? MBuyPri { get; set; }
  79. /// <summary>
  80. /// 现汇卖出价
  81. /// </summary>
  82. public string? FSellPri { get; set; }
  83. /// <summary>
  84. /// 现钞卖出价
  85. /// </summary>
  86. public string? MSellPri { get; set; }
  87. /// <summary>
  88. /// 银行折算价/中间价
  89. /// </summary>
  90. public string? BankConversionPri { get; set; }
  91. /// <summary>
  92. /// 发布日期
  93. /// </summary>
  94. public string? Date { get; set; }
  95. /// <summary>
  96. /// 发布时间
  97. /// </summary>
  98. public string? Time { get; set; }
  99. }
  100. /// <summary>
  101. /// 汇率 币种Model
  102. /// </summary>
  103. public record RateCurrencyModel
  104. {
  105. /// <summary>
  106. /// 币种名称
  107. /// </summary>
  108. public string CurrencyName { get; set; }
  109. /// <summary>
  110. /// 币种Code
  111. /// </summary>
  112. public string CurrencyCode{ get; set; }
  113. }
  114. public class JuHeTransResult
  115. {
  116. public int error_code { get; set; }
  117. public string reason { get; set; }
  118. public result result { get; set; }
  119. }
  120. public class result
  121. {
  122. public data data { get; set; }
  123. public string orderid { get; set; }
  124. }
  125. public class data {
  126. public string res { get; set; }
  127. public double confidence { get; set; }
  128. }
  129. public class ContinentInfoView
  130. {
  131. public string name { get; set; }
  132. public string name_en { get; set; }
  133. public TimezoneInfoView[] tz { get; set; }
  134. }
  135. public class TimezoneInfoView
  136. {
  137. public string tz_name { get; set; }
  138. public string tz_simple { get; set; }
  139. public string time { get; set; }
  140. public long timestamp { get; set; }
  141. public string timezone { get; set; }
  142. public string week { get; set; }
  143. public string timezone_abbreviation { get; set; }
  144. }
  145. }