feat: add gacha and init cms

This commit is contained in:
Maulana Sodiqin
2025-05-20 10:45:01 +07:00
parent f4b0ed0a4a
commit e63658c082
35 changed files with 976 additions and 171 deletions
@@ -1,5 +1,5 @@
use super::GachaItemSchema;
use serde::{Deserialize, Serialize};
use surrealdb::sql::Thing;
use utoipa::ToSchema;
use validator::Validate;
@@ -20,11 +20,14 @@ pub struct GachaItemDto {
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>,
impl GachaItemDto {
pub fn from(dto: &GachaItemSchema) -> Self {
Self {
id: dto.id.id.to_raw(),
name: dto.name.clone(),
is_deleted: dto.is_deleted,
created_at: dto.created_at.clone(),
updated_at: dto.updated_at.clone(),
}
}
}