3 changed files with 39 additions and 16 deletions
-
24src/main/java/a8k/base_hardware/A8kCanBusService.java
-
27src/main/java/a8k/controller/SamplesPreProcessModuleCtrlController.java
-
4src/main/java/a8k/service/hardware/SamplesPreProcessModuleCtrlService.java
@ -0,0 +1,27 @@ |
|||||
|
package a8k.controller; |
||||
|
import a8k.service.hardware.SamplesPreProcessModuleCtrlService; |
||||
|
import com.iflytop.uf.controller.UfApiControllerBase; |
||||
|
import com.iflytop.uf.controller.UfApiResponse; |
||||
|
import com.iflytop.uf.util.UfClassHelper; |
||||
|
import jakarta.annotation.Resource; |
||||
|
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 SamplesPreProcessModuleCtrlController extends UfApiControllerBase { |
||||
|
@Resource |
||||
|
private SamplesPreProcessModuleCtrlService samplesPreProcessModuleCtrlService; |
||||
|
|
||||
|
@PostMapping("/api/sample-pre-process-module-ctrl/execute-service-method") |
||||
|
@ResponseBody |
||||
|
public UfApiResponse executeServiceMethod( @RequestBody Map<String,Object> params ) throws NoSuchMethodException { |
||||
|
Object service = this.samplesPreProcessModuleCtrlService; |
||||
|
String methodName = (String)params.get("method"); |
||||
|
List<Object> methodArgs = (List<Object>)params.get("params"); |
||||
|
Object result = UfClassHelper.invokeMethod(service, methodName, methodArgs); |
||||
|
return this.success(result); |
||||
|
} |
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue