use of com.funstill.kelefun.data.api.AccountApi in project keleFanfou by kelefun.
the class AccountService method getUserInfo.
/**
* @param auth 用户 Id
*/
public UserInfo getUserInfo(OAuthToken auth) {
Retrofit retrofit = BaseRetrofit.retrofit(new SignInterceptor());
AccountApi api = retrofit.create(AccountApi.class);
Call<ResponseBody> call = api.verifyCred();
try {
Response<ResponseBody> response = call.execute();
// LogHelper.d(response.body().string());
} catch (Exception e) {
// TODO handle errors
e.printStackTrace();
LogHelper.e(e.getMessage());
}
return null;
}
use of com.funstill.kelefun.data.api.AccountApi in project keleFanfou by kelefun.
the class AccountService method saveUserInfo.
public void saveUserInfo(Context mContext) {
Retrofit retrofit = BaseRetrofit.retrofit(new SignInterceptor());
AccountApi api = retrofit.create(AccountApi.class);
Call<UserInfo> call = api.verifyCred();
try {
UserInfo userInfo = call.execute().body();
new AccountStore(mContext).saveAccount(userInfo);
} catch (IOException e) {
e.printStackTrace();
}
}
Aggregations