推送二维码被扫信息 消息格式修改
This commit is contained in:
@@ -7,21 +7,21 @@ package org.dromara.resource.api.domain;
|
|||||||
*/
|
*/
|
||||||
public enum WebSocketMsgType {
|
public enum WebSocketMsgType {
|
||||||
|
|
||||||
ALARM_MSG(100),
|
ALARM_MSG("100"),
|
||||||
|
|
||||||
MOBILE_QRCODE(200);
|
MOBILE_QRCODE("qrcode");
|
||||||
/**
|
/**
|
||||||
* 消息类型编码
|
* 消息类型编码
|
||||||
* 大类型 - 100,200,300,400 累加100
|
* 大类型 - 100,200,300,400 累加100
|
||||||
* 小类型 - 101, 102, 103 累加1
|
* 小类型 - 101, 102, 103 累加1
|
||||||
*/
|
*/
|
||||||
private final Integer code;
|
private final String code;
|
||||||
|
|
||||||
WebSocketMsgType(Integer code) {
|
WebSocketMsgType(String code) {
|
||||||
this.code = code;
|
this.code = code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getCode() {
|
public String getCode() {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -94,6 +94,10 @@ public class TbVisitorManagementController extends BaseController {
|
|||||||
if (qrCodeInfo == null) {
|
if (qrCodeInfo == null) {
|
||||||
return R.fail("二维码已过期");
|
return R.fail("二维码已过期");
|
||||||
}
|
}
|
||||||
|
// JSONObject jsonObject = new JSONObject();
|
||||||
|
// jsonObject.put("type", "qrcode");
|
||||||
|
// jsonObject.put("date", qrcode);
|
||||||
|
|
||||||
remoteWebSocketMessageService.publishMessage(List.of(qrCodeInfo.getUserid()), WebSocketMsgType.MOBILE_QRCODE, qrcode);
|
remoteWebSocketMessageService.publishMessage(List.of(qrCodeInfo.getUserid()), WebSocketMsgType.MOBILE_QRCODE, qrcode);
|
||||||
return R.ok("二维码可用");
|
return R.ok("二维码可用");
|
||||||
|
|
||||||
|
@@ -55,7 +55,7 @@ public class RemoteWebSocketMessageServiceImpl implements RemoteWebSocketMessage
|
|||||||
|
|
||||||
private String createMsg(WebSocketMsgType webSocketMsgType, Object data) {
|
private String createMsg(WebSocketMsgType webSocketMsgType, Object data) {
|
||||||
JSONObject msg = new JSONObject();
|
JSONObject msg = new JSONObject();
|
||||||
msg.put("code", webSocketMsgType.getCode());
|
msg.put("type", webSocketMsgType.getCode());
|
||||||
msg.put("data", data);
|
msg.put("data", data);
|
||||||
return msg.toJSONString();
|
return msg.toJSONString();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user