package com.stylefeng.guns.modular.system.controller; import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.stylefeng.guns.modular.system.model.TSysDistanceDisplay; import com.stylefeng.guns.modular.system.service.ITSysDistanceDisplayService; import com.stylefeng.guns.modular.system.util.ResultUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; /** * 距离展示配置内部接口 */ @RestController @RequestMapping("/base/distanceDisplay") public class DistanceDisplayController { @Autowired private ITSysDistanceDisplayService tSysDistanceDisplayService; /** * 查询企业乘客定位推送距离阈值,供用户端实时定位过滤使用 */ @ResponseBody @RequestMapping(value = "/passengerLocationDistance", method = RequestMethod.POST) public ResultUtil passengerLocationDistance(Integer companyId) { if (companyId == null || companyId == 0) { return ResultUtil.paranErr(); } TSysDistanceDisplay distanceDisplay = tSysDistanceDisplayService.selectOne( new EntityWrapper().eq("companyId", companyId)); if (distanceDisplay == null || distanceDisplay.getPassengerLocationDistance() == null) { return ResultUtil.success(); } return ResultUtil.success(distanceDisplay.getPassengerLocationDistance()); } }