Woka support scrolling issue resolved

Completed UserProfileActivity.kt with api integration

Completed whole flow of add child from guardian app with all api integration of child registration

Deactivate account api integration. Flow changes in user log in
This commit is contained in:
2024-06-06 20:50:41 +05:30
parent 84a8f11f5a
commit 8cf0ee1c28
38 changed files with 989 additions and 169 deletions

View File

@@ -0,0 +1,24 @@
package com.woka.userdata
import com.woka.userdata.userDataModels.UserDataResponse
import com.woka.networking.ApiResponse
import okhttp3.FormBody
import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
interface UserApiService {
@GET("get_user_data")
suspend fun getUserData(): Response<ApiResponse<UserDataResponse>>
@GET("user_logout")
suspend fun logout(): Response<ApiResponse<Any>>
@POST("update_profile")
suspend fun updateProfile(@Body formBody: FormBody): Response<ApiResponse<Any>>
@GET("user_deactivate_account")
suspend fun deActivateAccount(): Response<ApiResponse<Any>>
}

View File

@@ -0,0 +1,42 @@
package com.woka.userdata
import com.woka.userdata.userDataModels.UserDataResponse
import com.woka.networking.ApiResult
import com.woka.networking.RetrofitHelper
import com.woka.networking.RetrofitHelper.handleApiCall
import okhttp3.FormBody
object UserRepository {
private val userApiService = RetrofitHelper.getRetrofit().create(UserApiService::class.java)
suspend fun getUserData(): ApiResult<UserDataResponse>{
return handleApiCall{
userApiService.getUserData()
}
}
suspend fun logout(): ApiResult<Any>{
return handleApiCall {
userApiService.logout()
}
}
suspend fun updateProfile(name: String, email: String, gender: String): ApiResult<Any>{
return handleApiCall {
userApiService.updateProfile(
FormBody.Builder()
.add("fullname", name)
.add("email", email)
.add("gender", gender)
.build()
)
}
}
suspend fun deActivateAccount(): ApiResult<Any>{
return handleApiCall {
userApiService.deActivateAccount()
}
}
}

View File

@@ -0,0 +1,8 @@
package com.woka.userdata.userDataModels
data class ChildDetail(
val avatar_name: String?,
val id: Int?,
val interest_topic: List<InterestTopic?>?,
val user_id: Int?
)

View File

@@ -0,0 +1,6 @@
package com.woka.userdata.userDataModels
data class Gender(
val gender_name: String?,
val id: Int?
)

View File

@@ -0,0 +1,6 @@
package com.woka.userdata.userDataModels
data class InterestTopic(
val id: Int?,
val topic_name: String?
)

View File

@@ -0,0 +1,6 @@
package com.woka.userdata.userDataModels
data class Language(
val id: Int?,
val language_name: String?
)

View File

@@ -0,0 +1,20 @@
package com.woka.userdata.userDataModels
data class UserData(
val already_logged_in: Boolean,
val is_deactive: Boolean,
val avtar: String?,
val birthdate: String?,
val child_detail: ChildDetail?,
val email: String?,
val fullname: String?,
// val gender: Gender?,
val id: Int?,
val is_active: String?,
val language: Language?,
val language_master_id: Int?,
val last_login: String?,
val remember_token: String?,
val user_type: Int?,
val username: String?
)

View File

@@ -0,0 +1,7 @@
package com.woka.userdata.userDataModels
data class UserDataResponse(
val result: UserData?,
// val userNotificationData: UserNotificationData?,
val userNotificationsCount: Int?
)

View File

@@ -0,0 +1,15 @@
package com.woka.userdata.userDataModels
data class UserNotificationData(
val created_at: String?,
val description: String?,
val image_url: String?,
val is_home_notification_read: Int?,
val is_read: Int?,
val is_specific_time_notification: Int?,
val link: Any?,
val post_type: Int?,
val title: String?,
val type: String?,
val user_id: Int?
)