Re-do guards, streamline requests.

This commit is contained in:
Paul Makles
2020-02-08 13:25:34 +00:00
parent e2e5a0817a
commit 331d636f49
7 changed files with 82 additions and 123 deletions

12
src/database/channel.rs Normal file
View File

@@ -0,0 +1,12 @@
use serde::{ Deserialize, Serialize };
#[derive(Serialize, Deserialize, Debug)]
pub struct Channel {
#[serde(rename = "_id")]
pub id: String,
pub channel_type: u8,
// for Direct Messages
pub recipients: Option<Vec<String>>,
pub active: Option<bool>,
}

8
src/database/message.rs Normal file
View File

@@ -0,0 +1,8 @@
use serde::{ Deserialize, Serialize };
#[derive(Serialize, Deserialize, Debug)]
pub struct Message {
#[serde(rename = "_id")]
pub id: String,
}

View File

@@ -24,4 +24,6 @@ pub fn get_collection(collection: &str) -> Collection {
get_db().collection(collection)
}
pub mod user;
pub mod user;
pub mod channel;
pub mod message;