use sea_orm::entity::prelude::*; use time::OffsetDateTime; use uuid::Uuid; #[sea_orm::model] #[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)] #[sea_orm(table_name = "dir_overwrite_user")] pub struct Model { #[sea_orm(primary_key, auto_increment = false)] pub dir_id: Uuid, #[sea_orm(primary_key, auto_increment = false)] pub user_id: i64, #[sea_orm(default_value = 0)] pub allow_mask: i64, #[sea_orm(default_value = 0)] pub deny_mask: i64, /// 到期时间;`NULL` 表示永久。过期的覆盖项在可见性计算中被忽略。 pub expires_at: Option, #[sea_orm(belongs_to, from = "dir_id", to = "id")] pub dir: BelongsTo, #[sea_orm(belongs_to, from = "user_id", to = "uid")] pub user: BelongsTo, } impl ActiveModelBehavior for ActiveModel {}