package com.lightinit.hsdatashow.controller.admin;

import com.lightinit.hsdatashow.entity.SocialSafety;
import com.lightinit.hsdatashow.model.admin.ServiceExpenditureListModel;
import com.lightinit.hsdatashow.model.admin.SpreadListModel;
import com.lightinit.hsdatashow.model.admin.UnemploymentListModel;
import com.lightinit.hsdatashow.service.admin.IProgressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

@Controller
@RequestMapping(value = "/admin/progress")
public class ProgressController {
    @Autowired
    private IProgressService progressService;

    @RequestMapping(value = "index.htm")
    public ModelAndView index(){
        ModelAndView modelAndView = new ModelAndView("admin/progress/index");
        return modelAndView;
    }
    @RequestMapping(value = "/getServiceExpenditure.action")
    @ResponseBody
    public ServiceExpenditureListModel getServiceExpenditure(){
        ServiceExpenditureListModel list =progressService.getServiceExpenditure();
        return list;
    }

    @RequestMapping(value = "/getYearsEducation.action")
    @ResponseBody
    public UnemploymentListModel getYearsEducation(){
        UnemploymentListModel list =progressService.getYearsEducation();
        return list;
    }

    @RequestMapping(value = "/getSocialSecurity.action")
    @ResponseBody
    public SpreadListModel getSocialSecurity(){
        SpreadListModel list =progressService.getSocialSecurity();
        return list;
    }

    @RequestMapping(value = "/getChildMortality.action")
    @ResponseBody
    public UnemploymentListModel getChildMortality(){
        UnemploymentListModel list =progressService.getChildMortality();
        return list;
    }
    @RequestMapping(value = "/getSocialSafety.action")
    @ResponseBody
    public List<SocialSafety> getSocialSafety(){
        List<SocialSafety> list =progressService.getSocialSafety();
        return list;
    }


}
