public static StringBuffer json(ResponseCode responseCode, int page, int total, JSONArray jar) { JSONObject resp = new JSONObject(); try { resp.put(json_status, responseCode.getCode()); resp.put(json_desc, responseCode.getDesc()); resp.put(json_page, page); resp.put(json_total, total); resp.put(json_data, jar); } catch (JSONException e) { return json_error; } return new StringBuffer(resp.toString()); }
public static StringBuffer json(ResponseCode responseCode, JSONObject job) { return json(responseCode.getCode(), responseCode.getDesc(), job); }
public static StringBuffer json(ResponseCode responseCode, String desc) { return json(responseCode.getCode(), responseCode.getDesc() + desc); }