feature: add command to query tasks
This commit is contained in:
parent
71c11eaa84
commit
63c20cfc87
7 changed files with 184 additions and 8 deletions
|
|
@ -1,7 +1,8 @@
|
|||
use crate::task_manager::TaskPayload;
|
||||
use chrono::{DateTime, Local};
|
||||
use serde::{Deserialize, Deserializer, de, Serialize};
|
||||
use serde::{de, Deserialize, Deserializer, Serialize};
|
||||
use serde_json::Value;
|
||||
use crate::sql::TaskPayload;
|
||||
use std::fmt::Display;
|
||||
|
||||
#[derive(Deserialize, Serialize, Debug)]
|
||||
pub struct DocumentPayload {
|
||||
|
|
@ -14,6 +15,16 @@ pub struct DocumentPayload {
|
|||
location: String,
|
||||
}
|
||||
|
||||
impl Display for DocumentPayload {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(
|
||||
f,
|
||||
"{}",
|
||||
serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl TaskPayload for DocumentPayload {
|
||||
fn get_key(&self) -> String {
|
||||
self.url.clone()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue