package com.lightinit.hsdataplatform.controller.admin;

import com.lightinit.hsdataplatform.model.admin.ThemeCountSearchModel;
import com.lightinit.hsdataplatform.model.admin.ThemeStatisticsModel;
import com.lightinit.hsdataplatform.service.admin.IThemeCountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

@Controller
@RequestMapping(value = "/admin/themeStatistics")
public class ThemeStatisticsController extends BaseController {
    @Autowired
    private IThemeCountService themeCountService;

    @RequestMapping(value = "index.htm")
    public ModelAndView index(){
        ModelAndView modelAndView = new ModelAndView("admin/themeStatistics/themeCount");
        return modelAndView;
    }

    @RequestMapping(value = "list.action")
    public ModelAndView list(ThemeCountSearchModel inputModel) {
        ModelAndView modelAndView = new ModelAndView("admin/themeStatistics/themeCountList");
        List<ThemeStatisticsModel> outputModel = themeCountService.queryThemeList(inputModel);
        modelAndView.addObject("list", outputModel);
        return modelAndView;
    }

    @RequestMapping(value = "deptIndex.htm")
    public ModelAndView deptIndex(){
        ModelAndView modelAndView = new ModelAndView("admin/themeStatistics/deptCount");
        return modelAndView;
    }

    @RequestMapping(value = "deptList.action")
    public ModelAndView deptList(ThemeCountSearchModel inputModel) {
        ModelAndView modelAndView = new ModelAndView("admin/themeStatistics/deptCountList");
        List<ThemeStatisticsModel> outputModel = themeCountService.queryDeptList(inputModel);
        modelAndView.addObject("list", outputModel);
        return modelAndView;
    }

    @RequestMapping(value = "resourceIndex.htm")
    public ModelAndView resourceIndex(){
        ModelAndView modelAndView = new ModelAndView("admin/themeStatistics/resourceCount");
        return modelAndView;
    }

    @RequestMapping(value = "resourceList.action")
    public ModelAndView resourceList(ThemeCountSearchModel inputModel) {
        ModelAndView modelAndView = new ModelAndView("admin/themeStatistics/resourceCountList");
        List<ThemeStatisticsModel> outputModel = themeCountService.queryResourceList(inputModel);
        modelAndView.addObject("list", outputModel);
        return modelAndView;
    }
}
