mirror of
https://git.ethanthesleepy.one/ethanaobrien/ew.git
synced 2025-05-13 11:37:33 -05:00
Add dummy /api/login_bonus handler
This commit is contained in:
parent
f6cf70ab9f
commit
6a6eadc723
2 changed files with 22 additions and 0 deletions
|
@ -75,6 +75,9 @@ async fn lottery_tutorial(req: HttpRequest, body: String) -> HttpResponse { rout
|
||||||
#[post("/api/lottery")]
|
#[post("/api/lottery")]
|
||||||
async fn lottery(req: HttpRequest, body: String) -> HttpResponse { router::lottery::lottery(req, body) }
|
async fn lottery(req: HttpRequest, body: String) -> HttpResponse { router::lottery::lottery(req, body) }
|
||||||
|
|
||||||
|
#[post("/api/login_bonus")]
|
||||||
|
async fn login_bonus(req: HttpRequest, body: String) -> HttpResponse { router::login::bonus(req, body) }
|
||||||
|
|
||||||
#[get("/api/notice/reward")]
|
#[get("/api/notice/reward")]
|
||||||
async fn reward(req: HttpRequest) -> HttpResponse { router::notice::reward(req) }
|
async fn reward(req: HttpRequest) -> HttpResponse { router::notice::reward(req) }
|
||||||
|
|
||||||
|
@ -95,6 +98,7 @@ async fn main() -> std::io::Result<()> {
|
||||||
println!("Request: {}", req.path());
|
println!("Request: {}", req.path());
|
||||||
srv.call(req)
|
srv.call(req)
|
||||||
})
|
})
|
||||||
|
.service(login_bonus)
|
||||||
.service(reward)
|
.service(reward)
|
||||||
.service(live_guest)
|
.service(live_guest)
|
||||||
.service(live_clearrate)
|
.service(live_clearrate)
|
||||||
|
|
|
@ -22,3 +22,21 @@ pub fn dummy(req: HttpRequest, _body: String) -> HttpResponse {
|
||||||
};
|
};
|
||||||
global::send(resp)
|
global::send(resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn bonus(req: HttpRequest, _body: String) -> HttpResponse {
|
||||||
|
//let body = json::parse(&encryption::decrypt_packet(&body).unwrap()).unwrap();
|
||||||
|
let blank_header = HeaderValue::from_static("");
|
||||||
|
let key = req.headers().get("a6573cbe").unwrap_or(&blank_header).to_str().unwrap_or("");
|
||||||
|
let user = userdata::get_acc_home(key);
|
||||||
|
|
||||||
|
let resp = object!{
|
||||||
|
"code": 0,
|
||||||
|
"server_time": global::timestamp(),
|
||||||
|
"data": {
|
||||||
|
"login_bonus_list": [],
|
||||||
|
"start_time": global::timestamp(),
|
||||||
|
"clear_mission_ids": user["clear_mission_ids"].clone()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
global::send(resp)
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue