package kcg.imis.moniter.web;

import java.util.List;

import javax.annotation.Resource;

import kcg.imis.moniter.service.MoniterService;
import kcg.imis.moniter.vo.MoniterVO;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
  * @FileName : MoniterController.java
  * @Project : 국제해양프로젝트
  * @Date : 2018. 4. 13. 
  * @작성자 : Moon
  * @변경이력 : 
  * @프로그램 설명 :
 */
@Controller
@RequestMapping("/moniter")
public class MoniterController {

	@Resource(name = "moniterService")
	MoniterService moniterService;

	@RequestMapping(value = "/list.do")
	public String reportSaveList(@RequestParam(value="idx", required=false) String idx, final Model model) {
		
		try {
			if(idx == null) idx = "1";
			model.addAttribute("data", moniterService.getMoniterList(idx));
			model.addAttribute("idx", idx);
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		return "moniter/moniterList.tiles";
	}
	
	/*@ResponseBody
	@RequestMapping(value = "/getMoniterList.json")
	public List<MoniterVO>  getMemberListAll(@RequestParam(value="idx", required=false) String idx) throws Exception {
		return moniterService.getMemberList(idx);
	}*/
	
}
