Skip to content

baofei/RetrofitAnnotation

Repository files navigation

RetrofitAnnotation

retrofit 和 annotation Processor ,EventBus结合使用的一个简单示例 用annotation processor 把Retrofit的接口生成Manager,如

public final class ApiServiceManager extends BaseManager { private static ApiServiceManager sApiServiceManager;

public static synchronized ApiServiceManager getInstance() { if (sApiServiceManager == null) { sApiServiceManager = new ApiServiceManager(); } return sApiServiceManager; }

public Call getDefaultAddr() { Call call = getService().getDefaultAddr(); call.enqueue(new ApCallBack(ResultBean.class)); return call; } }

请求成功的数据将会使用EventBus post出去

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages