Added apis
This commit is contained in:
@@ -6,6 +6,7 @@ edition = "2021"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
async-graphql = { version = "4.0.6", features = ["uuid"] }
|
||||
anyhow = "1.0.60"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0.68"
|
||||
|
@@ -1,10 +1,11 @@
|
||||
pub mod requests;
|
||||
pub mod responses;
|
||||
|
||||
use async_graphql::{Enum, InputObject, SimpleObject};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use uuid::Uuid;
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq, Enum, Copy)]
|
||||
pub enum ItemState {
|
||||
Created,
|
||||
Done,
|
||||
@@ -12,7 +13,7 @@ pub enum ItemState {
|
||||
Deleted,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, InputObject, SimpleObject)]
|
||||
pub struct ItemDto {
|
||||
pub id: Uuid,
|
||||
pub title: String,
|
||||
|
@@ -1,6 +1,7 @@
|
||||
use async_graphql::InputObject;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, InputObject)]
|
||||
pub struct CreateItemDto {
|
||||
pub name: String,
|
||||
}
|
||||
|
Reference in New Issue
Block a user