public static XTResult<Void> addTravel(String uuid, String travelName, String travelId, String startDate,
JSONArray travelCities) {
String partUrl = "/travelModel/addTravelModel";
XTResult<Void> result = null;
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("token", ServiceCenter.TOKEN_VALUE);
jsonObject.put("uuid", uuid);
jsonObject.put("name", travelName);
jsonObject.put("travelId", travelId);
jsonObject.put("startTime", startDate);
jsonObject.put("travelCities", travelCities);
StringEntity entity = new StringEntity(jsonObject.toString(), HTTP.UTF_8);
entity.setContentType("application/json");
entity.setContentEncoding("utf-8");
String response = ServiceCenter.postEntityApiV1(partUrl, entity);
Logger.d(Const.TAG_LOG, "addTravel:" + response);
if (!TextUtils.isEmpty(response)) {
result = new Gson().fromJson(response, XTResult.class);
}
} catch (JSONException e) {
e.printStackTrace();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return result;
}