|
|
@ -1,9 +1,12 @@ |
|
|
|
package com.iflytop.handacid.app.controller; |
|
|
|
|
|
|
|
import com.iflytop.handacid.app.common.enums.ChannelCode; |
|
|
|
import com.iflytop.handacid.app.core.state.DeviceState; |
|
|
|
import com.iflytop.handacid.app.service.TestService; |
|
|
|
import com.iflytop.handacid.app.websocket.server.AlertGenerator; |
|
|
|
import com.iflytop.handacid.app.websocket.server.AlertLevel; |
|
|
|
import com.iflytop.handacid.app.websocket.server.WebSocketSender; |
|
|
|
import com.iflytop.handacid.common.result.Result; |
|
|
|
import com.iflytop.handacid.common.result.ResultCode; |
|
|
|
import com.iflytop.handacid.hardware.service.AppEventBusService; |
|
|
|
import com.iflytop.handacid.hardware.type.A8kPacket; |
|
|
|
import com.iflytop.handacid.hardware.type.CmdId; |
|
|
@ -27,6 +30,7 @@ import org.springframework.web.bind.annotation.RestController; |
|
|
|
public class TestController { |
|
|
|
private final DeviceState deviceState; |
|
|
|
private final AppEventBusService eventBus; |
|
|
|
private final WebSocketSender webSocketSender; |
|
|
|
private final TestService testService; |
|
|
|
|
|
|
|
@Operation(summary = "启动虚拟模式") |
|
|
@ -59,4 +63,18 @@ public class TestController { |
|
|
|
return Result.success(); |
|
|
|
} |
|
|
|
|
|
|
|
@Operation(summary = "推送弹窗") |
|
|
|
@PostMapping("/push-popup") |
|
|
|
public Result<?> pushPopup(AlertLevel lv, String resultCode) { |
|
|
|
webSocketSender.pushPopup(AlertGenerator.generateJson(lv,ResultCode.getByCode(resultCode))); |
|
|
|
return Result.success(); |
|
|
|
} |
|
|
|
|
|
|
|
@Operation(summary = "推送小提示") |
|
|
|
@PostMapping("/push-toast") |
|
|
|
public Result<?> pushToast(AlertLevel lv, String resultCode) { |
|
|
|
webSocketSender.pushToast(AlertGenerator.generateJson(lv,ResultCode.getByCode(resultCode))); |
|
|
|
return Result.success(); |
|
|
|
} |
|
|
|
|
|
|
|
} |