package com.stylefeng.guns.modular.api; import com.alibaba.fastjson.JSON; import com.stylefeng.guns.modular.system.service.IDriverOnlineService; import com.stylefeng.guns.modular.system.util.ResultUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("/base/driverOnline") public class DriverOnlineController { @Autowired private IDriverOnlineService driverOnlineService; /** * 存储司机在线数据 * @param driverId * @return */ @ResponseBody @PostMapping("/addDriverOnline") public String addDriverOnline(Integer driverId){ try { driverOnlineService.addDriverOnline(driverId); return JSON.toJSONString(ResultUtil.success()); }catch (Exception e){ e.printStackTrace(); return JSON.toJSONString(ResultUtil.runErr()); } } }