zhibing.pu
2024-07-25 79fc712ed025069c1d21de230bdc95c74910288c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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.addDriverOnline1(driverId);
            return JSON.toJSONString(ResultUtil.success());
        }catch (Exception e){
            e.printStackTrace();
            return JSON.toJSONString(ResultUtil.runErr());
        }
    }
 
}