예제 #1
0
  /**
   * 加载所有活动列表
   *
   * @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);
  }
예제 #2
0
  /**
   * 发布活动
   *
   * @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);
  }
예제 #3
0
  /**
   * 更新活动
   *
   * @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 "";
  }
예제 #4
0
 /**
  * 删除活动
  *
  * @param activityId
  * @return
  */
 @RequestMapping("/admin/deleteActivity")
 @ResponseBody
 public String deleteActivity(Integer activityId) {
   activityService.delete(activityId);
   return "success";
 }