Skip to content

Commit

Permalink
[REFACTOR] : subscribe api 상수화 / #55
Browse files Browse the repository at this point in the history
  • Loading branch information
sohyun127 committed Oct 31, 2023
1 parent 2f7f461 commit 479ed34
Showing 1 changed file with 23 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,44 @@ import retrofit2.http.Path
import retrofit2.http.Query

interface SubscribeApiService {

@GET("/subscribe/trendposts")
companion object {
const val SUBSCRIBE = "subscribe"
const val TREND_POSTS = "trendposts"
const val SUBSCRIBER_POSTS = "subscriberpost"
const val GET_SUBSCRIBER = "getsubscriber"
const val UNSUBSCRIBE = "unsubscribe"
const val TARGET_NAME = "targetName"
const val INPUT_NAME = "inputname"
const val NAME = "name"
const val ADD_SUBSCRIBER = "addsubscriber"
const val FCM_TOKEN = "fcmToken"
}

@GET("/$SUBSCRIBE/$TREND_POSTS")
suspend fun getTrendPost(
): PostListDto

@GET("/subscribe/subscriberpost")
@GET("/$SUBSCRIBE/$SUBSCRIBER_POSTS")
suspend fun getFollowPost(
): PostFollowListDto

@GET("/subscribe/getsubscriber")
@GET("/$SUBSCRIBE/$GET_SUBSCRIBER")
suspend fun getFollower(
): List<FollowerDto>

@DELETE("/subscribe/unsubscribe/{targetName}")
@DELETE("/$SUBSCRIBE/$UNSUBSCRIBE/{$TARGET_NAME}")
suspend fun deleteFollower(
@Path(value = "targetName") followerName: String
@Path(value = TARGET_NAME) followerName: String
): DeleteFollowerDto

@GET("/subscribe/inputname/{name}")
@GET("/$SUBSCRIBE/$INPUT_NAME/{$NAME}")
suspend fun getInputFollower(
@Path(value = "name") followerName: String?
@Path(value = NAME) followerName: String?
): InputFollowerDto

@POST("/subscribe/addsubscriber")
@POST("/$SUBSCRIBE/$ADD_SUBSCRIBER")
suspend fun postAddFollower(
@Query("fcmToken") token: String,
@Query("name") followerName: String
@Query(FCM_TOKEN) token: String,
@Query(NAME) followerName: String
): String
}

0 comments on commit 479ed34

Please sign in to comment.