package com.lightinit.hsdatashow.controller.admin;

import com.lightinit.hsdatashow.entity.PublicSecurity;
import com.lightinit.hsdatashow.model.admin.EducationalPortraitListModel;
import com.lightinit.hsdatashow.model.admin.GroupNameAndValueModel;
import com.lightinit.hsdatashow.model.admin.SpreadListModel;
import com.lightinit.hsdatashow.model.admin.TrafficTravelListModel;
import com.lightinit.hsdatashow.service.admin.IPublishService;
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/publishService")
public class PublishServiceController {
    @Autowired
    private IPublishService publishService;

    @RequestMapping(value = "/index.htm")
    public ModelAndView index(){
        ModelAndView modelAndView = new ModelAndView("admin/publishService/index") ;
        return modelAndView ;
    }
    @RequestMapping(value = "/getEducationalPortrait.action")
    @ResponseBody
    public EducationalPortraitListModel getEducationalPortrait(){
        EducationalPortraitListModel model = publishService.getEducationalPortrait();
        return model;
    }
    @RequestMapping(value = "/getGreening.action")
    @ResponseBody
    public GroupNameAndValueModel getGreening(){
        GroupNameAndValueModel model = publishService.getGreening();
        return model;
    }

    @RequestMapping(value = "/geHealthCarePlan.action")
    @ResponseBody
    public EducationalPortraitListModel geHealthCarePlan(){
        EducationalPortraitListModel model = publishService.geHealthCarePlan();
        return model;
    }

    @RequestMapping(value = "/gePublicSecurity.action")
    @ResponseBody
    public  List<PublicSecurity> gePublicSecurity(){
        List<PublicSecurity> list = publishService.gePublicSecurity();
        return list;
    }

    @RequestMapping(value = "/getTrafficTravel.action")
    @ResponseBody
    public TrafficTravelListModel getTrafficTravel(){
        TrafficTravelListModel model = publishService.getTrafficTravel();
        return model;
    }

}
