Skip to content
Clone
b453d5d
26 lines 893 B Rust
use sea_orm::entity::prelude::*;
use time::OffsetDateTime;
use uuid::Uuid;
#[sea_orm::model]
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
#[sea_orm(table_name = "space_invite")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: Uuid,
pub space_id: Uuid,
pub user_id: Option<i64>,
pub email: String,
// 授予的角色组见 space_invite_groups 关联表
pub accept_code: String,
pub created_at: OffsetDateTime,
pub expires_at: Option<OffsetDateTime>,
pub accepted_at: Option<OffsetDateTime>,
pub revoked_at: Option<OffsetDateTime>,
#[sea_orm(belongs_to, from = "space_id", to = "id")]
pub space: BelongsTo<super::spaces::Entity>,
#[sea_orm(belongs_to, from = "user_id", to = "uid")]
pub user: BelongsTo<Option<super::super::users::user::Entity>>,
}
impl ActiveModelBehavior for ActiveModel {}