package com.example.smart119.interfaces

import retrofit2.Call
import retrofit2.http.GET
import retrofit2.http.POST
import com.google.gson.JsonObject
import retrofit2.http.Body

interface apiLocation {
    @POST("/selectSidoList.do")
    fun getSidoList() : Call<JsonObject>

    @POST("/selectSiGunGuList.do")
    fun getSiGunGuList(
        @Body requestBody: JsonObject
    ) : Call<JsonObject>

    //body
    //SIDO_CODE
    //SI_GUN_GU_CODE
    @POST("/selectEubMyeonDongList.do")
    fun getEubMyeonDongList(
        @Body requestBody: JsonObject
    ) : Call<JsonObject>

    @POST("/radiusSearchHospital2.do")
    fun getAroundHospitalList(
        @Body requestBody: JsonObject
    ) : Call<JsonObject>

    @POST("/searchHospital.do")
    fun getAddressHospitalList(
        @Body requestBody: JsonObject
    ) : Call<JsonObject>


    /*
    //유연하게 사용할 때 아래와 같이 사용
    @GET("path/to/endpoint")

    //param 날리는 방식 1
    fun getSiGunGuList(
        @QueryMap options: Map<String, String>
    ): Call<JsonObject>


    //param 날리는 방식 2
    fun getSiGunGuList(
        @Query("SIDO_CODE") param1: String
    ) : Call<JsonObject>

    val params = mapOf(
        "key1" to "value1",
        "key2" to "123"
    )
    RetrofitClient.apiService.getSiGunGuList(params).enqueue(/* Callback */)
    */
}