/// Get the user and student for database storage
Get the user and student for database storage
Get the user and student for database storage
pub fn to_db(&self) -> (db_models::users::User, db_models::users::Student) {
        (
            db_models::users::User {
                uid: self.uid,
                wechat_id: self.wechat_id.clone(),
                phone: self.phone.clone(),
                personal_info: self.personal_info.clone(),
                email: self.email.clone(),
                username: self.username.clone(),
                verified: self.verified,
                tokens: self.tokens,
                user_type: 1,
            },
            db_models::users::Student {
                uid: self.uid,
                school_id: self.school_id,
                student_id: self.student_id.clone(),
                credit: self.credit,
                accepted: self.accepted,
                finished: self.finished,
                major: self.major.clone(),
                year: self.year,
            },
        )
    }
pub fn to_db ( & self ) -> ( db_models :: users :: User , db_models :: users :: Student ) { ( db_models :: users :: User { uid : self . uid , wechat_id : self . wechat_id . clone ( ) , phone : self . phone . clone ( ) , personal_info : self . personal_info . clone ( ) , email : self . email . clone ( ) , username : self . username . clone ( ) , verified : self . verified , tokens : self . tokens , user_type : 1 , } , db_models :: users :: Student { uid : self . uid , school_id : self . school_id , student_id : self . student_id . clone ( ) , credit : self . credit , accepted : self . accepted , finished : self . finished , major : self . major . clone ( ) , year : self . year , } , ) }
Get the user and student for database storage
Get the user and student for database storage
&self