forked from melod1n/fast-messenger
some improvements
This commit is contained in:
+11
-3
@@ -3,6 +3,8 @@ package com.meloda.app.fast.network.service.account
|
||||
import com.meloda.app.fast.network.ApiResponse
|
||||
import com.meloda.app.fast.network.RestApiError
|
||||
import com.slack.eithernet.ApiResult
|
||||
import retrofit2.http.FieldMap
|
||||
import retrofit2.http.FormUrlEncoded
|
||||
import retrofit2.http.GET
|
||||
import retrofit2.http.POST
|
||||
import retrofit2.http.QueryMap
|
||||
@@ -12,10 +14,16 @@ interface AccountService {
|
||||
@GET(AccountUrls.SET_ONLINE)
|
||||
suspend fun setOnline(
|
||||
@QueryMap params: Map<String, String>
|
||||
): ApiResult<ApiResponse<Any>, RestApiError>
|
||||
): ApiResult<ApiResponse<Int>, RestApiError>
|
||||
|
||||
@POST(AccountUrls.SET_OFFLINE)
|
||||
@GET(AccountUrls.SET_OFFLINE)
|
||||
suspend fun setOffline(
|
||||
@QueryMap params: Map<String, String>
|
||||
): ApiResult<ApiResponse<Any>, RestApiError>
|
||||
): ApiResult<ApiResponse<Int>, RestApiError>
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(AccountUrls.REGISTER_DEVICE)
|
||||
suspend fun registerDevice(
|
||||
@FieldMap params: Map<String, String>
|
||||
): ApiResult<ApiResponse<Int>, RestApiError>
|
||||
}
|
||||
|
||||
+5
-2
@@ -3,6 +3,9 @@ package com.meloda.app.fast.network.service.account
|
||||
import com.meloda.app.fast.common.AppConstants
|
||||
|
||||
object AccountUrls {
|
||||
const val SET_ONLINE = "${AppConstants.URL_API}/account.setOnline"
|
||||
const val SET_OFFLINE = "${AppConstants.URL_API}/account.setOffline"
|
||||
private const val URL = AppConstants.URL_API
|
||||
|
||||
const val SET_ONLINE = "$URL/account.setOnline"
|
||||
const val SET_OFFLINE = "$URL/account.setOffline"
|
||||
const val REGISTER_DEVICE = "$URL/account.registerDevice"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user