feat: add redis

This commit is contained in:
2025-08-29 21:42:29 +08:00
parent af68d94efa
commit dc60a0a4bd
10 changed files with 875 additions and 52 deletions

View File

@ -1,4 +1,5 @@
mod db;
mod redis;
mod response;
mod error;
pub mod middlewares;
@ -6,6 +7,7 @@ pub mod models;
pub mod services;
pub mod routes;
pub mod utils;
pub mod workflow;
use axum::Router;
use axum::http::{HeaderValue, Method};
@ -37,6 +39,10 @@ async fn main() -> anyhow::Result<()> {
let db = db::init_db().await?;
// initialize Redis connection
let redis_pool = redis::init_redis().await?;
redis::set_redis_pool(redis_pool)?;
// run migrations
migration::Migrator::up(&db, None).await.expect("migration up");