package com.lightinit.hsdatashow.controller.admin;

import com.lightinit.hsdatashow.model.ResultState;
import com.lightinit.hsdatashow.service.admin.ITrafficSecurityService;
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;

/**
 * @Author: sunxiang
 * @Date: 2018/8/3 16:24
 * @Description:
 **/
@Controller
@RequestMapping(value = "/admin/trafficSecurity")
public class TrafficSecurityController {

    @Autowired
    private ITrafficSecurityService trafficSecurityService;
    @RequestMapping(value = "index.htm")
    public ModelAndView index(){
        ModelAndView modelAndView = new ModelAndView("admin/trafficSecurity/index");
        return modelAndView;
    }

    /*
     *@Description 万人交通事故死亡率
     *@Param
     *@Date 2018/8/16
     *@return
     **/
    @RequestMapping(value = "trafficdeathrate.action")
    @ResponseBody
    public ResultState getTrafficDeathRate(){
        return trafficSecurityService.getTrafficDeathRate();
    }
    /*
    *@Description  交通事故类型占比
    *@Param
    *@Date 2018/8/10
    *@return
    **/
    @RequestMapping(value = "trafficaccidentpro.action")
    @ResponseBody
    public ResultState getTrafficAccidentPro(){
        return trafficSecurityService.getTrafficAccidentPro();
    }

    /*
    *@Description 交通事故趋势
    *@Param
    *@Date 2018/8/10
    *@return
    **/
    @RequestMapping(value = "trafficaccidentten.action")
    @ResponseBody
    public ResultState getTrafficAccidentTen(){
        return trafficSecurityService.getTrafficAccidentTen();
    }
    /*
    *@Description 交通事故区域排名
    *@Param
    *@Date 2018/8/10
    *@return
    **/
    @RequestMapping(value = "trafficaccidentrank.action")
    @ResponseBody
    public ResultState getTrafficAccidentRank(){
        return trafficSecurityService.getTrafficAccidentRank();
    }
    
    /*
    *@Description 交通事故分布
    *@Param 
    *@Date 2018/8/10
    *@return 
    **/
    @RequestMapping(value = "trafficaccidentdistri.action")
    @ResponseBody
    public ResultState getTrafficAccidentDistribution(){
        return trafficSecurityService.getTrafficAccidentDistribution();
    }
    /*
    *@Description 交通事故结案情况
    *@Param
    *@Date 2018/8/10
    *@return
    **/
    @RequestMapping(value = "trafficaccidentcomplete.action")
    @ResponseBody
    public ResultState getTrafficAccidentComplete(){
        return trafficSecurityService.getTrafficAccidentComplete();
    }
}
