mirror of
https://git.ethanthesleepy.one/ethanaobrien/ew.git
synced 2025-05-13 11:37:33 -05:00
Implement /api/notice/reward
This commit is contained in:
parent
d179bd80a9
commit
dbcec25ffd
4 changed files with 17 additions and 5 deletions
|
@ -184,6 +184,9 @@ async fn login_bonus(req: HttpRequest, body: String) -> HttpResponse { router::l
|
|||
#[get("/api/notice/reward")]
|
||||
async fn reward(req: HttpRequest) -> HttpResponse { router::notice::reward(req) }
|
||||
|
||||
#[post("/api/notice/reward")]
|
||||
async fn reward_post(req: HttpRequest, body: String) -> HttpResponse { router::notice::reward_post(req, body) }
|
||||
|
||||
#[post("/api/user/getmigrationcode")]
|
||||
async fn getmigrationcode(req: HttpRequest, body: String) -> HttpResponse { router::user::get_migration_code(req, body) }
|
||||
|
||||
|
@ -316,6 +319,7 @@ async fn main() -> std::io::Result<()> {
|
|||
.service(debug_error)
|
||||
.service(login_bonus)
|
||||
.service(reward)
|
||||
.service(reward_post)
|
||||
.service(live_continue)
|
||||
.service(live_guest)
|
||||
.service(live_mission)
|
||||
|
|
|
@ -100,10 +100,7 @@ pub fn lottery(_req: HttpRequest) -> HttpResponse {
|
|||
"code": 0,
|
||||
"server_time": global::timestamp(),
|
||||
"data": {
|
||||
"lottery_list": [
|
||||
{"master_lottery_id":1110001,"master_lottery_price_number":1,"count":3,"daily_count":0,"last_count_date":"2023-04-16 23:58:31"}
|
||||
|
||||
]
|
||||
"lottery_list": []
|
||||
}
|
||||
};
|
||||
global::send(resp)
|
||||
|
|
|
@ -15,3 +15,12 @@ pub fn reward(_req: HttpRequest) -> HttpResponse {
|
|||
};
|
||||
global::send(resp)
|
||||
}
|
||||
|
||||
pub fn reward_post(_req: HttpRequest, _body: String) -> HttpResponse {
|
||||
let resp = object!{
|
||||
"code": 0,
|
||||
"server_time": global::timestamp(),
|
||||
"data": []
|
||||
};
|
||||
global::send(resp)
|
||||
}
|
||||
|
|
|
@ -36,7 +36,9 @@ pub fn deck(req: HttpRequest, body: String) -> HttpResponse {
|
|||
|
||||
pub fn user(req: HttpRequest) -> HttpResponse {
|
||||
let key = global::get_login(req.headers(), "");
|
||||
let user = userdata::get_acc(&key);
|
||||
let mut user = userdata::get_acc(&key);
|
||||
|
||||
user["lottery_list"] = array![];
|
||||
|
||||
let resp = object!{
|
||||
"code": 0,
|
||||
|
|
Loading…
Add table
Reference in a new issue