You've already forked AstralRinth
forked from didirus/AstralRinth
Follows (#172)
* Follows initial * Fix #171, Fix #170, Fix #169, Fix #164 * More work on follows * Fix compile error * Upgrade meili version, add follows to search
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
use thiserror::Error;
|
||||
|
||||
pub use super::mods::{ModId, VersionId};
|
||||
pub use super::notifications::NotificationId;
|
||||
pub use super::reports::ReportId;
|
||||
pub use super::teams::TeamId;
|
||||
pub use super::users::UserId;
|
||||
@@ -109,6 +110,7 @@ base62_id_impl!(UserId, UserId);
|
||||
base62_id_impl!(VersionId, VersionId);
|
||||
base62_id_impl!(TeamId, TeamId);
|
||||
base62_id_impl!(ReportId, ReportId);
|
||||
base62_id_impl!(NotificationId, NotificationId);
|
||||
|
||||
pub mod base62_impl {
|
||||
use serde::de::{self, Deserializer, Visitor};
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
pub mod error;
|
||||
pub mod ids;
|
||||
pub mod mods;
|
||||
pub mod notifications;
|
||||
pub mod reports;
|
||||
pub mod teams;
|
||||
pub mod users;
|
||||
|
||||
@@ -49,6 +49,9 @@ pub struct Mod {
|
||||
|
||||
/// The total number of downloads the mod has had.
|
||||
pub downloads: u32,
|
||||
/// The total number of followers this mod has accumulated
|
||||
pub followers: u32,
|
||||
|
||||
/// A list of the categories that the mod is in.
|
||||
pub categories: Vec<String>,
|
||||
/// A list of ids for versions of the mod.
|
||||
|
||||
27
src/models/notifications.rs
Normal file
27
src/models/notifications.rs
Normal file
@@ -0,0 +1,27 @@
|
||||
use super::ids::Base62Id;
|
||||
use super::users::UserId;
|
||||
use chrono::{DateTime, Utc};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(from = "Base62Id")]
|
||||
#[serde(into = "Base62Id")]
|
||||
pub struct NotificationId(pub u64);
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct Notification {
|
||||
pub id: NotificationId,
|
||||
pub user_id: UserId,
|
||||
pub title: String,
|
||||
pub text: String,
|
||||
pub link: String,
|
||||
pub read: bool,
|
||||
pub created: DateTime<Utc>,
|
||||
pub actions: Vec<NotificationAction>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct NotificationAction {
|
||||
pub title: String,
|
||||
pub action_route: String,
|
||||
}
|
||||
Reference in New Issue
Block a user