Add (dummy) lottery endpoint

This commit is contained in:
Ethan O'Brien
2024-04-02 14:48:01 -05:00
parent 68be3978fe
commit a1d73690e6
3 changed files with 22 additions and 2 deletions

View File

@ -85,7 +85,21 @@ fn get_random_cards(_count: i32) -> JsonValue {
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();
println!("lottery: {}", body);
let key = global::get_login(req.headers());