mirror of
https://git.ethanthesleepy.one/ethanaobrien/ew.git
synced 2025-05-13 11:37:33 -05:00
Add endpoints for another event
This commit is contained in:
parent
4334c8dc22
commit
541850128b
2 changed files with 33 additions and 7 deletions
|
@ -78,6 +78,8 @@ async fn api_req(req: HttpRequest, body: String) -> HttpResponse {
|
|||
"/api/live/ranking" => clear_rate::ranking(req, body),
|
||||
"/api/event" => event::event(req, body),
|
||||
"/api/event/star_event" => event::star_event(req, body),
|
||||
"/api/event/set/member" => event::set_member(req, body),
|
||||
"/api/event/ranking" => event::ranking(req, body),
|
||||
"/api/event_star_live/change_target_music" => event::change_target_music(req, body),
|
||||
"/api/event_star_live/start" => live::event_start(req, body),
|
||||
"/api/event_star_live/end" => live::event_end(req, body),
|
||||
|
|
|
@ -91,3 +91,27 @@ pub fn change_target_music(req: HttpRequest, body: String) -> Option<JsonValue>
|
|||
|
||||
Some(event["event_data"]["star_event"].clone())
|
||||
}
|
||||
|
||||
pub fn set_member(req: HttpRequest, body: String) -> Option<JsonValue> {
|
||||
let key = global::get_login(req.headers(), &body);
|
||||
let body = json::parse(&encryption::decrypt_packet(&body).unwrap()).unwrap();
|
||||
let mut event = userdata::get_acc_event(&key);
|
||||
|
||||
event["event_data"]["member_ranking"] = object!{
|
||||
master_character_id: body["master_character_id"].clone(),
|
||||
rank: 0,
|
||||
point: 0
|
||||
};
|
||||
|
||||
userdata::save_acc_event(&key, event.clone());
|
||||
|
||||
Some(object!{
|
||||
event_member: body.clone()
|
||||
})
|
||||
}
|
||||
|
||||
pub fn ranking(_req: HttpRequest, _body: String) -> Option<JsonValue> {
|
||||
Some(object!{
|
||||
ranking_detail_list: []
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue