package com.lightinit.hsdatashow.controller.admin;

import com.lightinit.hsdatashow.model.admin.GreenNameAndValueModel;
import com.lightinit.hsdatashow.service.admin.IGreenService;
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/green")
public class GreenController {

    @Autowired
    private IGreenService greenService ;

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

    @RequestMapping("/getGreenCity.action")
    @ResponseBody
    public GreenNameAndValueModel getGreenCity(){
        GreenNameAndValueModel greenNameAndValueModel = greenService.getGreenCity() ;
        return greenNameAndValueModel ;
    }

    @RequestMapping("/getGreenForest.action")
    @ResponseBody
    public GreenNameAndValueModel getGreenForest(){
        GreenNameAndValueModel greenNameAndValueModel = greenService.getGreenForest() ;
        return greenNameAndValueModel ;
    }

    @RequestMapping("/getGreenBuild.action")
    @ResponseBody
    public GreenNameAndValueModel getGreenBuild(){
        GreenNameAndValueModel greenNameAndValueModel = greenService.getGreenBuild() ;
        return greenNameAndValueModel ;
    }
}
