package com.lightinit.hsdatashow.controller.admin;

import com.lightinit.hsdatashow.model.admin.EducationOrganizationResultModel;
import com.lightinit.hsdatashow.service.admin.IEducationService;
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/education")
public class EducationController {

    @Autowired
    private IEducationService educationService ;

    /**
     * 教育机构
     * @return
     */
    @RequestMapping(value = "/index.htm")
    public ModelAndView index(){
        ModelAndView modelAndView = new ModelAndView("admin/education/index") ;

        return modelAndView ;
    }

    /**
     * 教育机构
     * @return
     */
    @RequestMapping(value = "getEducationOrganization.action")
    @ResponseBody
    public List<EducationOrganizationResultModel> getEducationOrganization(String categoryName,String name){
        return educationService.getEducationOrganization(categoryName,name) ;
    }

    /**
     * 医疗机构
     * @return
     */
    @RequestMapping(value = "/medicalIndex.htm")
    public ModelAndView medicalIndex(){
        ModelAndView modelAndView = new ModelAndView("admin/education/medicalIndex") ;
        return modelAndView ;
    }

    /**
     * 医疗机构
     * @return
     */
    @RequestMapping(value = "getMedicalOrganization.action")
    @ResponseBody
    public List<EducationOrganizationResultModel> getMedicalOrganization(String categoryName,String name){
        return educationService.getEducationOrganization(categoryName,name) ;
    }

    /**
     * 商业综合
     * @return
     */
    @RequestMapping(value = "/businessIndex.htm")
    public ModelAndView businessIndex(){
        ModelAndView modelAndView = new ModelAndView("admin/education/businessIndex") ;
        return modelAndView ;
    }

    /**
     * 商业综合
     * @return
     */
    @RequestMapping(value = "getBusinessOrganization.action")
    @ResponseBody
    public List<EducationOrganizationResultModel> getBusinessOrganization(String categoryName,String name){
        return educationService.getEducationOrganization(categoryName,name) ;
    }

    /**
     * 政府机构
     * @return
     */
    @RequestMapping(value = "/governmentIndex.htm")
    public ModelAndView governmentIndex
    (){
        ModelAndView modelAndView = new ModelAndView("admin/education/governmentIndex") ;
        return modelAndView ;
    }

    /**
     * 政府机构
     * @return
     */
    @RequestMapping(value = "getGovernmentOrganization.action")
    @ResponseBody
    public List<EducationOrganizationResultModel> getGovernmentOrganization(String categoryName,String name){
        return educationService.getEducationOrganization(categoryName,name) ;
    }

    /**
     * 交通枢纽
     * @return
     */
    @RequestMapping(value = "/trafficIndex.htm")
    public ModelAndView trafficIndex(){
        ModelAndView modelAndView = new ModelAndView("admin/education/trafficIndex") ;
        return modelAndView ;
    }

    /**
     * 交通枢纽
     * @return
     */
    @RequestMapping(value = "getTrafficOrganization.action")
    @ResponseBody
    public List<EducationOrganizationResultModel> getTrafficOrganization(String categoryName,String name){
        return educationService.getEducationOrganization(categoryName,name) ;
    }

    /**
     * 交通服务
     * @return
     */
    @RequestMapping(value = "/trafficServiceIndex.htm")
    public ModelAndView trafficServiceIndex(){
        ModelAndView modelAndView = new ModelAndView("admin/education/trafficServiceIndex") ;
        return modelAndView ;
    }

    /**
     * 交通服务
     * @return
     */
    @RequestMapping(value = "getTrafficServiceOrganization.action")
    @ResponseBody
    public List<EducationOrganizationResultModel> getTrafficServiceOrganization(String categoryName,String name){
        return educationService.getEducationOrganization(categoryName,name) ;
    }



}
