feat: impl dao (#1)

Co-authored-by: kould <2435992353@qq.com>
This commit is contained in:
Kould
2023-12-13 12:32:01 +08:00
committed by GitHub
parent 6ad8d5799b
commit c6d0d85ab5
19 changed files with 725 additions and 1 deletions

26
src/entity/user_info.rs Normal file
View File

@@ -0,0 +1,26 @@
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel, Deserialize, Serialize)]
#[sea_orm(table_name = "user_info")]
pub struct Model {
#[sea_orm(primary_key)]
#[serde(skip_deserializing)]
pub uid: i64,
pub email: String,
pub nickname: String,
pub avatar_url: String,
pub color_schema: String,
pub list_style: String,
pub language: String,
pub created_at: DateTimeWithTimeZone,
pub updated_at: DateTimeWithTimeZone,
#[sea_orm(soft_delete_column)]
pub is_deleted: bool,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {}
impl ActiveModelBehavior for ActiveModel {}