Commit 2c4486be authored by xuwencheng's avatar xuwencheng

store

parent 90cc2025
......@@ -116,7 +116,6 @@ pub trait ConnectEvent {
fn connect(
info: &TokenInfo,
status: Status,
desc: impl AsRef<str>,
extra: Option<impl AsRef<str>>,
) -> SocketEvent;
......@@ -127,9 +126,13 @@ impl ConnectEvent for SocketEvent {
fn connect(
info: &TokenInfo,
status: Status,
desc: impl AsRef<str>,
extra: Option<impl AsRef<str>>,
) -> SocketEvent {
let desc = if status.eq(&Status::Success) {
"设备建立连接"
} else {
"设备断开连接"
};
SocketEvent {
seller_id: Some(info.seller_id),
store_id: Some(info.seller_id),
......@@ -144,7 +147,7 @@ impl ConnectEvent for SocketEvent {
msg_id: None,
msg_ty: None,
status: status as i32,
desc: desc.as_ref().to_string(),
desc: desc.to_string(),
extra: extra.map(|s| s.as_ref().to_string()),
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment