package com.lightinit.hsdatashow.controller.admin;

import com.lightinit.hsdatashow.entity.StreetLamp;
import com.lightinit.hsdatashow.model.admin.GarbageCanModel;
import com.lightinit.hsdatashow.model.admin.StreetLampModel;
import com.lightinit.hsdatashow.service.admin.IStreetLampService;
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/StreetLamp")
public class StreetLampController {
    @Autowired
    private IStreetLampService iStreetLampService;
    @RequestMapping(value = "index.htm")
    public ModelAndView index(){
        ModelAndView modelAndView = new ModelAndView("admin/streetLamp/index") ;
        return modelAndView ;
    }
    @ResponseBody
    @RequestMapping(value = "getMainRoad.action")
    public StreetLampModel getMainRoad(String type){
        type = "主干道";
        StreetLampModel model = iStreetLampService.getStreetLamp(type);
        return model;
    }
    @ResponseBody
    @RequestMapping(value = "getStreet.action")
    public StreetLampModel getStreet(String type){
        type = "小街巷";
        StreetLampModel model = iStreetLampService.getStreetLamp(type);
        return model;
    }
    @ResponseBody
    @RequestMapping(value = "getName.action")
    public List<GarbageCanModel> getList(String type){

        return iStreetLampService.getList();
    }


}
