package incheon.sgp.bas.web;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import incheon.com.cmm.context.RequestContext;
import incheon.sgp.bas.service.BasMapService;
import lombok.RequiredArgsConstructor;

/**
 * @ClassName : PorController.java
 * @Description : 공간정보포털 컨트롤러
 *
 * @author : 관리자
 * @since : 2025. 07. 17
 * @version : 1.0
 *
 *          <pre>
 * << 개정이력(Modification Information) >>
 *
 *   수정일              수정자               수정내용
 *  -------------  ------------   ---------------------
 *   2023. 10. 10    관리자               최초 생성
 *   2024. 12. 19    관리자               패널 기반 플랫폼으로 전면 개편
 *   2025. 07. 17    관리자               공간정보포털로 전환
 *          </pre>
 *
 */
@Controller
@RequestMapping("/sgp/bas")
@RequiredArgsConstructor
public class BasMapController {

	private final BasMapService porMapService;

	/**
	 * 통합포탈 메인화면 진입페이지
	 * 
	 * @param model
	 * @return JSP 페이지
	 * @exception Exception
	 */
	@GetMapping("/main.do")
	public String viewMap(ModelMap model) throws Exception {

		String userId = RequestContext.getCurrentUserId();
		if (userId != null) {
			model.addAttribute("isManager", true);
		} else {
			model.addAttribute("isManager", false);
		}

		return "sgp/bas/main/map";
	}

}