Add dummy /api/login_bonus handler

This commit is contained in:
Ethan O'Brien
2024-02-26 20:51:30 -06:00
parent f6cf70ab9f
commit 6a6eadc723
2 changed files with 22 additions and 0 deletions

View File

@ -22,3 +22,21 @@ pub fn dummy(req: HttpRequest, _body: String) -> HttpResponse {
};
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)
}