addvisitorresult::new takes mcaptcha
This commit is contained in:
parent
edcf55969c
commit
c496b2c61b
3 changed files with 18 additions and 10 deletions
|
@ -151,14 +151,14 @@ impl Handler<DeleteVisitor> for Counter {
|
|||
#[rtype(result = "AddVisitorResult")]
|
||||
pub struct AddVisitor;
|
||||
|
||||
impl AddVisitorResult {
|
||||
fn new(m: &Counter) -> Self {
|
||||
AddVisitorResult {
|
||||
duration: m.0.get_duration(),
|
||||
difficulty_factor: m.0.get_difficulty(),
|
||||
}
|
||||
}
|
||||
}
|
||||
//impl AddVisitorResult {
|
||||
// fn new(m: &Counter) -> Self {
|
||||
// AddVisitorResult {
|
||||
// duration: m.0.get_duration(),
|
||||
// difficulty_factor: m.0.get_difficulty(),
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
impl Handler<AddVisitor> for Counter {
|
||||
type Result = MessageResult<AddVisitor>;
|
||||
|
@ -177,7 +177,7 @@ impl Handler<AddVisitor> for Counter {
|
|||
ctx.spawn(wait_for);
|
||||
|
||||
self.0.add_visitor();
|
||||
MessageResult(AddVisitorResult::new(&self))
|
||||
MessageResult(AddVisitorResult::new(&self.0))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -68,3 +68,12 @@ pub struct AddSite {
|
|||
pub id: String,
|
||||
pub mcaptcha: MCaptcha,
|
||||
}
|
||||
|
||||
impl AddVisitorResult {
|
||||
fn new(m: &MCaptcha) -> Self {
|
||||
AddVisitorResult {
|
||||
duration: m.get_duration(),
|
||||
difficulty_factor: m.get_difficulty(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,6 @@ use crate::master::{AddSite, AddVisitor, Master as MasterTrait};
|
|||
|
||||
use super::connection::RedisConnection;
|
||||
|
||||
|
||||
#[derive(Clone)]
|
||||
pub enum Redis {
|
||||
Single(Client),
|
||||
|
|
Loading…
Reference in a new issue