package com.stylefeng.guns.modular.api;
|
|
|
import com.stylefeng.guns.modular.system.service.IServerCarModelService;
|
import com.stylefeng.guns.modular.system.util.ResultUtil;
|
import com.stylefeng.guns.modular.system.warpper.ServerCarModelWarpper;
|
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.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.List;
|
import java.util.Map;
|
|
|
@Api
|
@RestController
|
@RequestMapping("/base/serverCarModel")
|
public class ServerCarModelController {
|
|
@Autowired
|
private IServerCarModelService serverCarModelService;
|
|
|
/**
|
* 获取车型和预估价格
|
* @param startLonLat
|
* @param endLonLat
|
* @param type
|
* @return
|
*/
|
@ResponseBody
|
@PostMapping("/queryServerCarModel")
|
@ApiOperation(value = "选择起点终点后获取车型和预估价格", tags = {"用户端-专车"}, notes = "")
|
@ApiImplicitParams({
|
@ApiImplicitParam(value = "起点经纬度(103.22121,,30.26123)", name = "startLonLat", required = true, dataType = "string"),
|
@ApiImplicitParam(value = "终点经纬度(103.22121,,30.26123)", name = "endLonLat", required = true, dataType = "string"),
|
@ApiImplicitParam(value = "业务类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车)", name = "type", required = true, dataType = "int")
|
})
|
public ResultUtil<List<ServerCarModelWarpper>> queryServerCarModel(String startLonLat, String endLonLat, Integer type){
|
try {
|
return serverCarModelService.queryServerCarModel(startLonLat, endLonLat, type);
|
}catch (Exception e){
|
e.printStackTrace();
|
return ResultUtil.runErr();
|
}
|
}
|
|
@ResponseBody
|
@PostMapping("/queryServerCarModelsSpecial")
|
@ApiOperation(value = "获取业务对应的所有车型", tags = {"用户端-专车"}, notes = "")
|
@ApiImplicitParams({
|
})
|
public ResultUtil<List<ServerCarModelWarpper>> queryServerCarModelsSpecial(){
|
try {
|
List<Map<String, Object>> list = serverCarModelService.queryServerCarModels(1);
|
return ResultUtil.success(ServerCarModelWarpper.getServerCarModelWarppers(list));
|
}catch (Exception e){
|
e.printStackTrace();
|
return ResultUtil.runErr();
|
}
|
}
|
|
|
|
@ResponseBody
|
@PostMapping("/queryServerCarModels")
|
@ApiOperation(value = "获取业务对应的所有车型", tags = {"用户端-包车"}, notes = "")
|
@ApiImplicitParams({
|
})
|
public ResultUtil<List<ServerCarModelWarpper>> queryServerCarModels(){
|
try {
|
List<Map<String, Object>> list = serverCarModelService.queryServerCarModels(3);
|
return ResultUtil.success(ServerCarModelWarpper.getServerCarModelWarppers(list));
|
}catch (Exception e){
|
e.printStackTrace();
|
return ResultUtil.runErr();
|
}
|
}
|
|
@ResponseBody
|
@PostMapping("/queryServerCarModelsTrans")
|
@ApiOperation(value = "获取业务对应的所有车型", tags = {"用户端-接送机"}, notes = "")
|
@ApiImplicitParams({
|
})
|
public ResultUtil<List<ServerCarModelWarpper>> queryServerCarModelsTrans(String startLonLat, String endLonLat){
|
try {
|
return serverCarModelService.queryServerCarModel1(startLonLat, endLonLat);
|
|
}catch (Exception e){
|
e.printStackTrace();
|
return ResultUtil.runErr();
|
}
|
}
|
|
}
|