|
|
@@ -15,16 +15,16 @@ import org.dromara.common.web.core.BaseController;
|
|
|
import org.dromara.system.domain.bo.TblCarInfoBo;
|
|
|
import org.dromara.system.domain.vo.TblCarInfoVo;
|
|
|
import org.dromara.system.service.ITblCarDriveWarningService;
|
|
|
+import org.dromara.util.MessageUtils;
|
|
|
import org.dromara.util.YingshiHttp;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.time.Duration;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
@Validated
|
|
|
@@ -78,4 +78,36 @@ public class CommonController extends BaseController {
|
|
|
// return R.ok();
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ @PostMapping("/play")
|
|
|
+ public Object playtts(@RequestBody Map<String,Object> data) {
|
|
|
+
|
|
|
+ String message = data.get("message").toString();
|
|
|
+ List<String> codes = (List<String>) data.get("devicelist");
|
|
|
+ List<String> tts = new ArrayList<>();
|
|
|
+ List<String> leds = new ArrayList<>();
|
|
|
+ for (String code : codes) {
|
|
|
+ if(code.contains("tts")){
|
|
|
+ tts.add(code.split("_")[2]);
|
|
|
+ }if(code.contains("led")){
|
|
|
+ leds.add(code.split("_")[2]);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ for (String ttsi : tts){
|
|
|
+ MessageUtils.sendTTs(ttsi,message);
|
|
|
+ }
|
|
|
+ for (String led : leds){
|
|
|
+ MessageUtils.sendLed(led,message);
|
|
|
+ }
|
|
|
+
|
|
|
+ }catch (Exception e){
|
|
|
+ R.fail("发送失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ return R.ok();
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
}
|