feat: tag
This commit is contained in:
@@ -19,3 +19,40 @@ pub struct CategoryForm {
|
||||
pub uid: i64,
|
||||
pub name: String,
|
||||
}
|
||||
|
||||
#[derive(Queryable, Selectable, serde::Serialize, serde::Deserialize)]
|
||||
#[diesel(table_name = schema::tags)]
|
||||
#[diesel(check_for_backend(diesel::pg::Pg))]
|
||||
pub struct Tag {
|
||||
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::tags)]
|
||||
pub struct TagForm {
|
||||
pub uid: i64,
|
||||
pub name: String,
|
||||
}
|
||||
|
||||
#[derive(Queryable, Selectable, serde::Serialize)]
|
||||
#[diesel(table_name = schema::users)]
|
||||
pub struct User {
|
||||
pub id: i64,
|
||||
pub username: String,
|
||||
pub password: String,
|
||||
pub mail: String,
|
||||
pub is_delete: bool,
|
||||
}
|
||||
|
||||
#[derive(Insertable)]
|
||||
#[diesel(table_name = schema::users)]
|
||||
pub struct UserForm {
|
||||
pub username: String,
|
||||
pub password: String,
|
||||
pub mail: String,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user