service_contracts/
service_player.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use mahjong_core::{GameId, PlayerId};
use serde::{Deserialize, Serialize};
use ts_rs::TS;

#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
#[ts(export)]
pub struct ServicePlayer {
    pub created_at: String,
    pub id: PlayerId,
    pub is_ai: bool,
    pub name: String,
}

#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
#[ts(export)]
pub struct ServicePlayerGame {
    pub created_at: String,
    pub id: GameId,
    pub updated_at: String,
}

#[derive(Debug, Clone, Serialize, Deserialize, TS)]
#[ts(export)]
pub struct ServicePlayerSummary {
    pub id: PlayerId,
    pub name: String,
}