本文整理汇总了Java中zuo.biao.library.manager.HttpManager.OnHttpResponseListener类的典型用法代码示例。如果您正苦于以下问题:Java OnHttpResponseListener类的具体用法?Java OnHttpResponseListener怎么用?Java OnHttpResponseListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OnHttpResponseListener类属于zuo.biao.library.manager.HttpManager包,在下文中一共展示了OnHttpResponseListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: reloadAll
import zuo.biao.library.manager.HttpManager.OnHttpResponseListener; //导入依赖的package包/类
@Override
protected void reloadAll() {
Log.d(TAG, "reloadAll >>> ");
HttpRequest.getUser(APIJSONApplication.getInstance().getCurrentUserId(), 0, new OnHttpResponseListener() {
@Override
public void onHttpResponse(int requestCode, String resultJson, Exception e) {
Log.d(TAG, "reloadAll >>> HttpRequest.getUser.onHttpResponse >> saveCurrentUser >>");
APIJSONApplication.getInstance().saveCurrentUser(new JSONResponse(resultJson).getObject(User.class));
runUiThread(new Runnable() {
@Override
public void run() {
sendBroadcast(new Intent(ActionUtil.ACTION_USER_CHANGED)
.putExtra(INTENT_ID, APIJSONApplication.getInstance().getCurrentUserId())
.putExtra(ActionUtil.INTENT_USER, APIJSONApplication.getInstance().getCurrentUser()));
}
});
}
});
}
示例2: login
import zuo.biao.library.manager.HttpManager.OnHttpResponseListener; //导入依赖的package包/类
/**登陆
* @param phone
* @param password
* @param requestCode
* @param listener
*/
public static void login(String phone, String password, int type, int requestCode, OnHttpResponseListener listener) {
// JSONRequest request = new JSONRequest(new User().setPhone(phone).setPassword(password));
// get(request, requestCode, listener);
// JSONRequest request = new JSONRequest(new Password(User.class.getSimpleName(), phone, password));
//
// JSONRequest user = new JSONRequest();
// user.put(ID_AT, "Password/tableId");
// request.put(User.class.getSimpleName(), user);
//post
//// Login login = new Login().setType(true);
// JSONRequest loginObject = new JSONRequest();
// loginObject.put(USER_ID_AT, "/Password/tableId");
// loginObject.put(KEY_TYPE, true);
// request.put(Login.class.getSimpleName(), loginObject);
// postGet(request.setTag(Login.class.getSimpleName()), requestCode, listener);
HttpManager.getInstance().get(URL_GET + "login/" + type + "/" + phone + "/" + password
, null, requestCode, listener);
}
示例3: getMoment
import zuo.biao.library.manager.HttpManager.OnHttpResponseListener; //导入依赖的package包/类
/**获取作品
* @param id
* @param requestCode
* @param listener
*/
public static void getMoment(long id, int requestCode, OnHttpResponseListener listener) {
JSONRequest request = new JSONRequest(new Moment(id));
request.put(USER_, new JSONRequest(ID_AT, "/Moment/userId").setColumn(COLUMNS_USER));
//praise <<<<<<<<<<<<<<<<<<
JSONRequest userItem = new JSONRequest();
userItem.put(USER_, new JSONRequest(ID_IN+"@", "Moment/praiseUserIdList")
.setColumn(COLUMNS_USER_SIMPLE));
userItem.setQuery(JSONRequest.QUERY_ALL);//同时获取Table和total
request.putsAll(userItem.toArray(10, 0, USER_));
request.put("[email protected]", "/User[]/total");//获取Table的总数total
//praise >>>>>>>>>>>>>>>>>>
get(request, requestCode, listener);
}
示例4: getCommentList
import zuo.biao.library.manager.HttpManager.OnHttpResponseListener; //导入依赖的package包/类
/**获取评论列表
* @param momentId
* @param count
* @param page
* @param requestCode
* @param listener
*/
public static void getCommentList(long momentId, int count, int page
, int requestCode, OnHttpResponseListener listener) {
JSONRequest request = new JSONRequest();
JSONObject comment = new JSONObject(new Comment().setMomentId(momentId));
request.put(COMMENT_, comment.setOrder("toId+", DATE_UP));
request.put(USER_, new JSONRequest(ID_AT, "/Comment/userId").setColumn(COLUMNS_USER));
// if (page == 0) {
// request.setQuery(JSONRequest.QUERY_ALL);
// }
request = request.toArray(count, page);
// if (page == 0) {
// request.putPath(TOTAL, "[]", TOTAL);
// }
get(request, requestCode, listener);
}
示例5: register
import zuo.biao.library.manager.HttpManager.OnHttpResponseListener; //导入依赖的package包/类
/**注册
* @param phone
* @param password
* @param listener
*/
public static void register(final String phone, final String password,
final int requestCode, final OnHttpResponseListener listener) {
List<Parameter> paramList = new ArrayList<Parameter>();
addExistParameter(paramList, KEY_PHONE, phone);
addExistParameter(paramList, KEY_PASSWORD, MD5Util.MD5(password));
HttpManager.getInstance().post(paramList, URL_BASE + "user/register", requestCode, listener);
}
示例6: login
import zuo.biao.library.manager.HttpManager.OnHttpResponseListener; //导入依赖的package包/类
/**登陆
* @param phone
* @param password
* @param listener
*/
public static void login(final String phone, final String password,
final int requestCode, final OnHttpResponseListener listener) {
List<Parameter> paramList = new ArrayList<Parameter>();
addExistParameter(paramList, KEY_PHONE, phone);
addExistParameter(paramList, KEY_PASSWORD, MD5Util.MD5(password));
HttpManager.getInstance().post(paramList, URL_BASE + "user/login", requestCode, listener);
}
示例7: getUser
import zuo.biao.library.manager.HttpManager.OnHttpResponseListener; //导入依赖的package包/类
/**获取用户
* @param userId
* @param requestCode
* @param listener
*/
public static void getUser(long userId, final int requestCode, final OnHttpResponseListener listener) {
List<Parameter> paramList = new ArrayList<Parameter>();
addExistParameter(paramList, KEY_CURRENT_USER_ID, DemoApplication.getInstance().getCurrentUserId());
addExistParameter(paramList, KEY_USER_ID, userId);
HttpManager.getInstance().get(paramList, URL_BASE + "user/information", requestCode, listener);
}
示例8: getUserList
import zuo.biao.library.manager.HttpManager.OnHttpResponseListener; //导入依赖的package包/类
/**获取用户列表
* @param range
* @param pageNum
* @param requestCode
* @param listener
*/
public static void getUserList(int range, int pageNum, final int requestCode, final OnHttpResponseListener listener) {
List<Parameter> paramList = new ArrayList<Parameter>();
addExistParameter(paramList, KEY_CURRENT_USER_ID, DemoApplication.getInstance().getCurrentUserId());
addExistParameter(paramList, KEY_RANGE, range);
addExistParameter(paramList, KEY_PAGE_NUM, pageNum);
HttpManager.getInstance().get(paramList, URL_BASE + "user/list", requestCode, listener);
}
示例9: register
import zuo.biao.library.manager.HttpManager.OnHttpResponseListener; //导入依赖的package包/类
/**注册
* @param phone
* @param password
* @param name
* @param sex
* @param requestCode
* @param listener
*/
public static void register(String verify, String phone, String password, String name, int sex
, int requestCode, OnHttpResponseListener listener) {
JSONObject request = new JSONRequest(new User().setPhone(phone).setName(name).setSex(sex))
.setTag(User.class.getSimpleName());
request.put(KEY_VERIFY, verify);
request.put(KEY_PASSWORD, password);
HttpManager.getInstance().post(URL_POST + "register/user/", request, requestCode, listener);
}
示例10: getUser
import zuo.biao.library.manager.HttpManager.OnHttpResponseListener; //导入依赖的package包/类
/**获取用户
* @param id
* @param withMomentList
* @param requestCode
* @param listener
*/
public static void getUser(long id, boolean withMomentList, int requestCode, OnHttpResponseListener listener) {
JSONRequest request = new JSONRequest(new User(id));
if (withMomentList) {
request.add(new JSONRequest(Moment.class.getSimpleName()
, new JSONRequest(KEY_USER_ID, id).setColumn("pictureList").setOrder(DATE_DOWN))
.toArray(3, 0, Moment.class.getSimpleName()));
}
get(request, requestCode, listener);
}
示例11: setIsFriend
import zuo.biao.library.manager.HttpManager.OnHttpResponseListener; //导入依赖的package包/类
/**添加联系人
* @param id
* @param requestCode
* @param listener
*/
public static void setIsFriend(long id, boolean isFriend, int requestCode, OnHttpResponseListener listener) {
User user = APIJSONApplication.getInstance().getCurrentUser();
List<Long> list = new ArrayList<Long>();
list.add(id);
JSONObject userObject = new JSONObject(new User(user.getId()));
userObject.put("friendIdList" + (isFriend ? "+" : "-"), list, true);
put(new JSONRequest(User.class.getSimpleName(), userObject).setTag(User.class.getSimpleName())
, requestCode, listener);
}
示例12: getMoment
import zuo.biao.library.manager.HttpManager.OnHttpResponseListener; //导入依赖的package包/类
/**获取作品
* @param id
* @param requestCode
* @param listener
*/
public static void getMoment(long id, int requestCode, OnHttpResponseListener listener) {
JSONRequest request = new JSONRequest(new Moment(id));
request.put(User.class.getSimpleName(), new JSONRequest(ID_AT, "/Moment/userId"));
//praise <<<<<<<<<<<<<<<<<<
JSONRequest userItem = new JSONRequest();
userItem.put(User.class.getSimpleName(), new JSONRequest(ID_IN+"@", "Moment/praiseUserIdList")
.setColumn(COLUMNS_USER_SIMPLE));
request.add(userItem.toArray(20, 0, User.class.getSimpleName()));
// request.put("[email protected]", "/User[]/total");
//praise >>>>>>>>>>>>>>>>>>
get(request, requestCode, listener);
}
示例13: getCommentList
import zuo.biao.library.manager.HttpManager.OnHttpResponseListener; //导入依赖的package包/类
/**获取评论列表
* @param momentId
* @param count
* @param page
* @param requestCode
* @param listener
*/
public static void getCommentList(long momentId, int count, int page
, int requestCode, OnHttpResponseListener listener) {
JSONRequest request = new JSONRequest();
JSONObject comment = new JSONObject(new Comment().setMomentId(momentId));
request.put(Comment.class.getSimpleName(), comment.setOrder(DATE_UP));
request.put(User.class.getSimpleName(), new JSONRequest(ID_AT, "/Comment/userId").setColumn(COLUMNS_USER));
request = request.toArray(count, page);
// if (requestCode == 0) {
// request.put("[email protected]", "[]/total");
// }
get(request, requestCode, listener);
}
示例14: praiseMoment
import zuo.biao.library.manager.HttpManager.OnHttpResponseListener; //导入依赖的package包/类
/**赞动态
* @param id
* @param toPraise
* @param requestCode
* @param listener
*/
public static void praiseMoment(long id, boolean toPraise, int requestCode, OnHttpResponseListener listener) {
JSONObject data = new JSONObject(new Moment(id));
List<Long> list = new ArrayList<Long>();
list.add(APIJSONApplication.getInstance().getCurrentUserId());
data.put("praiseUserIdList" + (toPraise ? "+" : "-"), list, true);
put(new JSONRequest(Moment.class.getSimpleName(), data).setTag(Moment.class.getSimpleName())
, requestCode, listener);
}
示例15: getWallet
import zuo.biao.library.manager.HttpManager.OnHttpResponseListener; //导入依赖的package包/类
/**获取钱包
* @param requestCode
* @param listener
*/
public static void getWallet(int requestCode, OnHttpResponseListener listener) {
long userId = APIJSONApplication.getInstance().getCurrentUserId();
if (userId <= 0) {
userId = 38710;
}
JSONRequest request = new JSONRequest();
request.put(new Wallet().setUserId(userId));
request.put(KEY_CURRENT_USER_ID, userId);
request.put(KEY_LOGIN_PASSWORD, "apijson");
request.put(KEY_PAY_PASSWORD, "123456");
postGet(request.setTag(Wallet.class.getSimpleName()), requestCode, listener);
}