|
@ -3,14 +3,47 @@ import a8k.a8k_can_protocol.CmdId; |
|
|
import a8k.a8k_can_protocol.ModuleId; |
|
|
import a8k.a8k_can_protocol.ModuleId; |
|
|
import a8k.appbean.HardwareException; |
|
|
import a8k.appbean.HardwareException; |
|
|
import a8k.base_hardware.A8kCanBusService; |
|
|
import a8k.base_hardware.A8kCanBusService; |
|
|
|
|
|
import a8k.service.A8kDebugTaskExecutorService; |
|
|
|
|
|
import a8k.service.hardware.MotorTubeRackMoveCtrlService; |
|
|
|
|
|
import com.iflytop.uf.util.UfClassHelper; |
|
|
import jakarta.annotation.Resource; |
|
|
import jakarta.annotation.Resource; |
|
|
import org.springframework.stereotype.Controller; |
|
|
import org.springframework.stereotype.Controller; |
|
|
import org.springframework.web.bind.annotation.GetMapping; |
|
|
import org.springframework.web.bind.annotation.GetMapping; |
|
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody; |
|
|
import org.springframework.web.bind.annotation.ResponseBody; |
|
|
import org.springframework.web.bind.annotation.ResponseBody; |
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
import java.util.Map; |
|
|
@Controller |
|
|
@Controller |
|
|
public class TmpTestController { |
|
|
public class TmpTestController { |
|
|
@Resource |
|
|
@Resource |
|
|
private A8kCanBusService a8kCanBusService; |
|
|
private A8kCanBusService a8kCanBusService; |
|
|
|
|
|
@Resource |
|
|
|
|
|
private MotorTubeRackMoveCtrlService motorTubeRackMoveCtrlService; |
|
|
|
|
|
@Resource |
|
|
|
|
|
private A8kDebugTaskExecutorService a8kDebugTaskExecutorService; |
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/api/tmp-test/execute-service-method") |
|
|
|
|
|
@ResponseBody |
|
|
|
|
|
public String executeServiceMethod( @RequestBody Map<String,Object> params ) throws NoSuchMethodException { |
|
|
|
|
|
Object service = this.motorTubeRackMoveCtrlService; |
|
|
|
|
|
String methodName = (String)params.get("method"); |
|
|
|
|
|
List<Object> methodArgs = (List<Object>)params.get("params"); |
|
|
|
|
|
Object result = UfClassHelper.invokeMethod(service, methodName, methodArgs); |
|
|
|
|
|
return "OK"; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/api/tmp-test/update-service-params") |
|
|
|
|
|
@ResponseBody |
|
|
|
|
|
public String updateServiceParams( @RequestBody Map<String,Object> params ) { |
|
|
|
|
|
return "OK"; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/api/tmp-test/get-service-params") |
|
|
|
|
|
@ResponseBody |
|
|
|
|
|
public String getServiceParams() { |
|
|
|
|
|
return "OK"; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@GetMapping("/tmp-test/a8k-can-bus-service-call") |
|
|
@GetMapping("/tmp-test/a8k-can-bus-service-call") |
|
|
@ResponseBody |
|
|
@ResponseBody |
|
|