Browse Source

1、修改获取机场列表接口;2、修改获取路线列表接口

tags/v1.0.0^2
wanjing 1 year ago
parent
commit
224d3231e4
2 changed files with 6 additions and 3 deletions
  1. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/AirPortController.java
  2. +5
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/airport/AirportServiceImpl.java

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/AirPortController.java View File

* @param droneId 机场列表里面的droneId * @param droneId 机场列表里面的droneId
* @return * @return
*/ */
@GetMapping("/line/{droneId}")
@GetMapping("/line/list/{droneId}")
public JsonResult getAirLineList(@PathVariable("droneId") Integer droneId) { public JsonResult getAirLineList(@PathVariable("droneId") Integer droneId) {
return airportService.getAirLineList(droneId); return airportService.getAirLineList(droneId);
} }

+ 5
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/airport/AirportServiceImpl.java View File

@Service @Service
public class AirportServiceImpl implements AirportService { public class AirportServiceImpl implements AirportService {


private final static String API_AIRPORT_LIST = "/api/airportInterface/airportList";
private final static String API_AIRPORT_LINE_LIST = "/api/airportInterface/taskByDroneId";

@Autowired @Autowired
private TenantMapper tenantMapper; private TenantMapper tenantMapper;


return JsonResult.error(AriportCodeEnum.GET_NO_TENANT.getCode(), AriportCodeEnum.GET_NO_TENANT.getMsg()); return JsonResult.error(AriportCodeEnum.GET_NO_TENANT.getCode(), AriportCodeEnum.GET_NO_TENANT.getMsg());
} }


String url = tenant.getAirportUrl() + "/api/airportInterface/airportList";
String url = tenant.getAirportUrl() + API_AIRPORT_LIST;
String param = "page=1&limit=10"; String param = "page=1&limit=10";
String airPortStr = HttpUtils.sendGet(url, param); String airPortStr = HttpUtils.sendGet(url, param);


return JsonResult.error(AriportCodeEnum.GET_NO_TENANT.getCode(), AriportCodeEnum.GET_NO_TENANT.getMsg()); return JsonResult.error(AriportCodeEnum.GET_NO_TENANT.getCode(), AriportCodeEnum.GET_NO_TENANT.getMsg());
} }


String url = tenant.getAirportUrl() + "/api/airportInterface/taskByDroneId";
String url = tenant.getAirportUrl() + API_AIRPORT_LINE_LIST;
String param = "page=1&limit=100&droneId=" + droneId; String param = "page=1&limit=100&droneId=" + droneId;
String airPortStr = HttpUtils.sendGet(url, param); String airPortStr = HttpUtils.sendGet(url, param);
JsonResult<AirLineVO> jsonResult = JacksonUtil.json2pojo(airPortStr, JsonResult.class); JsonResult<AirLineVO> jsonResult = JacksonUtil.json2pojo(airPortStr, JsonResult.class);

Loading…
Cancel
Save