【问题标题】:RestFULL Api with many Models (Android)具有多种模型的 RestFUL Api (Android)
【发布时间】:2019-06-27 14:40:21
【问题描述】:

我无法理解有关 Rest API 的一些问题。 我使用 JSON 和 POJO 制作了 2 个应用程序。在这种情况下,我有一个 BIG JSON 文件,使用 Retrofit 并继续使用应用程序就足够了。

今天我发现了另一个挑战。我想使用来自 HitBTC 的 Api:

https://api.hitbtc.com/api/2/explore/

我不知道我需要使用哪些存储库来在应用程序中显示基本货币信息。你能帮我理解这个库吗?

感谢任何提示;)

【问题讨论】:

  • 这些端点似乎返回货币信息:GET /public/currencyGET /public/currency/{currency}

标签: android json rest pojo


【解决方案1】:

这些端点似乎返回货币信息:GET /public/currencyGET /public/currency/{currency}

所以对于列出所有货币的 JSON,尝试查询

https://api.hitbtc.com/api/2/public/currency

对于特定的货币

https://api.hitbtc.com/api/2/public/currency/{currency}

以以太坊为例

https://api.hitbtc.com/api/2/public/currency/ETH

【讨论】:

  • 简单回复就是最好的回复 :) 谢谢 :)
【解决方案2】:

首先,您将编写一个模块,作为该 HitBTC API 的 WS 客户端。为此,我会遵循DTO 设计模式。

【讨论】:

  • 谢谢 :) 会有帮助的
猜你喜欢
  • 2015-11-02
  • 1970-01-01
  • 2015-05-15
  • 2014-03-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多