diff --git a/.gitignore b/.gitignore index 4c0b3bc..88de3a7 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ package-lock.json .claude/scheduled_tasks.lock vscode-extension/out/ vscode-extension/node_modules/ +*.vsix diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 125ab5d..1bbef58 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -2521,6 +2521,7 @@ dependencies = [ "byteorder", "bytes", "cc", + "chrono", "cmake", "crc32fast", "flate2", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index e31c1c2..a7de12b 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -21,7 +21,7 @@ tokio = { version = "1", features = ["full"] } chrono = { version = "0.4", features = ["serde"] } uuid = { version = "1", features = ["v4", "serde"] } rusqlite = { version = "0.31", features = ["bundled"] } -mysql_async = "0.34" +mysql_async = { version = "0.34", features = ["chrono"] } reqwest = { version = "0.12", features = ["json", "multipart"] } base64 = "0.22" tokio-tungstenite = "0.23" diff --git a/src-tauri/src/knowledge.rs b/src-tauri/src/knowledge.rs index 579eb14..8f685f7 100644 --- a/src-tauri/src/knowledge.rs +++ b/src-tauri/src/knowledge.rs @@ -3,6 +3,7 @@ use mysql_async::{Pool, prelude::*}; use serde::{Deserialize, Serialize}; +use chrono::NaiveDateTime; /// Verbindungskonfiguration const MYSQL_HOST: &str = "192.168.155.11"; @@ -91,11 +92,13 @@ pub async fn search_knowledge( LIMIT ?"#, (&query, &query, &cat, limit), |(id, category, title, content, tags, priority, status, related_ids, source, created_at, updated_at, relevance): - (i64, String, String, String, Option, i32, String, Option, Option, String, String, f64)| { + (i64, String, String, String, Option, i32, String, Option, Option, NaiveDateTime, NaiveDateTime, f64)| { SearchResult { entry: KnowledgeEntry { id, category, title, content, tags, priority, status, - related_ids, source, created_at, updated_at, + related_ids, source, + created_at: created_at.format("%Y-%m-%d %H:%M:%S").to_string(), + updated_at: updated_at.format("%Y-%m-%d %H:%M:%S").to_string(), }, relevance, } @@ -113,11 +116,13 @@ pub async fn search_knowledge( LIMIT ?"#, (&query, &query, limit), |(id, category, title, content, tags, priority, status, related_ids, source, created_at, updated_at, relevance): - (i64, String, String, String, Option, i32, String, Option, Option, String, String, f64)| { + (i64, String, String, String, Option, i32, String, Option, Option, NaiveDateTime, NaiveDateTime, f64)| { SearchResult { entry: KnowledgeEntry { id, category, title, content, tags, priority, status, - related_ids, source, created_at, updated_at, + related_ids, source, + created_at: created_at.format("%Y-%m-%d %H:%M:%S").to_string(), + updated_at: updated_at.format("%Y-%m-%d %H:%M:%S").to_string(), }, relevance, } @@ -145,10 +150,12 @@ pub async fn get_knowledge(id: i64) -> Result, String> { (id,) ).await.map_err(|e| e.to_string())? .map(|(id, category, title, content, tags, priority, status, related_ids, source, created_at, updated_at): - (i64, String, String, String, Option, i32, String, Option, Option, String, String)| { + (i64, String, String, String, Option, i32, String, Option, Option, NaiveDateTime, NaiveDateTime)| { KnowledgeEntry { id, category, title, content, tags, priority, status, - related_ids, source, created_at, updated_at, + related_ids, source, + created_at: created_at.format("%Y-%m-%d %H:%M:%S").to_string(), + updated_at: updated_at.format("%Y-%m-%d %H:%M:%S").to_string(), } }); @@ -223,10 +230,12 @@ pub async fn get_recent_knowledge( LIMIT ?"#, (&cat, limit), |(id, category, title, content, tags, priority, status, related_ids, source, created_at, updated_at): - (i64, String, String, String, Option, i32, String, Option, Option, String, String)| { + (i64, String, String, String, Option, i32, String, Option, Option, NaiveDateTime, NaiveDateTime)| { KnowledgeEntry { id, category, title, content, tags, priority, status, - related_ids, source, created_at, updated_at, + related_ids, source, + created_at: created_at.format("%Y-%m-%d %H:%M:%S").to_string(), + updated_at: updated_at.format("%Y-%m-%d %H:%M:%S").to_string(), } } ).await.map_err(|e| e.to_string())? @@ -240,10 +249,12 @@ pub async fn get_recent_knowledge( LIMIT ?"#, (limit,), |(id, category, title, content, tags, priority, status, related_ids, source, created_at, updated_at): - (i64, String, String, String, Option, i32, String, Option, Option, String, String)| { + (i64, String, String, String, Option, i32, String, Option, Option, NaiveDateTime, NaiveDateTime)| { KnowledgeEntry { id, category, title, content, tags, priority, status, - related_ids, source, created_at, updated_at, + related_ids, source, + created_at: created_at.format("%Y-%m-%d %H:%M:%S").to_string(), + updated_at: updated_at.format("%Y-%m-%d %H:%M:%S").to_string(), } } ).await.map_err(|e| e.to_string())? @@ -322,10 +333,12 @@ pub async fn get_tool_hints( LIMIT 3"#, (&cat, &query_string), |(id, category, title, content, tags, priority, status, related_ids, source, created_at, updated_at): - (i64, String, String, String, Option, i32, String, Option, Option, String, String)| { + (i64, String, String, String, Option, i32, String, Option, Option, NaiveDateTime, NaiveDateTime)| { KnowledgeEntry { id, category, title, content, tags, priority, status, - related_ids, source, created_at, updated_at, + related_ids, source, + created_at: created_at.format("%Y-%m-%d %H:%M:%S").to_string(), + updated_at: updated_at.format("%Y-%m-%d %H:%M:%S").to_string(), } } ).await.map_err(|e| e.to_string())? @@ -340,10 +353,12 @@ pub async fn get_tool_hints( LIMIT 3"#, (&query_string,), |(id, category, title, content, tags, priority, status, related_ids, source, created_at, updated_at): - (i64, String, String, String, Option, i32, String, Option, Option, String, String)| { + (i64, String, String, String, Option, i32, String, Option, Option, NaiveDateTime, NaiveDateTime)| { KnowledgeEntry { id, category, title, content, tags, priority, status, - related_ids, source, created_at, updated_at, + related_ids, source, + created_at: created_at.format("%Y-%m-%d %H:%M:%S").to_string(), + updated_at: updated_at.format("%Y-%m-%d %H:%M:%S").to_string(), } } ).await.map_err(|e| e.to_string())?