Commit 309e1a30 authored by xuwencheng's avatar xuwencheng

store

parent d6c1b1c5
use crate::{event::{EventType, SocketEvent}, socket::protocol::Qos}; use crate::{
event::{EventType, SocketEvent},
socket::protocol::Qos,
};
use super::model::TokenInfo; use super::model::TokenInfo;
pub trait BusinessEvent { pub trait BusinessEvent {
fn message(key: Option<String>, qos: Qos, msg_id: i64, msg_ty: i32) -> SocketEvent; fn message(
key: Option<String>,
qos: Qos,
msg_id: i64,
msg_ty: i32,
extra: Option<String>,
) -> SocketEvent;
} }
impl BusinessEvent for SocketEvent { impl BusinessEvent for SocketEvent {
fn message(key: Option<String>, qos: Qos, msg_id: i64, msg_ty: i32) -> SocketEvent { fn message(
key: Option<String>,
qos: Qos,
msg_id: i64,
msg_ty: i32,
extra: Option<String>,
) -> SocketEvent {
SocketEvent { SocketEvent {
seller_id: None, seller_id: None,
store_id: None, store_id: None,
...@@ -22,7 +37,7 @@ impl BusinessEvent for SocketEvent { ...@@ -22,7 +37,7 @@ impl BusinessEvent for SocketEvent {
msg_ty: Some(msg_ty), msg_ty: Some(msg_ty),
status: 1, status: 1,
desc: qos.desc(), desc: qos.desc(),
extra: None, extra,
} }
} }
} }
......
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