mirror of
https://github.com/Lumither/nocturne.git
synced 2026-10-17 10:26:21 +00:00
ref(backend) major refactor
- remove struct Post, use database schema and Map instead - add sub_title - replace NaiveDateTime with DateTime<Utc>
This commit is contained in:
9 files changed
+170
-159
No files matched your search
@@ -1,6 +1,6 @@
|
||||
use axum::extract::State;
|
||||
use axum::Json;
|
||||
use chrono::NaiveDateTime;
|
||||
use chrono::{DateTime, Utc};
|
||||
use serde_json::{json, Map, Value};
|
||||
use sqlx::{PgPool, Row};
|
||||
use uuid::Uuid;
|
||||
@@ -22,8 +22,8 @@ pub async fn get_post_list(
|
||||
let post_id: Uuid = post.get("post_id");
|
||||
let title: String = post.get("title");
|
||||
let summary: String = post.get("summary");
|
||||
let last_update: NaiveDateTime = post.get("last_update");
|
||||
let first_update: NaiveDateTime = post.get("first_update");
|
||||
let last_update: DateTime<Utc> = post.get("last_update");
|
||||
let first_update: DateTime<Utc> = post.get("first_update");
|
||||
|
||||
tmp.insert("post_id".to_string(), json!(post_id.to_string()));
|
||||
tmp.insert("title".to_string(), json!(title));
|
||||
|
||||
Reference in new issue
Block a user