package com.lightinit.hsdatashow.controller.admin;

import com.lightinit.hsdatashow.model.ResultState;
import com.lightinit.hsdatashow.service.admin.ILivingSecurityService;
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:34
 * @Description:
 **/
@Controller
@RequestMapping(value = "/admin/livingSecurity")
public class LivingSecurityController {

    @Autowired
    private ILivingSecurityService livingSecurityService;
    @RequestMapping(value = "index.htm")
    public ModelAndView index(){
        ModelAndView modelAndView = new ModelAndView("admin/livingSecurity/index");
        return modelAndView;
    }

    /*
     *@Description 万人火灾事故死亡率
     *@Param
     *@Date 2018/8/7
     *@return
     **/
    @RequestMapping(value = "areafiredeathrate.action")
    @ResponseBody
    public ResultState getAreaFireDeathRate(){
        return livingSecurityService.getAreaFireDeathRate();
    }


    /*
     *@Description 区域工伤事故占比
     *@Param
     *@Date 2018/8/8
     *@return
     **/
    @RequestMapping(value = "arefireproportion.action")
    @ResponseBody
    public ResultState getAreFireProportion(){
        return livingSecurityService.getAreFireProportion();
    }
    /*
    *@Description 万人火灾事故死亡率趋势
    *@Param
    *@Date 2018/8/13
    *@return
    **/
    @RequestMapping(value = "arefiretendency.action")
    @ResponseBody
    public ResultState getAreFireTendency(){
        return livingSecurityService.getAreFireTendency();

    }

    /*
    *@Description   火灾事故死亡率排名
    *@Param
    *@Date 2018/8/13
    *@return
    **/
    @RequestMapping(value = "arefirerank.action")
    @ResponseBody
    public ResultState getAreFireRank(){
        return livingSecurityService.getAreFireRank();

    }

    /*
    *@Description
    *@Param
    *@Date 2018/8/13
    *@return
    **/
    @RequestMapping(value = "arefiredistribution.action")
    @ResponseBody
    public ResultState getAreFireDistribution(){
        return livingSecurityService.getAreFireDistribution();

    }
}
