/** * 加载所有活动列表 * * @param pager * @return */ @RequestMapping(value = "/college/activities", method = RequestMethod.POST) @ResponseBody public Pager<Activity> pager(Pager<Activity> pager, HttpSession session) { College college = (College) session.getAttribute("user"); return activityService.findAllByPage(pager, college); }
/** * 发布活动 * * @param activity * @return */ @RequestMapping(value = "/admin/pubActivity", method = RequestMethod.POST) @ResponseBody public String pubActivity(Activity activity, HttpSession session) { College college = (College) session.getAttribute("user"); activity.setCollege(college); return activityService.add(activity); }
/** * 更新活动 * * @param activity * @return */ @RequestMapping(value = "/college/updateActivity", method = RequestMethod.POST) @ResponseBody public String updateActivity(Activity activity) { String res = activityService.updateActivity(activity); if ("success" == res) { return activity.getActivityUuid(); } return ""; }
/** * 删除活动 * * @param activityId * @return */ @RequestMapping("/admin/deleteActivity") @ResponseBody public String deleteActivity(Integer activityId) { activityService.delete(activityId); return "success"; }