diff --git a/forgejo-hooks/Cargo.toml b/forgejo-hooks/Cargo.toml index 2b8444e..6242844 100644 --- a/forgejo-hooks/Cargo.toml +++ b/forgejo-hooks/Cargo.toml @@ -4,4 +4,5 @@ version = "0.1.0" edition = "2021" [dependencies] +chrono = { version = "0.4", default-features = false, features = ["serde"] } serde = { version = "1.0", features = ["derive"] } diff --git a/forgejo-hooks/src/lib.rs b/forgejo-hooks/src/lib.rs index 758ba12..4c35cdc 100644 --- a/forgejo-hooks/src/lib.rs +++ b/forgejo-hooks/src/lib.rs @@ -1,3 +1,4 @@ +use chrono::{DateTime, Utc}; use serde::Deserialize; #[derive(Deserialize, Debug)] @@ -24,7 +25,7 @@ pub struct Commit { pub url: String, pub author: CommitAuthor, pub committer: CommitAuthor, - pub timestamp: String, + pub timestamp: DateTime, } #[derive(Deserialize, Debug)] @@ -59,8 +60,8 @@ pub struct Repository { pub watchers_count: u32, pub open_issues_count: u32, pub default_branch: String, - pub created_at: String, - pub updated_at: String, + pub created_at: DateTime, + pub updated_at: DateTime, } #[derive(Deserialize, Debug)] @@ -91,9 +92,9 @@ pub struct RepositoryFull { pub open_issues_count: u32, pub open_pr_counter: u32, pub default_branch: String, - pub created_at: String, - pub updated_at: String, - pub archived_at: String, + pub created_at: DateTime, + pub updated_at: DateTime, + pub archived_at: DateTime, pub permissions: Perms, pub has_issues: bool, pub internal_tracker: InternalTracker, @@ -114,7 +115,7 @@ pub struct RepositoryFull { pub avatar_url: String, pub internal: bool, pub mirror_internal: String, - pub mirror_updated: String, + pub mirror_updated: DateTime, pub repo_transfer: Option, } @@ -128,8 +129,8 @@ pub struct RepositoryOwner { pub avatar_url: String, pub language: String, pub is_admin: bool, - pub last_login: String, - pub created: String, + pub last_login: DateTime, + pub created: DateTime, pub restricted: bool, pub active: bool, pub prohibit_login: bool,