package com.lightinit.hsdatashow.controller.admin;

import com.lightinit.hsdatashow.model.admin.CountrysideNameAndValue;
import com.lightinit.hsdatashow.service.admin.ICountrysideService;
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;

@Controller
@RequestMapping(value = "/admin/countryside")
public class CountrysideController {

    @Autowired
    private ICountrysideService countrysideService ;

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


    //农村自来水普及率
    @RequestMapping("/getCountrysideWater.action")
    @ResponseBody
    public CountrysideNameAndValue getCountrysideWater(){
        CountrysideNameAndValue countrysideNameAndValue = countrysideService.getCountrysideWater() ;
        return countrysideNameAndValue ;
    }

    //农村无害化厕所普及率
    @RequestMapping("/getCountrysideWc.action")
    @ResponseBody
    public CountrysideNameAndValue getCountrysideWc(){
        CountrysideNameAndValue countrysideNameAndValue = countrysideService.getCountrysideWc() ;
        return countrysideNameAndValue ;
    }

    //农村生活污水处理率
    @RequestMapping("/getCountrysideSewage.action")
    @ResponseBody
    public CountrysideNameAndValue getCountrysideSewage(){
        CountrysideNameAndValue countrysideNameAndValue = countrysideService.getCountrysideSewage() ;
        return countrysideNameAndValue ;
    }

    //农村生活垃圾无害化处理率
    @RequestMapping("/getCountrysideGarbage.action")
    @ResponseBody
    public CountrysideNameAndValue getCountrysideGarbage(){
        CountrysideNameAndValue countrysideNameAndValue = countrysideService.getCountrysideGarbage() ;
        return countrysideNameAndValue ;
    }

    //农村生活污水排名
    @RequestMapping("/getCountrysideSewageRanking.action")
    @ResponseBody
    public CountrysideNameAndValue getCountrysideSewageRanking(){
        CountrysideNameAndValue countrysideNameAndValue = countrysideService.getCountrysideSewageRanking() ;
        return countrysideNameAndValue ;
    }

    //农村生活垃圾无害化排名
    @RequestMapping("/getCountrysideGarbageRanking.action")
    @ResponseBody
    public CountrysideNameAndValue getCountrysideGarbageRanking(){
        CountrysideNameAndValue countrysideNameAndValue = countrysideService.getCountrysideGarbageRanking() ;
        return countrysideNameAndValue ;
    }
}
