59 lines
1.1 KiB
Rust
59 lines
1.1 KiB
Rust
use serde::{Deserialize, Serialize};
|
|
use std::collections::HashMap;
|
|
|
|
#[derive(Serialize, Deserialize, Debug)]
|
|
pub struct Game {
|
|
pub id: i32,
|
|
pub key: String,
|
|
pub names: HashMap<String, String>,
|
|
pub platform: String,
|
|
pub category: String,
|
|
#[serde(rename = "type")]
|
|
pub game_type: String,
|
|
pub image: Option<String>,
|
|
}
|
|
|
|
pub struct ListGamesRequest {
|
|
pub vendor_key: String,
|
|
}
|
|
|
|
#[derive(Serialize, Deserialize, Debug)]
|
|
pub struct _ListGamesResponse {
|
|
pub code: i32,
|
|
pub msg: Option<String>,
|
|
pub games: Vec<Game>,
|
|
}
|
|
|
|
#[derive(Debug)]
|
|
pub struct ListGamesResponse {
|
|
pub games: Vec<Game>,
|
|
}
|
|
|
|
pub struct PlayRequest {
|
|
pub vendor_key: String,
|
|
pub game_key: String,
|
|
pub username: String,
|
|
pub nickname: String,
|
|
pub site_username: String,
|
|
pub group_key: Option<String>,
|
|
pub amount: i32,
|
|
pub request_key: Option<String>,
|
|
}
|
|
|
|
#[derive(Serialize, Deserialize, Debug)]
|
|
pub struct _PlayResponse {
|
|
pub code: i32,
|
|
pub msg: Option<String>,
|
|
#[serde(rename = "userId")]
|
|
pub user_id: String,
|
|
pub url: String,
|
|
pub balance: i32,
|
|
}
|
|
|
|
#[derive(Debug)]
|
|
pub struct PlayResponse {
|
|
pub user_id: String,
|
|
pub url: String,
|
|
pub balance: i32,
|
|
}
|