use serde::{Deserialize, Serialize};
use serde_repr::{Deserialize_repr, Serialize_repr};
use crate::module::{
model::{BloodType, InfoBox, SimpleImage, Stat},
subject::model::SubjectType,
};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CharacterSearch {
pub keyword: String,
pub filter: Option<CharacterFilter>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CharacterFilter {
pub nsfw: Option<bool>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Character {
pub id: u32,
pub name: String,
pub r#type: CharacterType,
pub images: SimpleImage,
pub summary: String,
pub locked: bool,
pub infobox: InfoBox,
pub gender: String,
pub blood_type: Option<BloodType>,
pub birth_year: Option<u32>,
pub birth_mon: Option<u32>,
pub birth_day: Option<u32>,
pub stat: Stat,
pub nsfw: bool,
}
#[derive(Debug, Clone, Serialize_repr, Deserialize_repr)]
#[repr(u8)]
pub enum CharacterType {
Character = 1,
Mechanic = 2,
Ship = 3,
Organization = 4,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CharacterPerson {
pub id: u32,
pub name: String,
pub r#type: CharacterType,
pub images: SimpleImage,
pub subject_id: u32,
pub subject_type: SubjectType,
pub subject_name: String,
pub subject_name_cn: String,
pub staff: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CharacterSubject {
pub id: u32,
pub r#type: SubjectType,
pub staff: String,
pub name: String,
pub name_cn: String,
pub image: String,
}