/** * 根据 RefreshToken 获取 * * @param refreshCode RefreshToken */ public Observable<LoginData> refreshToken(String refreshCode) { return mAccountApi .refreshToken( Constants.APP_KEY, Constants.APP_SECRET, REQUEST_REDIRECT_URI_OFFICIAL, REQUEST_GRANT_TYPE_REFRESH, refreshCode) .compose(flatResult()); }
/** * 根据 AuthorizationCode 获取 AccessToken * * @param code AuthorizationCode */ public Observable<LoginData> getToken(String code) { return mAccountApi .getToken( Constants.APP_KEY, Constants.APP_SECRET, REQUEST_REDIRECT_URI_MINE, REQUEST_GRANT_TYPE_GET, code) .compose(flatResult()); }
/** * 获取 AuthorizationCode * * @param account 账号 * @param password 密码 */ public Observable<ResponseBody> getCode(String account, String password) { return mAccountApi .getCode( Constants.APP_KEY, REQUEST_REDIRECT_URI_MINE, REQUEST_RESPONSE_TYPE, REQUEST_SCOPE, REQUEST_CONFIRM, REQUEST_RESPONSE_TYPE, REQUEST_REDIRECT_URI_MINE, Constants.APP_KEY, account, password) .compose(flatResult()); }
/** * 获取用户资料 * * @param userId 用户 Id */ public Observable<UserData> getUserData(String userId) { return mAccountApi.getUserData(userId, Constants.APP_KEY).compose(flatResult()); }