|
|
@ -7,6 +7,8 @@ import org.springframework.stereotype.Controller; |
|
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
|
|
import org.springframework.web.bind.annotation.RequestBody; |
|
|
|
import org.springframework.web.bind.annotation.ResponseBody; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
@Controller |
|
|
|
public class DiApiTest extends DiApiControllerBase { |
|
|
@ -24,4 +26,25 @@ public class DiApiTest extends DiApiControllerBase { |
|
|
|
} |
|
|
|
return this.success(); |
|
|
|
} |
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
@PostMapping("/api/test/list") |
|
|
|
public DiApiResponse list() { |
|
|
|
var list = this.device.getTestcases().list(); |
|
|
|
return this.success(Map.of("list", list)); |
|
|
|
} |
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
@PostMapping("/api/test/actuator-execute") |
|
|
|
public DiApiResponse actuatorExecute(@RequestBody Map<String,Object> params ) { |
|
|
|
String actKey = (String)params.get("key"); |
|
|
|
String actAction = (String)params.get("action"); |
|
|
|
List<Object> actParams = (List<Object>)params.get("params"); |
|
|
|
|
|
|
|
var actuator = this.device.getActuators().get(actKey); |
|
|
|
if ( actuator == null ) { |
|
|
|
return this.error("Actuator not found"); |
|
|
|
} |
|
|
|
return this.success(); |
|
|
|
} |
|
|
|
} |