Implements Request Limit with Redis
This commit is contained in:
15
src/depends/depends_auth_service.rs
Normal file
15
src/depends/depends_auth_service.rs
Normal file
@@ -0,0 +1,15 @@
|
||||
use cached::proc_macro::cached;
|
||||
use crate::config::config_auth::get_config_auth;
|
||||
use crate::config::config_limits::get_config_limits;
|
||||
use crate::config::config_redis::get_config_redis;
|
||||
use crate::service::auth_service::AuthService;
|
||||
|
||||
|
||||
#[cached]
|
||||
pub fn get_depends_auth_service() -> AuthService {
|
||||
AuthService::new(
|
||||
get_config_auth(),
|
||||
get_config_redis(),
|
||||
get_config_limits(),
|
||||
)
|
||||
}
|
||||
11
src/depends/depends_email_service.rs
Normal file
11
src/depends/depends_email_service.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
use cached::proc_macro::cached;
|
||||
use crate::config::config_email::get_config_email;
|
||||
use crate::service::email_service::EmailService;
|
||||
|
||||
|
||||
#[cached]
|
||||
pub fn get_depends_email_service() -> EmailService {
|
||||
EmailService::new(
|
||||
get_config_email()
|
||||
)
|
||||
}
|
||||
2
src/depends/mod.rs
Normal file
2
src/depends/mod.rs
Normal file
@@ -0,0 +1,2 @@
|
||||
pub mod depends_auth_service;
|
||||
pub mod depends_email_service;
|
||||
Reference in New Issue
Block a user