[android] backend: APIInterface should use relative paths
for cases where baseURL contains `/api`
This commit is contained in:
@@ -55,13 +55,13 @@ data class UploadAttachmentResponse(
|
||||
)
|
||||
|
||||
interface APIInterface {
|
||||
@GET("/version")
|
||||
@GET("version")
|
||||
suspend fun getVersion(): ResponseBody
|
||||
|
||||
@GET("/conversations")
|
||||
@GET("conversations")
|
||||
suspend fun getConversations(): Response<List<Conversation>>
|
||||
|
||||
@GET("/messages")
|
||||
@GET("messages")
|
||||
suspend fun getMessages(
|
||||
@Query("guid") conversationGUID: String,
|
||||
@Query("limit") limit: Int? = null,
|
||||
@@ -69,19 +69,19 @@ interface APIInterface {
|
||||
@Query("afterMessageGUID") afterMessageGUID: GUID? = null,
|
||||
): Response<List<Message>>
|
||||
|
||||
@POST("/sendMessage")
|
||||
@POST("sendMessage")
|
||||
suspend fun sendMessage(@Body request: SendMessageRequest): Response<SendMessageResponse>
|
||||
|
||||
@POST("/markConversation")
|
||||
@POST("markConversation")
|
||||
suspend fun markConversation(@Query("guid") conversationGUID: String): Response<Void>
|
||||
|
||||
@GET("/attachment")
|
||||
@GET("attachment")
|
||||
suspend fun fetchAttachment(@Query("guid") guid: String, @Query("preview") preview: Boolean = false): ResponseBody
|
||||
|
||||
@POST("/uploadAttachment")
|
||||
@POST("uploadAttachment")
|
||||
suspend fun uploadAttachment(@Query("filename") filename: String, @Body body: RequestBody): Response<UploadAttachmentResponse>
|
||||
|
||||
@POST("/authenticate")
|
||||
@POST("authenticate")
|
||||
suspend fun authenticate(@Body request: AuthenticationRequest): Response<AuthenticationResponse>
|
||||
}
|
||||
|
||||
@@ -93,4 +93,4 @@ fun <T> Response<T>.bodyOnSuccessOrThrow(): T {
|
||||
}
|
||||
|
||||
throw ResponseDecodeError(errorBody()!!)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user