feat: add WeChat session authentication

This commit is contained in:
2026-07-20 14:47:16 +08:00
parent 2ada52f35a
commit 67d29d3ca0
26 changed files with 1289 additions and 130 deletions

View File

@@ -1,3 +1,4 @@
mod auth;
mod config;
mod error;
mod recording_routes;
@@ -21,6 +22,7 @@ pub struct AppState {
pub audio_storage_dir: PathBuf,
pub speech: speech::SpeechService,
pub summary: summary::SummaryService,
pub auth: auth::AuthService,
}
#[tokio::main]
@@ -33,11 +35,13 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = Config::from_env().map_err(std::io::Error::other)?;
let pool = connect_database(&config).await?;
let speech = speech::SpeechService::new(config.speech.clone());
let auth = auth::AuthService::new(config.auth.clone());
let state = AppState {
pool,
audio_storage_dir: config.audio_storage_dir.clone(),
speech: speech.clone(),
summary: summary::SummaryService::new(config.summary.clone()),
auth,
};
if let Some(pool) = state.pool.clone() {
if speech.configured() {