mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-16 18:37:02 +05:30
api: add getPostDetails method
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
a77e972b82
commit
e5ea28ea34
1 changed files with 5 additions and 0 deletions
|
@ -1,7 +1,9 @@
|
|||
package dev.msfjarvis.lobsters.data.api
|
||||
|
||||
import dev.msfjarvis.lobsters.model.LobstersPost
|
||||
import dev.msfjarvis.lobsters.model.LobstersPostDetails
|
||||
import retrofit2.http.GET
|
||||
import retrofit2.http.Path
|
||||
import retrofit2.http.Query
|
||||
|
||||
/** Simple interface defining an API for lobste.rs */
|
||||
|
@ -11,6 +13,9 @@ interface LobstersApi {
|
|||
|
||||
@GET("newest.json") suspend fun getNewestPosts(@Query("page") page: Int): List<LobstersPost>
|
||||
|
||||
@GET("s/{postId}.json")
|
||||
suspend fun getPostDetails(@Path("postId") postId: String): LobstersPostDetails
|
||||
|
||||
companion object {
|
||||
const val BASE_URL = "https://lobste.rs"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue