package com.lightinit.hsdatashow.controller.admin;

import com.lightinit.hsdatashow.model.admin.*;
import com.lightinit.hsdatashow.service.admin.ISolidWasteService;
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/solidWaste")
public class SolidWasteController {

    @Autowired
    private ISolidWasteService solidWasteService ;

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

    @RequestMapping("/getSolidwasteIndustry.action")
    @ResponseBody
    public SolidwasteIndustryResultModel getSolidwasteIndustry(){
        SolidwasteIndustryResultModel solidwasteIndustryResultModel = solidWasteService.getSolidwasteIndustry() ;
        return solidwasteIndustryResultModel ;
    }

    @RequestMapping("/getSolidwasteDanger.action")
    @ResponseBody
    public SolidwasteDangerResultModel getSolidwasteDanger(){
        SolidwasteDangerResultModel solidwasteDangerResultModel = solidWasteService.getSolidwasteDanger() ;
        return solidwasteDangerResultModel ;
    }

    @RequestMapping("/getOneSolidwasteClassification.action")
    @ResponseBody
    public OneSolidwasteClassificationResultModel getOneSolidwasteClassification(){
        OneSolidwasteClassificationResultModel oneSolidwasteClassificationResultModel = solidWasteService.getOneSolidwasteClassification() ;
        return oneSolidwasteClassificationResultModel ;
    }

    @RequestMapping("/getSolidwasteClassification.action")
    @ResponseBody
    public SolidwasteClassificationResultModel getSolidwasteClassification(){
        SolidwasteClassificationResultModel solidwasteClassificationResultModel = solidWasteService.getSolidwasteClassification() ;
        return solidwasteClassificationResultModel ;
    }

    @RequestMapping("/getOneSolidwasteLife.action")
    @ResponseBody
    public SolidWasteNameAndValueModel getOneSolidwasteLife(){
        SolidWasteNameAndValueModel solidWasteNameAndValueModel = solidWasteService.getOneSolidwasteLife() ;
        solidWasteNameAndValueModel.setName("处理率");
        return solidWasteNameAndValueModel ;
    }

    @RequestMapping("/getSolidwasteLife.action")
    @ResponseBody
    public SolidwasteLifeResultModel getSolidwasteLife(){
        SolidwasteLifeResultModel solidWasteServiceSolidwasteLife = solidWasteService.getSolidwasteLife() ;
        return solidWasteServiceSolidwasteLife ;
    }

}
