2023-12-13 12:32:01 +08:00
|
|
|
use sea_orm::entity::prelude::*;
|
|
|
|
|
use serde::{Deserialize, Serialize};
|
2023-12-22 17:57:27 +08:00
|
|
|
use chrono::{DateTime, FixedOffset};
|
2023-12-13 12:32:01 +08:00
|
|
|
|
2023-12-18 15:52:52 +08:00
|
|
|
#[derive(Clone, Debug, PartialEq, Eq, Hash, DeriveEntityModel, Deserialize, Serialize)]
|
2023-12-13 12:32:01 +08:00
|
|
|
#[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,
|
2023-12-22 17:57:27 +08:00
|
|
|
pub avatar_base64: String,
|
|
|
|
|
pub color_scheme: String,
|
2023-12-13 12:32:01 +08:00
|
|
|
pub list_style: String,
|
|
|
|
|
pub language: String,
|
2023-12-18 15:52:52 +08:00
|
|
|
pub password: String,
|
2023-12-13 12:32:01 +08:00
|
|
|
|
2023-12-13 19:51:02 +08:00
|
|
|
#[serde(skip_deserializing)]
|
2023-12-22 17:57:27 +08:00
|
|
|
pub last_login_at: DateTime<FixedOffset>,
|
2023-12-13 19:51:02 +08:00
|
|
|
#[serde(skip_deserializing)]
|
2023-12-22 17:57:27 +08:00
|
|
|
pub created_at: DateTime<FixedOffset>,
|
|
|
|
|
#[serde(skip_deserializing)]
|
|
|
|
|
pub updated_at: DateTime<FixedOffset>,
|
2023-12-13 12:32:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
|
|
|
|
pub enum Relation {}
|
|
|
|
|
|
2023-12-22 17:57:27 +08:00
|
|
|
|
2023-12-13 12:32:01 +08:00
|
|
|
impl ActiveModelBehavior for ActiveModel {}
|