1 2 3 4 5 6 7 8 9 10 11 12 13
use async_graphql::FieldResult; use async_graphql::Object; #[derive(Default)] pub struct QueryDateTime; #[Object(extends)] impl QueryDateTime { /// 返回当前系统时间(UTC) async fn current_date_time(&self) -> FieldResult<String> { Ok(crate::commons::date_string()) } }