bda1ef251a
calling this v0.4.0
35 lines
857 B
Rust
35 lines
857 B
Rust
use serde::{Deserialize, Serialize};
|
|
use sqlx::FromRow;
|
|
use chrono::{DateTime, Utc};
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize, FromRow)]
|
|
pub struct Space {
|
|
pub id: i64,
|
|
pub name: String,
|
|
pub description: Option<String>,
|
|
pub owner_id: i64,
|
|
pub created_at: DateTime<Utc>,
|
|
pub updated_at: DateTime<Utc>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize, FromRow)]
|
|
pub struct Channel {
|
|
pub id: i64,
|
|
pub name: String,
|
|
pub description: Option<String>,
|
|
pub space_id: i64,
|
|
pub created_at: DateTime<Utc>,
|
|
pub updated_at: DateTime<Utc>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub struct SpaceDto {
|
|
pub channels: Vec<Channel>,
|
|
pub id: i64,
|
|
pub owner_id: i64,
|
|
pub name: String,
|
|
pub description: Option<String>,
|
|
|
|
pub created_at: DateTime<Utc>,
|
|
pub updated_at: DateTime<Utc>,
|
|
} |