Полностью рабочая авторизация

This commit is contained in:
2025-03-22 22:44:52 +04:00
parent 9f7460973e
commit ba86dfc3fe
9 changed files with 241 additions and 21 deletions

View File

@@ -1,16 +1,17 @@
use crate::routes::auth::sign_in::sign_in;
use crate::xls_downloader::basic_impl::BasicXlsDownloader;
use actix_web::{web, App, HttpServer};
use actix_web::{App, HttpServer, web};
use chrono::{DateTime, Utc};
use diesel::{Connection, PgConnection};
use dotenvy::dotenv;
use schedule_parser::schema::ScheduleEntity;
use std::collections::HashMap;
use std::sync::Mutex;
use std::env;
use std::sync::{Mutex, MutexGuard};
mod database;
mod routes;
mod utility;
mod xls_downloader;
pub struct AppState {
@@ -28,6 +29,12 @@ pub struct AppState {
database: Mutex<PgConnection>,
}
impl AppState {
pub fn connection(&self) -> MutexGuard<PgConnection> {
self.database.lock().unwrap()
}
}
#[actix_web::main]
async fn main() {
dotenv().ok();