/// Create a User from a database user and database student
Create a User from a database user and database student
Create a User from a database user and database student
pub fn from_db(u: db_models::users::User, s: db_models::users::Student) -> Self {
        Self {
            uid: u.uid,
            wechat_id: u.wechat_id,
            phone: u.phone,
            personal_info: u.personal_info,
            email: u.email,
            username: u.username,
            verified: u.verified,
            tokens: u.tokens,
            school_id: s.school_id,
            student_id: s.student_id,
            credit: s.credit,
            accepted: s.accepted,
            finished: s.finished,
            major: s.major,
            year: s.year,
        }
    }
pub fn from_db ( u : db_models :: users :: User , s : db_models :: users :: Student ) -> Self { Self { uid : u . uid , wechat_id : u . wechat_id , phone : u . phone , personal_info : u . personal_info , email : u . email , username : u . username , verified : u . verified , tokens : u . tokens , school_id : s . school_id , student_id : s . student_id , credit : s . credit , accepted : s . accepted , finished : s . finished , major : s . major , year : s . year , } }
Create a User from a database user and database student
Create a User from a database user and database student
u
db_models::users::User
s
db_models::users::Student