mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-12 02:25:41 +00:00
refactor captcha.rs and levels.rs and rm duration routes
This commit is contained in:
@@ -23,7 +23,6 @@ use libmcaptcha::{
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use super::GetDurationResp;
|
||||
use super::I32Levels;
|
||||
use crate::errors::*;
|
||||
use crate::stats::record::record_fetch;
|
||||
@@ -96,9 +95,13 @@ async fn init_mcaptcha(data: &AppData, key: &str) -> ServiceResult<()> {
|
||||
&key,
|
||||
)
|
||||
.fetch_all(&data.db);
|
||||
|
||||
struct DurationResp {
|
||||
duration: i32,
|
||||
}
|
||||
// get duration
|
||||
let duration_fut = sqlx::query_as!(
|
||||
GetDurationResp,
|
||||
DurationResp,
|
||||
"SELECT duration FROM mcaptcha_config
|
||||
WHERE key = $1",
|
||||
&key,
|
||||
|
||||
@@ -21,8 +21,7 @@ pub mod get_config;
|
||||
pub mod verify_pow;
|
||||
pub mod verify_token;
|
||||
|
||||
pub use super::mcaptcha::duration::GetDurationResp;
|
||||
pub use super::mcaptcha::levels::I32Levels;
|
||||
pub use super::mcaptcha::get::I32Levels;
|
||||
|
||||
pub fn services(cfg: &mut web::ServiceConfig) {
|
||||
let cors = actix_cors::Cors::default()
|
||||
|
||||
Reference in New Issue
Block a user