From 11f89a23807730928be1d4eb35640c3dede035cf Mon Sep 17 00:00:00 2001 From: Radical Date: Tue, 29 Apr 2025 22:13:41 +0200 Subject: [PATCH] docs: add todos/fixmes --- src/api/v1/register.rs | 5 ++++- src/api/v1/stats.rs | 2 ++ src/api/versions.rs | 1 + src/main.rs | 4 ++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/api/v1/register.rs b/src/api/v1/register.rs index 9507332..bf79819 100644 --- a/src/api/v1/register.rs +++ b/src/api/v1/register.rs @@ -81,6 +81,7 @@ pub async fn res(mut payload: web::Payload, data: web::Data) -> Result 32 { @@ -94,14 +95,16 @@ pub async fn res(mut payload: web::Payload, data: web::Data) -> Result { + Ok(_out) => { HttpResponse::Ok().json( Response { access_token: "bogus".to_string(), diff --git a/src/api/v1/stats.rs b/src/api/v1/stats.rs index f92ed9e..f013abf 100644 --- a/src/api/v1/stats.rs +++ b/src/api/v1/stats.rs @@ -18,12 +18,14 @@ struct Response { #[get("/stats")] pub async fn res(data: web::Data) -> impl Responder { let response = Response { + // TODO: Get number of accounts from db accounts: 0, uptime: SystemTime::now() .duration_since(data.start_time) .expect("Seriously why dont you have time??") .as_secs(), version: String::from(VERSION.unwrap_or("UNKNOWN")), + // TODO: Get build number from git hash or remove this from the spec build_number: String::from("how do i implement this?"), }; diff --git a/src/api/versions.rs b/src/api/versions.rs index fafb824..e5695be 100644 --- a/src/api/versions.rs +++ b/src/api/versions.rs @@ -14,6 +14,7 @@ struct UnstableFeatures; pub async fn res() -> impl Responder { let response = Response { unstable_features: UnstableFeatures, + // TODO: Find a way to dynamically update this possibly? versions: vec![String::from("1")], }; diff --git a/src/main.rs b/src/main.rs index 78f1fb9..f25a34a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,6 +22,10 @@ async fn main() -> Result<(), Error> { let pool = PgPool::connect_with(config.database.connect_options()).await?; + /* + TODO: Figure out if a table should be used here and if not then what. + Also figure out if these should be different types from what they currently are and if we should add more "constraints" + */ pool.execute(r#"CREATE TABLE IF NOT EXISTS users ( uuid uuid UNIQUE NOT NULL, username varchar(32) UNIQUE NOT NULL,