forked from Roflin/gamenight
Converted the Api to a Restful api.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Gamenight
|
||||
*
|
||||
* Api specification for a Gamenight server
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
* Contact: dennis@brentj.es
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
use crate::models;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct EditGameRequestBody {
|
||||
#[serde(rename = "id")]
|
||||
pub id: String,
|
||||
#[serde(rename = "name")]
|
||||
pub name: String,
|
||||
}
|
||||
|
||||
impl EditGameRequestBody {
|
||||
pub fn new(id: String, name: String) -> EditGameRequestBody {
|
||||
EditGameRequestBody {
|
||||
id,
|
||||
name,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@ pub mod add_gamenight_request_body;
|
||||
pub use self::add_gamenight_request_body::AddGamenightRequestBody;
|
||||
pub mod add_location_request_body;
|
||||
pub use self::add_location_request_body::AddLocationRequestBody;
|
||||
pub mod authorize_location_request_body;
|
||||
pub use self::authorize_location_request_body::AuthorizeLocationRequestBody;
|
||||
pub mod edit_game_request_body;
|
||||
pub use self::edit_game_request_body::EditGameRequestBody;
|
||||
pub mod failure;
|
||||
pub use self::failure::Failure;
|
||||
pub mod game;
|
||||
@@ -16,24 +16,20 @@ pub mod gamenight;
|
||||
pub use self::gamenight::Gamenight;
|
||||
pub mod gamenight_id;
|
||||
pub use self::gamenight_id::GamenightId;
|
||||
pub mod get_gamenight_request_body;
|
||||
pub use self::get_gamenight_request_body::GetGamenightRequestBody;
|
||||
pub mod location;
|
||||
pub use self::location::Location;
|
||||
pub mod location_id;
|
||||
pub use self::location_id::LocationId;
|
||||
pub mod login;
|
||||
pub use self::login::Login;
|
||||
pub mod own_game_request_body;
|
||||
pub use self::own_game_request_body::OwnGameRequestBody;
|
||||
pub mod own_game;
|
||||
pub use self::own_game::OwnGame;
|
||||
pub mod owned_game;
|
||||
pub use self::owned_game::OwnedGame;
|
||||
pub mod participants;
|
||||
pub use self::participants::Participants;
|
||||
pub mod registration;
|
||||
pub use self::registration::Registration;
|
||||
pub mod rename_game_request_body;
|
||||
pub use self::rename_game_request_body::RenameGameRequestBody;
|
||||
pub mod token;
|
||||
pub use self::token::Token;
|
||||
pub mod user;
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Gamenight
|
||||
*
|
||||
* Api specification for a Gamenight server
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
* Contact: dennis@brentj.es
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
use crate::models;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct OwnGame {
|
||||
#[serde(rename = "user_id")]
|
||||
pub user_id: String,
|
||||
#[serde(rename = "location_id", skip_serializing_if = "Option::is_none")]
|
||||
pub location_id: Option<String>,
|
||||
}
|
||||
|
||||
impl OwnGame {
|
||||
pub fn new(user_id: String) -> OwnGame {
|
||||
OwnGame {
|
||||
user_id,
|
||||
location_id: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct OwnedGame {
|
||||
#[serde(rename = "user_id")]
|
||||
pub user_id: String,
|
||||
#[serde(rename = "game_id")]
|
||||
pub game_id: String,
|
||||
#[serde(rename = "location_id", skip_serializing_if = "Option::is_none")]
|
||||
@@ -20,8 +22,9 @@ pub struct OwnedGame {
|
||||
}
|
||||
|
||||
impl OwnedGame {
|
||||
pub fn new(game_id: String) -> OwnedGame {
|
||||
pub fn new(user_id: String, game_id: String) -> OwnedGame {
|
||||
OwnedGame {
|
||||
user_id,
|
||||
game_id,
|
||||
location_id: None,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user