Skip to content
Clone

feat(lib/config): add user config section

ZhenYi committed
parent 29cc961 commit 298b04a Browse files

2 files changed

+19 −1

File tree 2
Modified lib/config/src/lib.rs View lib/config/src/lib.rs
@@ -5,9 +5,10 @@
55use crate::redis::RedisConfig;
66use crate::s3::S3Config;
77use crate::session::SessionConfig;
8use crate::user::UserConfig;
9use crate::web::WebConfig;
810
911use serde::Deserialize;
10use crate::web::WebConfig;
1112
1213pub mod auth;
1314pub mod s3;
@@ -18,6 +19,7 @@
1819pub mod pow;
1920pub mod mailbaby;
2021pub mod web;
22pub mod user;
2123
2224#[derive(Clone, Debug, Default, Deserialize)]
2325#[serde(default)]
@@ -30,4 +32,5 @@
3032 pub pow: PowConfig,
3133 pub auth: AuthConfig,
3234 pub web: WebConfig,
35 pub user: UserConfig,
3336}
No newline at end of file
Added lib/config/src/user.rs View lib/config/src/user.rs
@@ -0,0 +1,15 @@
1use serde::Deserialize;
2
3#[derive(Clone, Debug, Deserialize)]
4#[serde(default)]
5pub struct UserConfig {
6 pub deletion_grace_days: u32,
7}
8
9impl Default for UserConfig {
10 fn default() -> Self {
11 Self {
12 deletion_grace_days: 14,
13 }
14 }
15}