feat(api): update rust deps, move /private/meta endpoint to rust-api

This commit is contained in:
alyssa 2024-06-16 21:56:14 +09:00
parent f14c421e23
commit e415c6704f
20 changed files with 1835 additions and 244 deletions

View file

@ -0,0 +1,13 @@
pub async fn get_stats(pool: &sqlx::postgres::PgPool) -> anyhow::Result<Counts> {
let counts: Counts = sqlx::query_as("select * from info").fetch_one(pool).await?;
Ok(counts)
}
#[derive(serde::Serialize, sqlx::FromRow)]
pub struct Counts {
pub system_count: i64,
pub member_count: i64,
pub group_count: i64,
pub switch_count: i64,
pub message_count: i64,
}