package com.zcloud.modules.map.controller;

import com.zcloud.modules.map.service.UserPositionService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

@Controller
@RequestMapping("/map/ObtainDisplayData")
public class ObtainDisplayDataController{

    @Autowired
    private UserPositionService usersService;

    /**
     * 获取电子围栏
     * @param params
     * @return
     * @throws Exception
     */
    @RequestMapping(value="/getDianZiWeiLanList")
    public Object getDianZiWeiLanList(@RequestBody Map<String, Object> params) throws Exception{
        if(StringUtils.isNotEmpty(params.get("route").toString())){
            return usersService.getDianZiWeiLanList(params.get("route").toString());
        }else {
            Map<String, Object> map = new HashMap<>();
            map.put("result","error");
            map.put("msg","缺少必填参数route");
            return map;
        }
    }
}
