This repository has been archived on 2023-11-08. You can view files and clone it, but cannot push or open issues or pull requests.
fiddle/src/api/models/directory.rs

32 lines
611 B
Rust

use chrono::prelude::*;
use juniper::graphql_object;
use uuidv7::Uuid;
use crate::api::{scalars, Context};
#[derive(Clone, Debug)]
pub struct Directory {
pub id: Uuid,
pub created_at: DateTime<Utc>,
pub updated_at: Option<DateTime<Utc>>,
}
#[graphql_object(context = Context)]
impl Directory {
fn id(&self) -> scalars::Uuid {
scalars::Uuid(self.id)
}
fn path(&self) -> String {
format!("{}", self.id)
}
fn created_at(&self) -> DateTime<Utc> {
self.created_at
}
fn updated_at(&self) -> Option<DateTime<Utc>> {
self.updated_at
}
}