package com.lightinit.hsdatashow.controller.admin;

import com.lightinit.hsdatashow.entity.GarbageCan;
import com.lightinit.hsdatashow.model.admin.GarbageCanModel;
import com.lightinit.hsdatashow.model.admin.GroupNameAndValueModel;
import com.lightinit.hsdatashow.service.admin.IGarbageCanService;
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/GarbageCan")
public class GarbageCanController {
    @Autowired
    private IGarbageCanService iGarbageCanService;
    @RequestMapping(value = "/index.htm")
    public ModelAndView index(){
        ModelAndView modelAndView = new ModelAndView("admin/garbageCan/index") ;
        return modelAndView ;
    }
    @RequestMapping(value = "getGarbageCan.action")
    @ResponseBody
    public  List<GarbageCan> getGarbageCan(){
        return iGarbageCanService.getGarbageCan() ;
    }

    @RequestMapping(value = "getGarbageCan2.action")
    @ResponseBody
    public GroupNameAndValueModel getGarbageCan2(String name,Integer falg){
        return iGarbageCanService.getGarbageCan2(name,falg) ;
    }

    @RequestMapping(value = "getGarbageCanList.action")
    @ResponseBody
    public List<GarbageCanModel> getGarbageCanList(){
        List<GarbageCanModel> list = iGarbageCanService.getGarbageCanList();
        return  list;
    }

}
