feat add http body
This commit is contained in:
@@ -2,7 +2,7 @@ use serde::{Serialize, Deserialize};
|
|||||||
use super::common::{number_stringify, OptionalI64};
|
use super::common::{number_stringify, OptionalI64};
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize)]
|
||||||
pub struct BookItem {
|
pub struct BookResp {
|
||||||
#[serde(with="number_stringify")]
|
#[serde(with="number_stringify")]
|
||||||
pub id: OptionalI64,
|
pub id: OptionalI64,
|
||||||
pub name: String,
|
pub name: String,
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use super::common::{number_stringify, OptionalI64};
|
use super::common::{number_stringify, OptionalI64};
|
||||||
|
#[derive(Serialize, Deserialize)]
|
||||||
|
pub struct CategoryResp {
|
||||||
|
pub id: i64,
|
||||||
|
pub name: String,
|
||||||
|
pub parent_id: i64,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct CategoryInfo {
|
pub struct CategoryInfo {
|
||||||
#[serde(with="number_stringify")]
|
#[serde(with="number_stringify")]
|
||||||
|
|||||||
@@ -2,3 +2,4 @@ pub mod book;
|
|||||||
pub mod common;
|
pub mod common;
|
||||||
pub mod category;
|
pub mod category;
|
||||||
pub mod tag;
|
pub mod tag;
|
||||||
|
pub mod transaction;
|
||||||
@@ -2,7 +2,7 @@ use serde::{Serialize, Deserialize};
|
|||||||
use super::common::{number_stringify, OptionalI64};
|
use super::common::{number_stringify, OptionalI64};
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize)]
|
||||||
pub struct TagItem {
|
pub struct TagResp {
|
||||||
#[serde(with="number_stringify")]
|
#[serde(with="number_stringify")]
|
||||||
pub id: OptionalI64,
|
pub id: OptionalI64,
|
||||||
pub name: String,
|
pub name: String,
|
||||||
|
|||||||
21
src/model/http_body/transaction.rs
Normal file
21
src/model/http_body/transaction.rs
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
use serde::{Serialize, Deserialize};
|
||||||
|
use crate::model::http_body::tag::TagInfo;
|
||||||
|
use crate::model::http_body::category::CategoryResp;
|
||||||
|
use crate::model::http_body::common::OptionalI64;
|
||||||
|
|
||||||
|
#[derive(Serialize,Deserialize)]
|
||||||
|
pub struct TransactionResp {
|
||||||
|
pub id: i64,
|
||||||
|
pub description: String,
|
||||||
|
pub category: CategoryResp,
|
||||||
|
pub tags: Vec<TagInfo>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Serialize,Deserialize)]
|
||||||
|
pub struct TransactionReq {
|
||||||
|
pub id: Option<String>,
|
||||||
|
pub description: Option<String>,
|
||||||
|
pub category_id: Option<String>,
|
||||||
|
pub tags: Vec<String>,
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user