first draft of an interface with frontend
This commit is contained in:
32
src/main.rs
32
src/main.rs
@@ -5,6 +5,38 @@ extern crate lootalot_db;
|
||||
use actix_web::{fs, server, App, HttpRequest, Result};
|
||||
use std::env;
|
||||
|
||||
|
||||
mod api {
|
||||
use actix_web::{Result, Json};
|
||||
|
||||
struct Player;
|
||||
struct Item;
|
||||
|
||||
fn player_list() -> Result<Json<Vec<Player>>> {
|
||||
let players: Vec<Player> = Vec::new();
|
||||
Ok(Json(players))
|
||||
}
|
||||
|
||||
fn player_info(_id: i32) -> Result<Json<Player>> {
|
||||
let player = Player;
|
||||
Ok(Json(player))
|
||||
}
|
||||
|
||||
fn chest_content(_id: i32) -> Result<Json<Vec<Item>>> {
|
||||
let items: Vec<Item> = Vec::new();
|
||||
Ok(Json(items))
|
||||
}
|
||||
|
||||
fn put_request(_player_id: i32, _item_id: i32) -> Result<Json<bool>> {
|
||||
Ok(Json(false))
|
||||
}
|
||||
|
||||
fn withdraw_request(_player_id: i32, _item_id: i32) -> Result<Json<bool>> {
|
||||
Ok(Json(false))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user