package com.eactive.eai.rms.common.acl.sitemap;

import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.eactive.eai.rms.common.base.BaseAnnotationController;

@Controller
@RequiredArgsConstructor
public class SitemapController extends BaseAnnotationController {

	private final SitemapService sitemapService;

	@GetMapping(value = "/common/acl/sitemap/sitemapMan.view")
	public String view(@RequestParam(value = "serviceType", required = false) String serviceType, Model model) {
		model.addAttribute("sitemapTree", sitemapService.getSitemapTree(serviceType));
		return "/common/acl/sitemap/sitemapMan";
	}

}
