示例#1
0
 @RequestMapping(value = "/api/courseSession/query", method = RequestMethod.GET)
 public @ResponseBody HashMap<String, Object> courseSession(HttpServletRequest req) {
   HashMap<String, Object> h = new HashMap<String, Object>();
   int uid = Integer.parseInt((String) req.getAttribute("uid"));
   try {
     List<CourseSession> l = csService.getCourseSessionByUID(uid);
     h.put("code", 0);
     h.put("data", l);
     h.put("count", l.size());
   } catch (Exception e) {
     logger.info(e.toString());
     h.put("code", 2);
     h.put("msg", "操作中发生异常!");
   }
   return h;
 }