mirror of
https://git.ethanthesleepy.one/ethanaobrien/ew.git
synced 2025-05-13 11:37:33 -05:00
Add (dummy) lottery endpoint
This commit is contained in:
parent
68be3978fe
commit
a1d73690e6
3 changed files with 22 additions and 2 deletions
|
@ -90,8 +90,11 @@ async fn preset(req: HttpRequest, body: String) -> HttpResponse { router::home::
|
||||||
#[post("/api/lottery/get_tutorial")]
|
#[post("/api/lottery/get_tutorial")]
|
||||||
async fn lottery_tutorial(req: HttpRequest, body: String) -> HttpResponse { router::lottery::tutorial(req, body) }
|
async fn lottery_tutorial(req: HttpRequest, body: String) -> HttpResponse { router::lottery::tutorial(req, body) }
|
||||||
|
|
||||||
|
#[get("/api/lottery")]
|
||||||
|
async fn lottery(req: HttpRequest) -> HttpResponse { router::lottery::lottery(req) }
|
||||||
|
|
||||||
#[post("/api/lottery")]
|
#[post("/api/lottery")]
|
||||||
async fn lottery(req: HttpRequest, body: String) -> HttpResponse { router::lottery::lottery(req, body) }
|
async fn lottery_post(req: HttpRequest, body: String) -> HttpResponse { router::lottery::lottery_post(req, body) }
|
||||||
|
|
||||||
#[post("/api/login_bonus")]
|
#[post("/api/login_bonus")]
|
||||||
async fn login_bonus(req: HttpRequest, body: String) -> HttpResponse { router::login::bonus(req, body) }
|
async fn login_bonus(req: HttpRequest, body: String) -> HttpResponse { router::login::bonus(req, body) }
|
||||||
|
@ -152,6 +155,7 @@ async fn main() -> std::io::Result<()> {
|
||||||
.service(start_start)
|
.service(start_start)
|
||||||
.service(tutorial)
|
.service(tutorial)
|
||||||
.service(lottery_tutorial)
|
.service(lottery_tutorial)
|
||||||
|
.service(lottery_post)
|
||||||
.service(lottery)
|
.service(lottery)
|
||||||
.service(friend)
|
.service(friend)
|
||||||
.service(mission)
|
.service(mission)
|
||||||
|
|
|
@ -85,7 +85,21 @@ fn get_random_cards(_count: i32) -> JsonValue {
|
||||||
rv
|
rv
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn lottery(req: HttpRequest, body: String) -> HttpResponse {
|
pub fn lottery(_req: HttpRequest) -> HttpResponse {
|
||||||
|
|
||||||
|
let resp = object!{
|
||||||
|
"code": 0,
|
||||||
|
"server_time": global::timestamp(),
|
||||||
|
"data": {
|
||||||
|
"lottery_list": [
|
||||||
|
{"master_lottery_id":1110024,"master_lottery_price_number":1,"count":10,"daily_count":0,"last_count_date":"2024-04-30 06:07:48"}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
global::send(resp)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn lottery_post(req: HttpRequest, body: String) -> HttpResponse {
|
||||||
let body = json::parse(&encryption::decrypt_packet(&body).unwrap()).unwrap();
|
let body = json::parse(&encryption::decrypt_packet(&body).unwrap()).unwrap();
|
||||||
println!("lottery: {}", body);
|
println!("lottery: {}", body);
|
||||||
let key = global::get_login(req.headers());
|
let key = global::get_login(req.headers());
|
||||||
|
|
|
@ -225,6 +225,8 @@ pub fn initialize(req: HttpRequest, body: String) -> HttpResponse {
|
||||||
user["user"]["guest_cool_master_card_id"] = id.into();
|
user["user"]["guest_cool_master_card_id"] = id.into();
|
||||||
user["user"]["guest_pure_master_card_id"] = id.into();
|
user["user"]["guest_pure_master_card_id"] = id.into();
|
||||||
user2["home"]["preset_setting"][0]["illust_master_card_id"] = id.into();
|
user2["home"]["preset_setting"][0]["illust_master_card_id"] = id.into();
|
||||||
|
user["gem"]["free"] = (3000).into();
|
||||||
|
user["gem"]["total"] = (3000).into();
|
||||||
|
|
||||||
let id = body["master_character_id"].to_string();
|
let id = body["master_character_id"].to_string();
|
||||||
let userr = &id[id.len() - 2..].parse::<i32>().unwrap();
|
let userr = &id[id.len() - 2..].parse::<i32>().unwrap();
|
||||||
|
|
Loading…
Add table
Reference in a new issue