|
|
@ -9,6 +9,8 @@ import jakarta.annotation.Resource; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.dubbo.config.annotation.DubboReference; |
|
|
|
import org.dromara.business.api.RemoteBusinessTaskService; |
|
|
|
import org.dromara.common.redis.utils.RedisOpsUtils; |
|
|
|
import org.dromara.common.redis.utils.RedisUtils; |
|
|
|
import org.dromara.common.satoken.utils.LoginHelper; |
|
|
|
import org.dromara.common.sdk.cloudapi.wayline.WaylineMethodEnum; |
|
|
|
import org.dromara.common.sdk.common.HttpResultResponse; |
|
|
@ -77,6 +79,10 @@ public class MegaphoneController { |
|
|
|
.setTimestamp(System.currentTimeMillis()) |
|
|
|
.setMethod("speaker_tts_play_start") |
|
|
|
.setData(param), DEFAULT_RETRY_COUNT, DEFAULT_RETRY_TIMEOUT); |
|
|
|
String key = "PSDK"+gatewaySn; |
|
|
|
MegaphoneDTO dto = (MegaphoneDTO) RedisOpsUtils.get(key); |
|
|
|
dto.setStop(0); |
|
|
|
RedisOpsUtils.set(key,dto); |
|
|
|
return HttpResultResponse.success(servicesReplyReceiverCommonTopicResponse); |
|
|
|
} |
|
|
|
|
|
|
@ -100,6 +106,10 @@ public class MegaphoneController { |
|
|
|
.setTimestamp(System.currentTimeMillis()) |
|
|
|
.setMethod("speaker_replay") |
|
|
|
.setData(param), DEFAULT_RETRY_COUNT, DEFAULT_RETRY_TIMEOUT); |
|
|
|
String key = "PSDK"+gatewaySn; |
|
|
|
MegaphoneDTO dto = (MegaphoneDTO) RedisOpsUtils.get(key); |
|
|
|
dto.setStop(0); |
|
|
|
RedisOpsUtils.set(key,dto); |
|
|
|
return HttpResultResponse.success(servicesReplyReceiverCommonTopicResponse); |
|
|
|
} |
|
|
|
/** |
|
|
@ -122,6 +132,10 @@ public class MegaphoneController { |
|
|
|
.setTimestamp(System.currentTimeMillis()) |
|
|
|
.setMethod("speaker_play_stop") |
|
|
|
.setData(param), DEFAULT_RETRY_COUNT, DEFAULT_RETRY_TIMEOUT); |
|
|
|
String key = "PSDK"+gatewaySn; |
|
|
|
MegaphoneDTO dto = (MegaphoneDTO) RedisOpsUtils.get(key); |
|
|
|
dto.setStop(1); |
|
|
|
RedisOpsUtils.set(key,dto); |
|
|
|
return HttpResultResponse.success(servicesReplyReceiverCommonTopicResponse); |
|
|
|
} |
|
|
|
|
|
|
@ -145,6 +159,10 @@ public class MegaphoneController { |
|
|
|
.setTimestamp(System.currentTimeMillis()) |
|
|
|
.setMethod("speaker_play_mode_set") |
|
|
|
.setData(param), DEFAULT_RETRY_COUNT, DEFAULT_RETRY_TIMEOUT); |
|
|
|
String key = "PSDK"+gatewaySn; |
|
|
|
MegaphoneDTO dto = (MegaphoneDTO) RedisOpsUtils.get(key); |
|
|
|
dto.setPlay_mode(param.getPlay_mode()); |
|
|
|
RedisOpsUtils.set(key,dto); |
|
|
|
return HttpResultResponse.success(servicesReplyReceiverCommonTopicResponse); |
|
|
|
} |
|
|
|
|
|
|
@ -171,6 +189,10 @@ public class MegaphoneController { |
|
|
|
.setTimestamp(System.currentTimeMillis()) |
|
|
|
.setMethod("speaker_play_volume_set") |
|
|
|
.setData(param), DEFAULT_RETRY_COUNT, DEFAULT_RETRY_TIMEOUT); |
|
|
|
String key = "PSDK"+gatewaySn; |
|
|
|
MegaphoneDTO dto = (MegaphoneDTO) RedisOpsUtils.get(key); |
|
|
|
dto.setPlay_volume(param.getPlay_volume()); |
|
|
|
RedisOpsUtils.set(key,dto); |
|
|
|
return HttpResultResponse.success(servicesReplyReceiverCommonTopicResponse); |
|
|
|
} |
|
|
|
|
|
|
@ -205,4 +227,29 @@ public class MegaphoneController { |
|
|
|
} |
|
|
|
return HttpResultResponse.success(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 喊话器-设置播放模式 |
|
|
|
* Get the topology list of all online devices in one workspace. |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@PostMapping("/setRedis") |
|
|
|
@Operation(summary = "设置喊话器参数。", description = "设置喊话器参数。") |
|
|
|
public HttpResultResponse setRedis(@RequestBody MegaphoneDTO param |
|
|
|
) { |
|
|
|
String key = "PSDK"+param.getGateway_sn(); |
|
|
|
RedisOpsUtils.set(key,param); |
|
|
|
return HttpResultResponse.success(); |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("/getRedis") |
|
|
|
@Operation(summary = "获取喊话器参数。", description = "获取喊话器参数。") |
|
|
|
public HttpResultResponse<MegaphoneDTO> getRedis(@RequestBody MegaphoneDTO param |
|
|
|
) { |
|
|
|
String key = "PSDK"+param.getGateway_sn(); |
|
|
|
MegaphoneDTO megaphoneDTO = (MegaphoneDTO) RedisOpsUtils.get(key); |
|
|
|
return HttpResultResponse.success(megaphoneDTO); |
|
|
|
} |
|
|
|
} |
|
|
|