updated structs a bit
This commit is contained in:
3
src-tauri/Cargo.lock
generated
3
src-tauri/Cargo.lock
generated
@@ -496,8 +496,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2"
|
checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"iana-time-zone",
|
"iana-time-zone",
|
||||||
|
"js-sys",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"serde",
|
"serde",
|
||||||
|
"wasm-bindgen",
|
||||||
"windows-link 0.2.0",
|
"windows-link 0.2.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -1030,6 +1032,7 @@ checksum = "7fd99930f64d146689264c637b5af2f0233a933bef0d8570e2526bf9e083192d"
|
|||||||
name = "flalingo"
|
name = "flalingo"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"chrono",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"sqlx",
|
"sqlx",
|
||||||
|
|||||||
@@ -26,4 +26,5 @@ serde_json = "1"
|
|||||||
# SQLx und Tokio für asynchrone DB-Zugriffe
|
# SQLx und Tokio für asynchrone DB-Zugriffe
|
||||||
sqlx = { version = "0.8.6", features = ["runtime-tokio-rustls", "sqlite", "macros", "migrate"] }
|
sqlx = { version = "0.8.6", features = ["runtime-tokio-rustls", "sqlite", "macros", "migrate"] }
|
||||||
tokio = { version = "1", features = ["full"] }
|
tokio = { version = "1", features = ["full"] }
|
||||||
|
chrono = "0.4.42"
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#[derive(Debug, sqlx::FromRow)]
|
||||||
pub struct Node {
|
pub struct Node {
|
||||||
id: u32,
|
id: u32,
|
||||||
title: String,
|
title: String,
|
||||||
|
|||||||
@@ -1,12 +1,21 @@
|
|||||||
|
use chrono::{DateTime, Utc};
|
||||||
|
use sqlx::sqlite::SqliteRow;
|
||||||
|
use sqlx::Row;
|
||||||
|
|
||||||
#[derive(Debug, sqlx::FromRow)]
|
use crate::models::node::Node;
|
||||||
|
|
||||||
|
#[derive(sqlx::FromRow, Debug)]
|
||||||
pub struct Path {
|
pub struct Path {
|
||||||
id: String,
|
id: String,
|
||||||
title: String,
|
title: String,
|
||||||
description: String,
|
description: String,
|
||||||
|
nodes: Vec<Node>,
|
||||||
|
metadata: Metadata,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct PathVersions {
|
#[derive(Debug, sqlx::FromRow)]
|
||||||
path_id: String,
|
pub struct Metadata {
|
||||||
version_number: String,
|
versions: Vec<String>,
|
||||||
|
created_at: DateTime<Utc>,
|
||||||
|
updated_at: DateTime<Utc>,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use sqlx::{pool, sqlite::SqlitePool, FromRow};
|
use sqlx::{sqlite::SqlitePool, FromRow};
|
||||||
|
|
||||||
use crate::models::path::Path;
|
use crate::models::path::Path;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
interface Path {
|
interface Path {
|
||||||
id: number,
|
id: string,
|
||||||
title: string,
|
title: string,
|
||||||
description: string,
|
description: string,
|
||||||
nodes: Node[],
|
nodes: Node[],
|
||||||
@@ -8,4 +8,4 @@ interface Path {
|
|||||||
createdAt: Date,
|
createdAt: Date,
|
||||||
updatedAt: Date,
|
updatedAt: Date,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user