1
0
mirror of https://github.com/KokaKiwi/BarInsta synced 2025-07-02 01:12:03 +00:00
BarInsta/app/src/main/java/awais/instagrabber/repositories/UserService.kt
Ammar Githam 29d2b894d8 Interchange UserService and UserRepository names. Check description.
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.
2021-06-09 08:40:13 +09:00

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
}