解耦的套路,核心的代理——手撸Retrofit核动力

2019-05-25  本文已影响0人  Ahwind

Retrofit用到的设计模式

解释Retrofit

解释ServiceMethod

解释converterFactory

解释callAdapterFactory

传统风格
httpMethod="GET";
url="/v_2.0/no_login/company/home_view";
finalRequest=url+"?dealerId=001&id=002";

REST风格
@GET("/v_2.0/no_login/company/home_view/{dealerId}/{id}")

demo:https://github.com/ApeCold/Learn_Retrofit_Sample

上一篇 下一篇

猜你喜欢

热点阅读