Traits
This commit is contained in:
parent
958cf8829a
commit
b6dba5fc88
4 changed files with 15 additions and 12 deletions
|
|
@ -1,6 +1,7 @@
|
|||
use serde::{Deserialize, Serialize};
|
||||
use std::fmt;
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub enum ToDoStatus {
|
||||
Pending,
|
||||
InProgress,
|
||||
|
|
@ -38,7 +39,7 @@ impl std::str::FromStr for ToDoStatus {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub enum TaskStatus {
|
||||
Pending,
|
||||
Running,
|
||||
|
|
@ -76,7 +77,7 @@ impl std::str::FromStr for TaskStatus {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub enum ModelType {
|
||||
Llm,
|
||||
CodeGen,
|
||||
|
|
@ -114,7 +115,7 @@ impl std::str::FromStr for ModelType {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub enum DocType {
|
||||
ApiDoc,
|
||||
Readme,
|
||||
|
|
@ -135,7 +136,7 @@ impl fmt::Display for DocType {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub enum PromptType {
|
||||
Authority,
|
||||
Confirm,
|
||||
|
|
@ -152,7 +153,7 @@ impl fmt::Display for PromptType {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub enum PromptOption {
|
||||
Accept,
|
||||
Deny,
|
||||
|
|
@ -181,7 +182,7 @@ impl fmt::Display for PromptOption {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub enum TaskResultType {
|
||||
Success,
|
||||
Error,
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ use uuid::Uuid;
|
|||
|
||||
pub type ProjectId = Uuid;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Project {
|
||||
pub id: ProjectId,
|
||||
pub name: String,
|
||||
|
|
@ -72,7 +72,7 @@ impl Project {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct ProjectFile {
|
||||
pub id: Uuid,
|
||||
pub path: String,
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
use chrono::{DateTime, Utc};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use uuid::Uuid;
|
||||
|
||||
use crate::enums::{TaskResultType, TaskStatus};
|
||||
use crate::todo::ToDo;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Task {
|
||||
pub id: Uuid,
|
||||
pub todo_id: Uuid,
|
||||
|
|
@ -115,7 +116,7 @@ impl Task {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub enum TaskResult {
|
||||
Success(String),
|
||||
Error(String),
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
use chrono::{DateTime, Utc};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use uuid::Uuid;
|
||||
|
||||
use crate::enums::ToDoStatus;
|
||||
|
|
@ -11,7 +12,7 @@ const MIN_PRIORITY: u32 = 1;
|
|||
const MAX_PRIORITY: u32 = 1000;
|
||||
const DEFAULT_PRIORITY: u32 = 100;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct ToDo {
|
||||
pub id: Uuid,
|
||||
pub title: String,
|
||||
|
|
|
|||
Loading…
Reference in a new issue