mirror of
https://git.ethanthesleepy.one/ethanaobrien/ew.git
synced 2025-05-13 11:37:33 -05:00
Implement dummy story endpoint
This commit is contained in:
parent
26e51d0737
commit
841d2b0acd
3 changed files with 21 additions and 0 deletions
|
@ -33,6 +33,9 @@ async fn chat_start(req: HttpRequest, body: String) -> HttpResponse { router::ch
|
||||||
#[post("/api/chat/talk/end")]
|
#[post("/api/chat/talk/end")]
|
||||||
async fn chat_end(req: HttpRequest, body: String) -> HttpResponse { router::chat::end(req, body) }
|
async fn chat_end(req: HttpRequest, body: String) -> HttpResponse { router::chat::end(req, body) }
|
||||||
|
|
||||||
|
#[post("/api/story/read")]
|
||||||
|
async fn story_read(req: HttpRequest, body: String) -> HttpResponse { router::story::read(req, body) }
|
||||||
|
|
||||||
#[post("/api/user/initialize")]
|
#[post("/api/user/initialize")]
|
||||||
async fn user_initialize(req: HttpRequest, body: String) -> HttpResponse { router::user::initialize(req, body) }
|
async fn user_initialize(req: HttpRequest, body: String) -> HttpResponse { router::user::initialize(req, body) }
|
||||||
|
|
||||||
|
@ -92,6 +95,7 @@ async fn main() -> std::io::Result<()> {
|
||||||
.service(chat_home)
|
.service(chat_home)
|
||||||
.service(chat_end)
|
.service(chat_end)
|
||||||
.service(chat_start)
|
.service(chat_start)
|
||||||
|
.service(story_read)
|
||||||
.service(event)
|
.service(event)
|
||||||
.service(purchase)
|
.service(purchase)
|
||||||
.service(user_initialize)
|
.service(user_initialize)
|
||||||
|
|
|
@ -12,3 +12,4 @@ pub mod friend;
|
||||||
pub mod live;
|
pub mod live;
|
||||||
pub mod event;
|
pub mod event;
|
||||||
pub mod chat;
|
pub mod chat;
|
||||||
|
pub mod story;
|
||||||
|
|
16
src/router/story.rs
Normal file
16
src/router/story.rs
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
use json;
|
||||||
|
use json::object;
|
||||||
|
use crate::router::global;
|
||||||
|
//use crate::encryption;
|
||||||
|
use actix_web::{HttpResponse, HttpRequest};
|
||||||
|
//use crate::router::userdata;
|
||||||
|
|
||||||
|
pub fn read(_req: HttpRequest, _body: String) -> HttpResponse {
|
||||||
|
|
||||||
|
let resp = object!{
|
||||||
|
"code": 0,
|
||||||
|
"server_time": global::timestamp(),
|
||||||
|
"data": {"gift_list":[],"updated_value_list":{"master_chat_room_ids":[3001001,3101001],"master_chat_chapter_ids":[300100101,310100101]},"reward_list":[{"type":16,"value":3001001,"level":0,"amount":1},{"type":16,"value":3101001,"level":0,"amount":1},{"type":17,"value":300100101,"level":0,"amount":1},{"type":17,"value":310100101,"level":0,"amount":1}],"clear_mission_ids":[]}
|
||||||
|
};
|
||||||
|
global::send(resp)
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue