forked from jmug/stoatchat
refactor(core/models): move models into v0 module
This commit is contained in:
@@ -17,13 +17,7 @@ macro_rules! auto_derived {
|
||||
};
|
||||
}
|
||||
|
||||
mod bots;
|
||||
mod files;
|
||||
mod users;
|
||||
|
||||
pub use bots::*;
|
||||
pub use files::*;
|
||||
pub use users::*;
|
||||
pub mod v0;
|
||||
|
||||
/// Utility function to check if a boolean value is false
|
||||
pub fn if_false(t: &bool) -> bool {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::User;
|
||||
use super::User;
|
||||
|
||||
auto_derived!(
|
||||
/// Bot
|
||||
7
crates/core/models/src/v0/mod.rs
Normal file
7
crates/core/models/src/v0/mod.rs
Normal file
@@ -0,0 +1,7 @@
|
||||
mod bots;
|
||||
mod files;
|
||||
mod users;
|
||||
|
||||
pub use bots::*;
|
||||
pub use files::*;
|
||||
pub use users::*;
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::File;
|
||||
use super::File;
|
||||
|
||||
auto_derived!(
|
||||
/// User
|
||||
@@ -1,5 +1,5 @@
|
||||
use revolt_database::{util::reference::Reference, Database};
|
||||
use revolt_models::FetchBotResponse;
|
||||
use revolt_models::v0::FetchBotResponse;
|
||||
use revolt_quark::{models::User, Error, Result};
|
||||
use rocket::{serde::json::Json, State};
|
||||
|
||||
@@ -23,7 +23,7 @@ pub async fn fetch_bot(
|
||||
}
|
||||
|
||||
Ok(Json(FetchBotResponse {
|
||||
user: revolt_models::User::from(
|
||||
user: revolt_models::v0::User::from(
|
||||
db.fetch_user(&bot.id).await.map_err(Error::from_core)?,
|
||||
None,
|
||||
)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use revolt_database::Database;
|
||||
use revolt_models::PublicBot;
|
||||
use revolt_models::v0::PublicBot;
|
||||
use revolt_quark::{models::User, Error, Ref, Result};
|
||||
|
||||
use rocket::serde::json::Json;
|
||||
|
||||
Reference in New Issue
Block a user