31 lines
816 B
Rust
31 lines
816 B
Rust
use serde::{Deserialize, Serialize};
|
|||
|
|
use surrealdb::sql::Thing;
|
||
|
|
use utoipa::ToSchema;
|
||
|
|
use validator::Validate;
|
||
|
|
|
||
|
|
#[derive(Clone, Debug, Serialize, Deserialize, ToSchema, Validate)]
|
||
|
|
pub struct GachaItemRequestDto {
|
||
|
|
#[validate(length(min = 1, message = "Item name must not be empty"))]
|
||
|
|
pub name: String,
|
||
|
|
#[validate(length(min = 1, message = "Image URL must not be empty"))]
|
||
|
|
pub image_url: String,
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Clone, Debug, Serialize, Deserialize, ToSchema)]
|
||
|
|
pub struct GachaItemDto {
|
||
|
|
pub id: String,
|
||
|
|
pub name: String,
|
||
|
|
pub is_deleted: bool,
|
||
|
|
pub created_at: Option<String>,
|
||
|
|
pub updated_at: Option<String>,
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||
|
|
pub struct GachaItemDtoRaw {
|
||
|
|
pub id: Thing,
|
||
|
|
pub name: String,
|
||
|
|
pub is_deleted: bool,
|
||
|
|
pub created_at: Option<String>,
|
||
|
|
pub updated_at: Option<String>,
|
||
|
|
}
|