mirror of
https://github.com/KokaKiwi/BarInsta
synced 2025-07-02 01:12:03 +00:00
As per the sample provided at https://github.com/android/architecture-components-samples/tree/main/GithubBrowserSample, the Retrofit interfaces should be named Services and the classes using the services are Repositories. Once all are properly named, we can move the db repositories inside the repositories package.
25 lines
877 B
Kotlin
25 lines
877 B
Kotlin
package awais.instagrabber.repositories
|
|
|
|
import awais.instagrabber.repositories.responses.FriendshipStatus
|
|
import awais.instagrabber.repositories.responses.UserSearchResponse
|
|
import awais.instagrabber.repositories.responses.WrappedUser
|
|
import retrofit2.http.GET
|
|
import retrofit2.http.Path
|
|
import retrofit2.http.Query
|
|
|
|
interface UserService {
|
|
@GET("/api/v1/users/{uid}/info/")
|
|
suspend fun getUserInfo(@Path("uid") uid: Long): WrappedUser
|
|
|
|
@GET("/api/v1/users/{username}/usernameinfo/")
|
|
suspend fun getUsernameInfo(@Path("username") username: String): WrappedUser
|
|
|
|
@GET("/api/v1/friendships/show/{uid}/")
|
|
suspend fun getUserFriendship(@Path("uid") uid: Long): FriendshipStatus
|
|
|
|
@GET("/api/v1/users/search/")
|
|
suspend fun search(
|
|
@Query("timezone_offset") timezoneOffset: Float,
|
|
@Query("q") query: String,
|
|
): UserSearchResponse
|
|
} |