Skip to content

Commit

Permalink
[REFACTOR] : tag api 상수화 / #55
Browse files Browse the repository at this point in the history
  • Loading branch information
sohyun127 committed Oct 31, 2023
1 parent 3b1447a commit b79899a
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions data-remote/src/main/java/com/data_remote/api/TagApiService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,36 @@ import retrofit2.http.POST
import retrofit2.http.Query

interface TagApiService {
@GET("/tag/gettag")

companion object {
const val TAG = "tag"
const val GET_TAG = "gettag"
const val POPULAR_POST = "popularpost"
const val DELETE_TAG = "deletetag"
const val ADD_TAG = "addtag"
const val GET_TAG_POST = "gettagpost"
}

@GET("/$TAG/$GET_TAG")
suspend fun getTag(
):List<String>
): List<String>

@GET("/tag/popularpost")
@GET("/$TAG/$POPULAR_POST")
suspend fun getPopularTag(
):List<String>
): List<String>

@DELETE("/tag/deletetag")
@DELETE("/$TAG/$DELETE_TAG")
suspend fun deleteTag(
@Query("tag") tag:String
):String
@Query(TAG) tag: String
): String

@POST("/tag/addtag")
@POST("/$TAG/$ADD_TAG")
suspend fun addTag(
@Query("tag") tag:String
):String
@Query(TAG) tag: String
): String

@GET("/tag/gettagpost")
@GET("/$TAG/$GET_TAG_POST")
suspend fun getTagPost(
@Query("tag") tag:String
@Query(TAG) tag: String
): List<TrendPostDto>

}

0 comments on commit b79899a

Please sign in to comment.