TestController.java 903 B

123456789101112131415161718192021222324252627282930313233
  1. package com.zksy.lamp.controller;
  2. import com.zksy.lamp.server.ExecutionServer;
  3. import org.springframework.beans.factory.annotation.Autowired;
  4. import org.springframework.web.bind.annotation.GetMapping;
  5. import org.springframework.web.bind.annotation.RequestMapping;
  6. import org.springframework.web.bind.annotation.RestController;
  7. /**
  8. * @author Administrator
  9. * @version 1.0
  10. * @project dh-server-micro
  11. * @description
  12. * @date 2025/2/10 15:00:46
  13. */
  14. @RequestMapping("/test")
  15. @RestController
  16. public class TestController {
  17. @Autowired
  18. private ExecutionServer server;
  19. @GetMapping("/a")
  20. public String test(){
  21. String data = "AT+STACH1=1\r\n";
  22. String msg = server.ExecutionData(data);
  23. return msg;
  24. }
  25. @GetMapping("/b")
  26. public String testb(){
  27. String data = "AT+STACH1=1\r\n";
  28. String msg = server.ExecutionData(data);
  29. return msg;
  30. }
  31. }