141 lines
2.6 KiB
Rust
141 lines
2.6 KiB
Rust
use super::schema::{members, MemberState};
|
|
use beteran_common_rust as bcr;
|
|
|
|
///
|
|
#[derive(Eq, Hash, PartialEq, PartialOrd, Debug, Clone, Identifiable, Queryable)]
|
|
#[table_name = "members"]
|
|
pub struct Member {
|
|
///
|
|
pub id: uuid::Uuid,
|
|
///
|
|
pub site_id: uuid::Uuid,
|
|
///
|
|
pub member_class_id: uuid::Uuid,
|
|
///
|
|
pub member_level_id: uuid::Uuid,
|
|
///
|
|
pub username: String,
|
|
///
|
|
pub password: String,
|
|
///
|
|
pub nickname: String,
|
|
///
|
|
pub mobile_phone_number: Option<String>,
|
|
///
|
|
pub state: MemberState,
|
|
///
|
|
pub state_changed_at: Option<i64>,
|
|
///
|
|
pub parent_member_id: Option<uuid::Uuid>,
|
|
///
|
|
pub child_member_count: i64,
|
|
///
|
|
pub last_signined_ip: Option<String>,
|
|
///
|
|
pub last_signined_at: Option<i64>,
|
|
///
|
|
pub created_at: i64,
|
|
///
|
|
pub updated_at: i64,
|
|
///
|
|
pub deleted_at: Option<i64>,
|
|
}
|
|
|
|
///
|
|
#[derive(Insertable, Debug, Clone)]
|
|
#[table_name = "members"]
|
|
pub struct NewMember {
|
|
///
|
|
pub site_id: uuid::Uuid,
|
|
///
|
|
pub member_class_id: uuid::Uuid,
|
|
///
|
|
pub member_level_id: uuid::Uuid,
|
|
///
|
|
pub parent_member_id: Option<uuid::Uuid>,
|
|
///
|
|
pub username: String,
|
|
///
|
|
pub password: String,
|
|
///
|
|
pub nickname: String,
|
|
///
|
|
pub mobile_phone_number: Option<String>,
|
|
}
|
|
|
|
///
|
|
#[derive(AsChangeset, Debug, Clone)]
|
|
#[table_name = "members"]
|
|
pub struct ModifyMember {
|
|
///
|
|
pub site_id: Option<uuid::Uuid>,
|
|
///
|
|
pub member_level_id: Option<uuid::Uuid>,
|
|
///
|
|
pub password: Option<String>,
|
|
///
|
|
pub mobile_phone_number: Option<String>,
|
|
}
|
|
|
|
///
|
|
#[derive(AsChangeset, Debug, Clone)]
|
|
#[table_name = "members"]
|
|
pub struct ModifyMemberForState {
|
|
///
|
|
pub state: MemberState,
|
|
}
|
|
|
|
///
|
|
#[derive(AsChangeset, Debug, Clone)]
|
|
#[table_name = "members"]
|
|
pub struct ModifyMember4LastSignined {
|
|
///
|
|
pub last_signined_ip: String,
|
|
//
|
|
pub last_signined_at: i64,
|
|
}
|
|
|
|
///
|
|
#[derive(AsChangeset, Debug, Clone)]
|
|
#[table_name = "members"]
|
|
pub struct ModifyMember4DeletedAt {
|
|
///
|
|
pub deleted_at: Option<i64>,
|
|
}
|
|
|
|
///
|
|
#[derive(Debug, Clone)]
|
|
pub struct FindAllSearch {
|
|
///
|
|
pub site_id: Option<uuid::Uuid>,
|
|
///
|
|
pub member_class_id: Option<uuid::Uuid>,
|
|
///
|
|
pub member_level_id: Option<uuid::Uuid>,
|
|
///
|
|
pub parent_member_id: Option<uuid::Uuid>,
|
|
///
|
|
pub username_like: Option<String>,
|
|
///
|
|
pub nickname_like: Option<String>,
|
|
///
|
|
pub mobile_phone_number_like: Option<String>,
|
|
///
|
|
pub last_signined_ip: Option<String>,
|
|
///
|
|
pub state: Option<MemberState>,
|
|
///
|
|
pub deleted_at: Option<bool>,
|
|
}
|
|
|
|
///
|
|
#[derive(Debug, Clone)]
|
|
pub struct FindAll {
|
|
///
|
|
pub search: Option<FindAllSearch>,
|
|
///
|
|
pub pagination: Option<bcr::models::pagination::Pagination>,
|
|
///
|
|
pub sorts: Option<Vec<bcr::models::pagination::Sort>>,
|
|
}
|