feat: account
This commit is contained in:
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user