Skip to content
Clone
02d8172
67 lines 2.0 KB Rust
use models::space::{AllowJoinLevel, MemberStatus, MessageNotifications};
use serde::{Deserialize, Serialize};
use time::OffsetDateTime;
use utoipa::{IntoParams, ToSchema};
use uuid::Uuid;
pub const RESERVED_SPACE_NAMES: [&str; 1] = ["explore"];
pub use export::users::UserDto;
pub use export::{resolve_space_image_url, resolve_user_avatar_url};
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
pub struct SpaceDto {
pub id: Uuid,
pub lower_name: String,
pub name: String,
pub description: Option<String>,
pub owner: Option<UserDto>,
pub avatar_url: Option<String>,
pub is_private: bool,
pub is_active: bool,
pub allow_join: bool,
pub allow_invite: bool,
pub members_count: i64,
pub welcome_message: Option<String>,
pub allow_join_level: AllowJoinLevel,
pub member_must_enable_2fa: bool,
pub welcome_object: Option<Uuid>,
pub created_at: OffsetDateTime,
pub updated_at: OffsetDateTime,
}
pub use export::pagination::PageQuery;
#[derive(Debug, Clone, Deserialize, IntoParams, ToSchema)]
pub struct SpacePath {
pub space_name: String,
}
#[derive(Debug, Clone, Deserialize, IntoParams, ToSchema)]
pub struct MemberPath {
pub space_name: String,
pub user_id: i64,
}
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
pub struct MemberDto {
pub space_id: Uuid,
pub user: Option<UserDto>,
pub alias_name: Option<String>,
pub alias_avatar_url: Option<String>,
pub status: MemberStatus,
pub last_active_at: Option<OffsetDateTime>,
pub left_at: Option<OffsetDateTime>,
pub invited_at: Option<OffsetDateTime>,
pub invited_by: Option<UserDto>,
pub joined_at: OffsetDateTime,
pub created_at: OffsetDateTime,
pub updated_at: Option<OffsetDateTime>,
pub message_notifications: MessageNotifications,
pub muted: bool,
pub mute_until: Option<OffsetDateTime>,
pub mobile_push: bool,
pub suppress_everyone: bool,
pub suppress_roles: bool,
pub hide_muted_channels: bool,
}