feat: add created_at timestamp field to Provider struct

- Add optional created_at field to track provider creation time
- Serialize field as camelCase (createdAt) for JSON compatibility
- Skip serialization when field is None to maintain backward compatibility
This commit is contained in:
Jason
2025-09-22 10:46:18 +08:00
parent 7eaf284400
commit 122d7f1ad6

View File

@@ -16,6 +16,9 @@ pub struct Provider {
pub website_url: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub category: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "createdAt")]
pub created_at: Option<i64>,
}
impl Provider {
@@ -32,6 +35,7 @@ impl Provider {
settings_config,
website_url,
category: None,
created_at: None,
}
}
}