package incheon.ags.cms.history.web;

import incheon.ags.cms.admin.service.CleaningAdminService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/cms/history")
@RequiredArgsConstructor
@Slf4j
public class HistoryController {

    private final CleaningAdminService cleaningAdminService;

    @GetMapping("/driveRecordView.do")
    public String driveRecordView(ModelMap model) throws Exception {
        model.addAttribute("sggList", cleaningAdminService.selectSggList());
        model.addAttribute("cleaningTypeList", cleaningAdminService.selectCmsCmmnListByGroupCd("CLEANING_TYPE"));
        return "ags/cms/history/driveRecordView";
    }

    @GetMapping("/driveStatsMapView.do")
    public String drivePathView(ModelMap model) throws Exception {
        model.addAttribute("cleaningTypeList", cleaningAdminService.selectCmsCmmnListByGroupCd("CLEANING_TYPE"));
        return "ags/cms/history/driveStatsMapView";
    }
}
