package cokr.xit.fims.crdn.web;

import javax.annotation.Resource;

import org.springframework.web.servlet.ModelAndView;

import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.crdn.service.CrdnStngService;

/**단속팀 관리 서비스 웹 컨트롤러.<br />
 * {웹 컨텍스트}/crdn/crdn07 로 접근할 수 있다.
 * @author leebj
 */
public class Crdn07Controller extends ApplicationController {

	public static final String CLASS_URL = "/crdn/crdn07";

	public class METHOD_URL {
		public static final String
		crackdownTeamManagementMain = "/010/main.do",
		getTeamInfo = "/010/list.do"
		;
	}

	@Resource(name="crdnStngService")
	private CrdnStngService crdnStngService;

	/** 단속팀 관리 메인화면을 연다.
	 * @return fims/crdn/crdn07010-main
	 */
	public ModelAndView crackdownTeamManagementMain() {
		ModelAndView mav = new ModelAndView();
		mav.setViewName("fims/crdn/crdn07010-main");
		mav.addObject("pageName", "crdn07010-main");

		return mav;
	}

	/**단속팀 목록을 조회한다.<br />
	 * {@link CrdnStngService#getTeamInfo(String)} 참고
	 * @param crdn 단속
	 * @return jsonView
	 */
	public ModelAndView getTeamInfo(String teamId) {
		ModelAndView mav = new ModelAndView("jsonView");
		mav.addObject("teamInfo", crdnStngService.getTeamInfo(teamId));
		return mav;
	}

}
