package com.stylefeng.guns.modular.taxi.controller;
|
|
import com.stylefeng.guns.modular.system.service.IDriverService;
|
import com.stylefeng.guns.modular.system.util.ResultUtil;
|
import com.stylefeng.guns.modular.system.warpper.OrderDriverWarpper;
|
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.PostMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import java.util.Map;
|
|
/**
|
* 出租车模块的司机控制器
|
*/
|
@RestController
|
@RequestMapping("/api/taxiDrive")
|
public class TaxiDriverController {
|
|
@Autowired
|
private IDriverService driverService;
|
|
|
/**
|
* 根据订单id获取司机数据
|
* @param id
|
* @return
|
*/
|
@ResponseBody
|
@PostMapping("/queryOrderDriver")
|
@ApiOperation(value = "根据订单id获取司机数据", tags = {"用户端-出租车", "用户端-专车"}, notes = "")
|
@ApiImplicitParams({
|
@ApiImplicitParam(value = "订单id", name = "id", required = true, dataType = "int"),
|
@ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城)", name = "orderType", required = true, dataType = "int"),
|
@ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
|
})
|
public ResultUtil<OrderDriverWarpper> queryOrderDriver(Integer id, Integer orderType){
|
try {
|
Map<String, Object> map = driverService.queryOrderDriver(id, orderType);
|
// TODO: 2020/5/25 需要推送订单数据
|
OrderDriverWarpper orderDriverWarpper = OrderDriverWarpper.getOrderDriverWarpper(map);
|
return ResultUtil.success(orderDriverWarpper);
|
}catch (Exception e){
|
e.printStackTrace();
|
return ResultUtil.runErr();
|
}
|
}
|
}
|