Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

这种如何处理? #223

Open
AdminQQZ opened this issue Apr 16, 2020 · 5 comments
Open

这种如何处理? #223

AdminQQZ opened this issue Apr 16, 2020 · 5 comments

Comments

@AdminQQZ
Copy link

{"code":1,"message":"成功","total":null,"currentPage":null,"size":null,"data":"这是一个字符串"}

public <T> Disposable execute(CallBack<T> callBack) {
    return execute(new CallBackProxy<ApiResult<T>, T>(callBack) {
    });
} 你这里强制固定了。APiRusult 外界传了后,都无法改变
@AdminQQZ
Copy link
Author

  OkGo.<String>get("asdfasf")//
            .tag(this)//
            .headers(HttpHeaders.HEAD_KEY_USER_AGENT, "abcd")//
            .execute(new StringCallback() {
                @Override
                public void onSuccess(Response<String> response) {

                }
            });

他这个网络框架,传String 获取泛型就是String 这就很灵活

@AdminQQZ
Copy link
Author

如何 ApiResult 不固定这个泛型?

@eternallyjie
Copy link

如何 ApiResult 不固定这个泛型?

自定义ApiResult文档不会看吗?

@swp8200
Copy link

swp8200 commented Sep 5, 2020

你解决了吗 ? 这种类型的 数据 {
"status": "success",
"data": "token",
"time": 1599298846
}

@y1y2
Copy link

y1y2 commented Dec 25, 2020

这样的怎么解析?
"result": "true",
"message": "数据获取成功",
"data": {}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants