Pu Zhibing
6 天以前 4c99ee7028c3fe58a2cd4b8273b22c75c45574fc
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package com.stylefeng.guns.modular.crossCity.controller;
 
 
import com.stylefeng.guns.modular.crossCity.server.ILineService;
import com.stylefeng.guns.modular.crossCity.warpper.LineWarpper;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import com.stylefeng.guns.modular.system.warpper.BaseWarpper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
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;
 
import java.util.List;
import java.util.Map;
 
/**
 * 线路控制器
 */
@Api
@RestController
@RequestMapping("")
public class LineController {
 
    @Autowired
    private ILineService lineService;
 
 
 
    @ResponseBody
    @RequestMapping(value = "/base/line/queryLines", method = RequestMethod.POST)
    @ApiOperation(value = "根据选择的起点和终点获取线路", tags = {"用户端-跨城"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "起始站点id", name = "startId", required = true, dataType = "int"),
            @ApiImplicitParam(value = "终点站点id", name = "endId", required = true, dataType = "int"),
            @ApiImplicitParam(value = "司机id", name = "driverId", required = false, dataType = "int")
    })
    public ResultUtil<List<LineWarpper>> queryLines(Integer startId, Integer endId, Integer driverId){
        try {
            List<Map<String, Object>> list = lineService.queryLines(startId, endId, driverId);
            return ResultUtil.success(LineWarpper.getLineWarppers(list));
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
 
//    @ResponseBody
//    @RequestMapping(value = "/base/line/scanCodeQueryLines", method = RequestMethod.POST)
//    @ApiOperation(value = "扫码获取线路信息", tags = {"用户端-跨城"}, notes = "")
//    @ApiImplicitParams({
//            @ApiImplicitParam(value = "司机id", name = "driverId", required = true, dataType = "int")
//    })
//    public ResultUtil<List<BaseWarpper>> scanCodeQueryLines(Integer driverId){
//        try {
//            List<Map<String, Object>> list = lineService.scanCodeQueryLines(driverId);
//            return ResultUtil.success(BaseWarpper.getBaseWarppers(list));
//        }catch (Exception e){
//            e.printStackTrace();
//            return ResultUtil.runErr();
//        }
//    }
}