feat: account

This commit is contained in:
acx
2024-07-28 15:04:53 +00:00
parent b3ee37fbe3
commit e25c1b5ceb
10 changed files with 382 additions and 8 deletions

View File

@@ -8,6 +8,8 @@ pub struct Category {
id: i64,
uid: i64,
name: String,
level: i32,
parent_category_id: i64,
is_delete: bool,
create_at: chrono::NaiveDateTime,
update_at: chrono::NaiveDateTime,
@@ -18,6 +20,8 @@ pub struct Category {
pub struct CategoryForm {
pub uid: i64,
pub name: String,
pub level: i32,
pub parent_category_id: i64,
}
#[derive(Queryable, Selectable, serde::Serialize, serde::Deserialize)]
@@ -27,6 +31,8 @@ pub struct Tag {
id: i64,
uid: i64,
name: String,
level: i32,
parent_tag_id: i64,
is_delete: bool,
create_at: chrono::NaiveDateTime,
update_at: chrono::NaiveDateTime,
@@ -37,6 +43,49 @@ pub struct Tag {
pub struct TagForm {
pub uid: i64,
pub name: String,
pub level: i32,
pub parent_tag_id: i64,
}
#[derive(Queryable, Selectable, serde::Serialize, serde::Deserialize)]
#[diesel(table_name = schema::books)]
#[diesel(check_for_backend(diesel::pg::Pg))]
pub struct Book {
id: i64,
uid: i64,
name: String,
is_delete: bool,
create_at: chrono::NaiveDateTime,
update_at: chrono::NaiveDateTime,
}
#[derive(serde::Deserialize, Insertable)]
#[diesel(table_name = schema::books)]
pub struct BookForm {
pub uid: i64,
pub name: String,
}
#[derive(Queryable, Selectable, serde::Serialize, serde::Deserialize)]
#[diesel(table_name = schema::accounts)]
#[diesel(check_for_backend(diesel::pg::Pg))]
pub struct Account {
id: i64,
uid: i64,
name: String,
account_type: i64,
is_delete: bool,
create_at: chrono::NaiveDateTime,
update_at: chrono::NaiveDateTime,
}
#[derive(serde::Deserialize, Insertable)]
#[diesel(table_name = schema::accounts)]
pub struct AccountForm {
pub uid: i64,
pub name: String,
pub account_type: i64,
}
#[derive(Queryable, Selectable, serde::Serialize)]