refractor: lint
This commit is contained in:
parent
aa9a870e94
commit
9fbc2f3a14
2 changed files with 14 additions and 12 deletions
|
|
@ -89,8 +89,8 @@ public class DroneController {
|
|||
}
|
||||
|
||||
@PostMapping("/queryAvailableDrones")
|
||||
public int[] queryAvailableDrones(@RequestBody MedDispathRecDto[] records) {
|
||||
return new int[] {};
|
||||
public String[] queryAvailableDrones(@RequestBody MedDispathRecDto[] records) {
|
||||
return droneService.dronesMatchesRequirements(records);
|
||||
}
|
||||
|
||||
@PostMapping("/calcDeliveryPath")
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package io.github.js0ny.ilp_coursework.service;
|
|||
|
||||
import io.github.js0ny.ilp_coursework.data.AttrComparatorDto;
|
||||
import io.github.js0ny.ilp_coursework.data.DroneDto;
|
||||
import io.github.js0ny.ilp_coursework.data.MedDispathRecDto;
|
||||
import io.github.js0ny.ilp_coursework.util.AttrOperator;
|
||||
|
||||
import static io.github.js0ny.ilp_coursework.util.AttrComparator.isValueMatched;
|
||||
|
|
@ -48,7 +49,7 @@ public class DroneInfoService {
|
|||
*
|
||||
* @param state determines the capability filtering
|
||||
* @return if {@code state} is true, return ids of drones with cooling
|
||||
* capability, else without cooling
|
||||
* capability, else without cooling
|
||||
* @see io.github.js0ny.ilp_coursework.controller.DroneController#getDronesWithCoolingCapability(boolean)
|
||||
*/
|
||||
public String[] dronesWithCooling(boolean state) {
|
||||
|
|
@ -58,7 +59,7 @@ public class DroneInfoService {
|
|||
DroneDto[].class);
|
||||
|
||||
if (drones == null) {
|
||||
return new String[]{};
|
||||
return new String[] {};
|
||||
}
|
||||
|
||||
return Arrays.stream(drones)
|
||||
|
|
@ -119,7 +120,8 @@ public class DroneInfoService {
|
|||
}
|
||||
|
||||
/**
|
||||
* Return an array of ids of drones which matches all given complex comparing rules
|
||||
* Return an array of ids of drones which matches all given complex comparing
|
||||
* rules
|
||||
*
|
||||
* @param attrComparators The filter rule with Name, Value and Operator
|
||||
* @return array of drone ids that matches all rules
|
||||
|
|
@ -139,7 +141,7 @@ public class DroneInfoService {
|
|||
}
|
||||
}
|
||||
if (matchingDroneIds == null) {
|
||||
return new String[]{};
|
||||
return new String[] {};
|
||||
}
|
||||
return matchingDroneIds.toArray(String[]::new);
|
||||
}
|
||||
|
|
@ -155,10 +157,10 @@ public class DroneInfoService {
|
|||
* @param attrVal the attribute value to filter on
|
||||
* @param op the comparison operator
|
||||
* @return array of drone ids matching the attribute name and value (filtered by
|
||||
* {@code op})
|
||||
* {@code op})
|
||||
* @see io.github.js0ny.ilp_coursework.util.AttrComparator#isValueMatched(JsonNode,
|
||||
* String,
|
||||
* AttrOperator)
|
||||
* String,
|
||||
* AttrOperator)
|
||||
*/
|
||||
private String[] dronesWithAttributeCompared(String attrName, String attrVal, AttrOperator op) {
|
||||
URI droneUrl = URI.create(baseUrl).resolve(dronesEndpoint);
|
||||
|
|
@ -168,7 +170,7 @@ public class DroneInfoService {
|
|||
DroneDto[].class);
|
||||
|
||||
if (drones == null) {
|
||||
return new String[]{};
|
||||
return new String[] {};
|
||||
}
|
||||
|
||||
// Use Jackson's ObjectMapper to convert DroneDto to JsonNode for dynamic
|
||||
|
|
@ -190,7 +192,7 @@ public class DroneInfoService {
|
|||
.toArray(String[]::new);
|
||||
}
|
||||
|
||||
public int[] dronesMatchesRequirements() {
|
||||
return new int[]{};
|
||||
public String[] dronesMatchesRequirements(MedDispathRecDto[] rec) {
|
||||
return new String[] {};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue