mirror of
https://github.com/Lumither/nocturne.git
synced 2026-10-17 18:36:21 +00:00
feat(api) add refresh.rs
This commit is contained in:
10 files changed
+127
-9
No files matched your search
@@ -3,10 +3,12 @@ use serde::{Deserialize, Serialize};
|
||||
use sqlx::FromRow;
|
||||
use uuid::Uuid;
|
||||
|
||||
pub mod post;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, FromRow)]
|
||||
pub struct Post {
|
||||
post_id: Uuid,
|
||||
title: String,
|
||||
content: String,
|
||||
last_update: NaiveDateTime,
|
||||
pub post_id: Uuid,
|
||||
pub title: String,
|
||||
pub content: String,
|
||||
pub last_update: NaiveDateTime,
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
use chrono::Utc;
|
||||
use uuid::Uuid;
|
||||
|
||||
use crate::model::Post;
|
||||
|
||||
impl super::Post {
|
||||
pub fn from_path(path: String) -> Self {
|
||||
// todo: remove test
|
||||
Post {
|
||||
post_id: Uuid::new_v4(),
|
||||
title: "test title".to_string(),
|
||||
content: "test content".to_string(),
|
||||
last_update: Utc::now().naive_utc(),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user