pub fn create_user_connect(
        &self,
        user_id: ID,
        device_id: &str,
        provider_name: &str,
        app_id: &str,
        latest_loc: &str,
        latest_loc_full: &str,
    ) -> Result<()> {
        use crate::schema::user_connect::dsl;

        let user_connect = NewUserConnect {
            user_id,
            device_id,
            provider_name,
            app_id,
            latest_loc,
            latest_loc_full,
            latest_loc_long: 0.0,
            latest_loc_lat: 0.0,
        };

        diesel::insert_into(user_connect::table)
            .values(&user_connect)
            .on_conflict(dsl::device_id)
            .do_update()
            .set(&user_connect)
            .execute(self.db)?;

        Ok(())
    }
/// Create user connect app id untuk spesifik user,
/// digunakan untuk event push notif.
Create user connect app id untuk spesifik user,
digunakan untuk event push notif.
Create user connect app id untuk spesifik user digunakan untuk event push notif .
pub fn create_user_connect(
        &self,
        user_id: ID,
        device_id: &str,
        provider_name: &str,
        app_id: &str,
        latest_loc: &str,
        latest_loc_full: &str,
    ) -> Result<()> {
        use crate::schema::user_connect::dsl;
        let user_connect = NewUserConnect {
            user_id,
            device_id,
            provider_name,
            app_id,
            latest_loc,
            latest_loc_full,
            latest_loc_long: 0.0,
            latest_loc_lat: 0.0,
        };
        diesel::insert_into(user_connect::table)
            .values(&user_connect)
            .on_conflict(dsl::device_id)
            .do_update()
            .set(&user_connect)
            .execute(self.db)?;
        Ok(())
    }
pub fn create_user_connect ( & self , user_id : ID , device_id : & str , provider_name : & str , app_id : & str , latest_loc : & str , latest_loc_full : & str , ) -> Result < ( ) > { use crate :: schema :: user_connect :: dsl ; let user_connect = NewUserConnect { user_id , device_id , provider_name , app_id , latest_loc , latest_loc_full , latest_loc_long : 0.0 , latest_loc_lat : 0.0 , } ; diesel :: insert_into ( user_connect :: table ) . values ( & user_connect ) . on_conflict ( dsl :: device_id ) . do_update ( ) . set ( & user_connect ) . execute ( self . db ) ? ; Ok ( ( ) ) }
Create user connect app id untuk spesifik user,
digunakan untuk event push notif.
Create user connect app id untuk spesifik user digunakan untuk event push notif .
&self
user_id
ID
device_id
&str
provider_name
&str
app_id
&str
latest_loc
&str
latest_loc_full
&str
&self
user_id
ID
device_id
&str
provider_name
&str
app_id
&str
latest_loc
&str
latest_loc_full
&str