feature: variants #22
@ -7,7 +7,7 @@ pub mod raw_calls;
|
|||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use chrono::{DateTime, Utc};
|
use chrono::{DateTime, FixedOffset, Local, Utc};
|
||||||
use enum_stringify::EnumStringify;
|
use enum_stringify::EnumStringify;
|
||||||
use futures::stream::TryStreamExt;
|
use futures::stream::TryStreamExt;
|
||||||
|
|
||||||
@ -108,6 +108,7 @@ pub struct Message {
|
|||||||
pub message_id: i64,
|
pub message_id: i64,
|
||||||
pub token: String,
|
pub token: String,
|
||||||
pub variant: Option<String>,
|
pub variant: Option<String>,
|
||||||
|
pub created_at: DateTime<FixedOffset>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
@ -343,7 +344,10 @@ pub trait CallDB {
|
|||||||
"message_id": messageid as i64
|
"message_id": messageid as i64
|
||||||
},
|
},
|
||||||
doc! {
|
doc! {
|
||||||
"$set": { "token": literal }
|
"$set": {
|
||||||
|
"token": literal,
|
||||||
|
"created_at": Into::<DateTime<FixedOffset>>::into(Local::now()),
|
||||||
|
}
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.upsert(true)
|
.upsert(true)
|
||||||
@ -369,7 +373,11 @@ pub trait CallDB {
|
|||||||
"message_id": messageid as i64
|
"message_id": messageid as i64
|
||||||
},
|
},
|
||||||
doc! {
|
doc! {
|
||||||
"$set": { "token": literal, "variant": variant }
|
"$set": {
|
||||||
|
"token": literal,
|
||||||
|
"variant": variant,
|
||||||
|
"created_at": Into::<DateTime<FixedOffset>>::into(Local::now()),
|
||||||
|
}
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.upsert(true)
|
.upsert(true)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user