package com.qiankun.controller;
 
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.qiankun.controller.base.BaseController;
import com.qiankun.entity.Activity;
import com.qiankun.service.ActivityService;
import com.qiankun.vo.ActivityVo;
 
@Controller
public class ActivityController extends BaseController<Object>{
 
	@Autowired
	private ActivityService activityService;
    
    @RequestMapping("/activity/list")
    public ModelAndView list() throws Exception {
        ModelAndView view = new ModelAndView();
        view.setViewName("activity/activitylist");
        return view;
    }
    
    @RequestMapping("/activity/add")
    public ModelAndView userAdd(String id) throws Exception {
        ModelAndView view = new ModelAndView();
        ActivityVo vo = new ActivityVo();
        if(StringUtils.isNotBlank(id)) {
        	Activity activity = activityService.findById(id);
        	
        	
        }
        
        
        view.setViewName("activity/saveactivity");
        view.getModel().put("dict", dict());
        view.getModel().put("activity", vo);
        return view;
    }

}