use of com.alibaba.fastjson.JSONObject in project ride-read-android by Ride-Read.
the class OkHttpUtils method testInviteCode.
/**
* 邀请码验证
* @param inviteCode
* @param url
* @return
*/
public Integer testInviteCode(String inviteCode, long timeStamp, String url) {
try {
JSONObject json = new JSONObject();
json.put("code", inviteCode);
json.put("sign", timeStamp);
String resp = post(url, json.toString());
if (resp == null) {
//归为未知错误
return null;
}
JSONObject jsonObject = JSONObject.parseObject(resp);
Integer status = jsonObject.getInteger("status");
return status;
} catch (JSONException e) {
return null;
} catch (Exception e) {
return null;
}
}
use of com.alibaba.fastjson.JSONObject in project ride-read-android by Ride-Read.
the class OkHttpUtils method editMessage.
/**
* 更新基本资料
* @param url
* @param
* @param phone
* @param birthDate
* @param sex
* @param name
* @param signture
* @param locale
* @param school
* @param job
* @param hometown
* @return
*/
public LoginResponse editMessage(String face_url, String phone, String birthDate, int sex, String name, String signture, String locale, String school, String job, String hometown, long timeStamp, String url, int uid, String token, double longtitude, double latitude, List<String> tags) {
try {
JSONObject json = new JSONObject();
json.put("uid", uid);
json.put("token", token);
json.put("sign", timeStamp);
json.put("school", school);
json.put("location", locale);
json.put("sex", sex);
json.put("signature", signture);
json.put("phonenumber", phone);
json.put("face_url", face_url);
json.put("career", job);
json.put("nickname", name);
json.put("hometown", hometown);
json.put("birthday", birthDate);
json.put("tags", tags);
json.put("longtitude", longtitude);
json.put("latitude", latitude);
String resp = post(url, json.toString());
if (resp == null) {
return null;
}
return new Gson().fromJson(resp, LoginResponse.class);
} catch (JSONException e) {
e.printStackTrace();
return null;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
use of com.alibaba.fastjson.JSONObject in project ride-read-android by Ride-Read.
the class OkHttpUtils method getFollower.
public PersonalInfoFollower getFollower(int uid, String token, long timeStamp, String url) {
try {
JSONObject json = new JSONObject();
json.put("uid", uid);
json.put("token", token);
json.put("sign", timeStamp);
String resp = post(url, json.toString());
if (resp == null) {
return null;
}
return new Gson().fromJson(resp, PersonalInfoFollower.class);
} catch (JSONException e) {
return null;
} catch (Exception e) {
return null;
}
}
use of com.alibaba.fastjson.JSONObject in project ride-read-android by Ride-Read.
the class OkHttpUtils method send2BackGround.
/**
*注册
* @param userName
* @param telPhone
* @param password
* @param userHeadUrl
* @param url
* @return
*/
public LoginResponse send2BackGround(String userName, String telPhone, String password, String userHeadUrl, String url) {
try {
JSONObject json = new JSONObject();
json.put("nickname", userName);
json.put("face_url", userHeadUrl);
json.put("phonenumber", telPhone);
json.put("password", password);
String resp = post(url, json.toString());
if (resp == null) {
return null;
}
return new Gson().fromJson(resp, LoginResponse.class);
} catch (JSONException e) {
return null;
} catch (Exception e) {
return null;
}
}
use of com.alibaba.fastjson.JSONObject in project ride-read-android by Ride-Read.
the class OkHttpUtils method getFollowing.
public PersonalInfoFollowing getFollowing(int uid, String token, long timeStamp, String url) {
try {
JSONObject json = new JSONObject();
json.put("uid", uid);
json.put("token", token);
json.put("sign", timeStamp);
String resp = post(url, json.toString());
if (resp == null) {
return null;
}
return new Gson().fromJson(resp, PersonalInfoFollowing.class);
} catch (JSONException e) {
return null;
} catch (Exception e) {
return null;
}
}
Aggregations