mirror of
https://git.ethanthesleepy.one/ethanaobrien/ew.git
synced 2025-05-13 11:37:33 -05:00
Implement notice endpoint
This commit is contained in:
parent
05bf6c011e
commit
0ec158b889
3 changed files with 22 additions and 0 deletions
|
@ -75,6 +75,9 @@ async fn lottery_tutorial(req: HttpRequest, body: String) -> HttpResponse { rout
|
|||
#[post("/api/lottery")]
|
||||
async fn lottery(req: HttpRequest, body: String) -> HttpResponse { router::lottery::lottery(req, body) }
|
||||
|
||||
#[get("/api/notice/reward")]
|
||||
async fn reward(req: HttpRequest) -> HttpResponse { router::notice::reward(req) }
|
||||
|
||||
async fn log_unknown_request(req: HttpRequest, body: String) -> HttpResponse {
|
||||
if body != String::new() {
|
||||
println!("{}", encryption::decrypt_packet(&body).unwrap());
|
||||
|
@ -92,6 +95,7 @@ async fn main() -> std::io::Result<()> {
|
|||
println!("Request: {}", req.path());
|
||||
srv.call(req)
|
||||
})
|
||||
.service(reward)
|
||||
.service(live_guest)
|
||||
.service(live_clearrate)
|
||||
.service(live_start)
|
||||
|
|
|
@ -13,3 +13,4 @@ pub mod live;
|
|||
pub mod event;
|
||||
pub mod chat;
|
||||
pub mod story;
|
||||
pub mod notice;
|
||||
|
|
17
src/router/notice.rs
Normal file
17
src/router/notice.rs
Normal file
|
@ -0,0 +1,17 @@
|
|||
use json;
|
||||
use json::object;
|
||||
use crate::router::global;
|
||||
use actix_web::{HttpResponse, HttpRequest};
|
||||
|
||||
//todo
|
||||
pub fn reward(_req: HttpRequest) -> HttpResponse {
|
||||
|
||||
let resp = object!{
|
||||
"code": 0,
|
||||
"server_time": global::timestamp(),
|
||||
"data": {
|
||||
"reward_list": []
|
||||
}
|
||||
};
|
||||
global::send(resp)
|
||||
}
|
Loading…
Add table
Reference in a new issue