Implement dummy /api/mission/receive

This commit is contained in:
Ethan O'Brien 2024-04-08 16:15:34 -05:00
parent 2115bbb08b
commit 28d1e01138
2 changed files with 16 additions and 0 deletions

View file

@ -120,6 +120,9 @@ async fn mission(req: HttpRequest) -> HttpResponse { router::mission::mission(re
#[get("/api/mission/clear")]
async fn mission_clear(req: HttpRequest, body: String) -> HttpResponse { router::mission::clear(req, body) }
#[get("/api/mission/receive")]
async fn mission_receive(req: HttpRequest, body: String) -> HttpResponse { router::mission::receive(req, body) }
#[get("/api/home")]
async fn home(req: HttpRequest) -> HttpResponse { router::home::home(req) }
@ -217,6 +220,7 @@ async fn main() -> std::io::Result<()> {
.service(friend)
.service(mission)
.service(mission_clear)
.service(mission_receive)
.service(home)
.service(start_assethash)
.service(user)

View file

@ -46,6 +46,18 @@ pub fn clear(req: HttpRequest, body: String) -> HttpResponse {
global::send(resp)
}
pub fn receive(_req: HttpRequest, _body: String) -> HttpResponse {
//let key = global::get_login(req.headers(), &body);
//let missions = userdata::get_acc_missions(&key);
//let body = json::parse(&encryption::decrypt_packet(&body).unwrap()).unwrap();
//todo - give user rewards based off of cleared missions
let resp = object!{
"code": 0,
"server_time": global::timestamp(),
"data": {
"reward_list": []
}
};
global::send(resp)