/** * 5.16 获取我收藏的问题列表 * * @param param * @param request * @return */ @ResponseBody @RequestMapping("/getMyCollectQuestion") public String getMyCollectQuestion(@RequestBody String param, HttpServletRequest request) { System.out.println(param); String backInfo = ""; try { Map<String, Object> map = JsonHandler.json2Map(param); System.out.println(map); Map<String, Object> mapHead = JsonHandler.json2MapHead(param); System.out.println(mapHead); String token = (String) mapHead.get("X-AUTH-TOKEN"); System.out.println(token); String sid = (String) map.get("sid"); System.out.println(sid); String p_size = (String) map.get("p_size"); System.out.println(p_size); if (sid.trim() == null || "".equals(sid.trim())) { sid = "1,10"; } if (p_size.trim() == null || "".equals(p_size.trim())) { p_size = "10"; } // String info = JsonHandler.objectToJson(null); // System.out.println(info); backInfo = HttpClientUtils.getToken( UrlUtil.URL + "/api/my-favorite-answers?sid=" + sid + "&p_size=" + p_size, null, token); System.out.println(backInfo); } catch (Exception e) { e.printStackTrace(); } return backInfo; }
/** * 5.10 获取我的回答列表 * * @param param * @param request * @return */ @ResponseBody @RequestMapping("/getMyAnswerList") public String getMyAnswerList(@RequestBody String param, HttpServletRequest request) { System.out.println(param); String backInfo = ""; try { Map<String, Object> map = JsonHandler.json2Map(param); System.out.println(map); Map<String, Object> mapHead = JsonHandler.json2MapHead(param); System.out.println(mapHead); String token = (String) mapHead.get("X-AUTH-TOKEN"); System.out.println(token); String sid = (String) map.get("sid"); System.out.println(sid); String status = (String) map.get("status"); System.out.println(status); String p_size = (String) map.get("p_size"); System.out.println(p_size); if (sid.trim() == null || "".equals(sid.trim())) { sid = "1"; } if (p_size.trim() == null || "".equals(p_size.trim())) { p_size = "10"; } if (status.trim() == null || "".equals(status.trim())) { status = "all"; } backInfo = HttpClientUtils.getToken( UrlUtil.URL + "/api/my-answers?sid=" + sid + "&p_size=" + p_size + "&status=" + status, null, token); System.out.println(backInfo); } catch (Exception e) { e.printStackTrace(); } return backInfo; }
/** * 5.18 获取是否点赞及收藏回答列表 * * @param param * @param request * @return */ @ResponseBody @RequestMapping("/getPraiseAnswer") public String getPraiseAnswer(@RequestBody String param, HttpServletRequest request) { System.out.println(param); String backInfo = ""; try { Map<String, Object> map = JsonHandler.json2Map(param); System.out.println(map); Map<String, Object> mapHead = JsonHandler.json2MapHead(param); System.out.println(mapHead); String token = (String) mapHead.get("X-AUTH-TOKEN"); System.out.println(token); // String info = JsonHandler.objectToJson(map); // System.out.println(info); backInfo = HttpClientUtils.getToken(UrlUtil.URL + "/api/qa/answer/favorites-ranks", null, token); System.out.println(backInfo); } catch (Exception e) { e.printStackTrace(); } return backInfo; }