feat(api) add refresh.rs

This commit is contained in:
lumither committed 2024-05-03 02:17:11 +08:00
1 parent dce7a28b89
commit 2d42e933c8
10 files changed
+127 -9

No files matched your search

+6 -4
View File
@@ -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,
}
+16
View File
@@ -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(),
}
}
}