GitLab CI + v3 Endpoint #1
This commit is contained in:
parent
e19187d6c7
commit
790a7dd8ee
4 changed files with 331 additions and 1 deletions
src/v3
71
src/v3/schemas.rs
Normal file
71
src/v3/schemas.rs
Normal file
|
@ -0,0 +1,71 @@
|
|||
use std::collections::HashMap;
|
||||
|
||||
use serde::{Serialize, Deserialize};
|
||||
use utoipa::{ToSchema, IntoParams};
|
||||
|
||||
#[derive(Serialize, Deserialize, ToSchema, Debug, IntoParams)]
|
||||
pub struct AuthParams {
|
||||
pub token: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, ToSchema, Debug, Clone)]
|
||||
pub struct FullViewData {
|
||||
pub games: HashMap<i32, ChellarisGame>,
|
||||
pub ethics: HashMap<i32, Ethic>,
|
||||
pub species: HashMap<i32, Species>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, ToSchema, Debug, Clone)]
|
||||
pub struct ChellarisGame {
|
||||
pub id: i32,
|
||||
pub name: String,
|
||||
pub groups: HashMap<i32, ChellarisGameGroup>,
|
||||
pub empires: HashMap<i32, ChellarisEmpire>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, ToSchema, Debug, Clone)]
|
||||
pub struct ChellarisGameGroup {
|
||||
pub id: i32,
|
||||
pub name: String,
|
||||
}
|
||||
|
||||
#[derive(Serialize, ToSchema, Debug, Clone)]
|
||||
pub struct ChellarisEmpire {
|
||||
pub id: i32,
|
||||
pub gestalt: bool,
|
||||
pub machine: bool,
|
||||
pub group: i32,
|
||||
pub empire_portrait: i32,
|
||||
pub empire_portrait_group: i32,
|
||||
pub discord_user: Option<String>,
|
||||
pub ethics: HashMap<i32, EmpireEthic>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, ToSchema, Debug, Clone)]
|
||||
pub struct Ethic {
|
||||
pub id: i32,
|
||||
pub displayName: String,
|
||||
pub machine: bool,
|
||||
}
|
||||
|
||||
#[derive(Serialize, ToSchema, Debug, Clone)]
|
||||
pub struct EmpireEthic {
|
||||
pub id: i32,
|
||||
pub displayName: String,
|
||||
pub machine: bool,
|
||||
pub fanatic: bool,
|
||||
}
|
||||
|
||||
#[derive(Serialize, ToSchema, Debug, Clone)]
|
||||
pub struct Species {
|
||||
pub id: i32,
|
||||
pub displayName: String,
|
||||
pub portraits: HashMap<i32, Portrait>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, ToSchema, Debug, Clone)]
|
||||
pub struct Portrait {
|
||||
pub id: i32,
|
||||
pub hires: String,
|
||||
pub lores: Option<String>,
|
||||
}
|
Reference in a new issue