RestFULL Api 有很多模型 (Android)

RestFULL Api with many Models (Android)

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

今天又遇到了一个挑战。我想使用来自 HitBTC 的 Api :

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

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

感谢任何提示 ;)

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

这些端点似乎 return 货币信息: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