captcha stats

This commit is contained in:
realaravinth
2021-05-27 14:47:29 +05:30
parent df89938f2a
commit fcdbe66b26
28 changed files with 412 additions and 122 deletions

View File

@@ -44,7 +44,10 @@ pub struct UpdateDuration {
pub duration: i32,
}
#[my_codegen::post(path="crate::V1_API_ROUTES.duration.update", wrap="crate::CheckLogin")]
#[my_codegen::post(
path = "crate::V1_API_ROUTES.duration.update",
wrap = "crate::CheckLogin"
)]
async fn update_duration(
payload: web::Json<UpdateDuration>,
data: web::Data<Data>,
@@ -82,7 +85,10 @@ pub struct GetDuration {
pub token: String,
}
#[my_codegen::post(path="crate::V1_API_ROUTES.duration.get", wrap="crate::CheckLogin")]
#[my_codegen::post(
path = "crate::V1_API_ROUTES.duration.get",
wrap = "crate::CheckLogin"
)]
async fn get_duration(
payload: web::Json<MCaptchaDetails>,
data: web::Data<Data>,
@@ -105,21 +111,21 @@ async fn get_duration(
pub fn services(cfg: &mut web::ServiceConfig) {
cfg.service(get_duration);
cfg.service(update_duration);
// use crate::define_resource;
// use crate::V1_API_ROUTES;
//
// define_resource!(
// cfg,
// V1_API_ROUTES.duration.get,
// Methods::ProtectPost,
// get_duration
// );
// define_resource!(
// cfg,
// V1_API_ROUTES.duration.update,
// Methods::ProtectPost,
// update_duration
// );
// use crate::define_resource;
// use crate::V1_API_ROUTES;
//
// define_resource!(
// cfg,
// V1_API_ROUTES.duration.get,
// Methods::ProtectPost,
// get_duration
// );
// define_resource!(
// cfg,
// V1_API_ROUTES.duration.update,
// Methods::ProtectPost,
// update_duration
// );
}
#[cfg(test)]