diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 20e96e7..26633c0 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -15,7 +15,7 @@ android:usesCleartextTraffic="true"> - + @@ -26,7 +26,7 @@ - + diff --git a/app/src/main/java/com/example/myapplication/friend/APIS.kt b/app/src/main/java/com/example/myapplication/friend/APIS.kt deleted file mode 100644 index a94dc18..0000000 --- a/app/src/main/java/com/example/myapplication/friend/APIS.kt +++ /dev/null @@ -1,51 +0,0 @@ -package com.example.myapplication.friend - -import com.example.myapplication.RetrofitService -import com.google.gson.Gson -import com.google.gson.GsonBuilder -import com.google.gson.annotations.SerializedName -import retrofit2.Call -import retrofit2.Retrofit -import retrofit2.converter.gson.GsonConverterFactory -import retrofit2.http.* - - - -interface APIS : RetrofitService { - - // 친구 추가 기능 - @POST("follow/{memberId}") - fun post_users(@Path("memberId") memberId: Long): Call - - // 친구 삭제 기능 - @DELETE("follow/{memberId}") - fun delete_users(@Path("memberId") memberId: Long): Call - - - // 친구 검색 기능 (완료) - @GET("follow/search") - fun get_users(@Query("name") name: String): Call - - - // 친구 목록 조회 기능 (완료) - @GET("follow") - fun get2_users(): Call - - - - companion object { // static 처럼 공유객체로 사용가능함. 모든 인스턴스가 공유하는 객체로서 동작함. - private const val BASE_URL = "http://180.230.121.23/" // 주소 - - fun create(): APIS { - - - val gson :Gson = GsonBuilder().setLenient().create(); - - return Retrofit.Builder() - .baseUrl(BASE_URL) - .addConverterFactory(GsonConverterFactory.create(gson)) - .build() - .create(APIS::class.java) - } - } -} \ No newline at end of file diff --git a/app/src/main/java/com/example/myapplication/friend/DataModels.kt b/app/src/main/java/com/example/myapplication/friend/DataModels.kt deleted file mode 100644 index 6be112e..0000000 --- a/app/src/main/java/com/example/myapplication/friend/DataModels.kt +++ /dev/null @@ -1,43 +0,0 @@ -package com.example.myapplication.friend - - -import com.google.gson.annotations.SerializedName - -// 친구 삭제 -data class DeleteModel( - var code : Int, - var message: String -) - - -// 친구 검색 (완료) -data class GetModel( - var userId : Long, - var username: String, - var email: String -) -class CheckGetModel( - @SerializedName("userList") - val checkRoomList : List -) - -// 친구 목록 (완료) -data class GetModel2( - var userId : Long, - var username: String, - var achievementRate: Double, - var accumulatedTime: String, - var studyStatus: Boolean -) -class CheckGetModel2( - @SerializedName("followList") - val checkRoomList2 : List -) - - - -// 친구 요청 -data class PostModel( - var code : Int, - var message: String -) \ No newline at end of file diff --git a/app/src/main/java/com/example/myapplication/friend/Friend_add.kt b/app/src/main/java/com/example/myapplication/friend/Friend_add.kt deleted file mode 100644 index 39a1b41..0000000 --- a/app/src/main/java/com/example/myapplication/friend/Friend_add.kt +++ /dev/null @@ -1,210 +0,0 @@ -package com.example.myapplication - -import android.content.Intent -import android.os.Bundle -import android.util.Log -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.widget.* -import androidx.appcompat.app.AppCompatActivity -import androidx.recyclerview.widget.LinearLayoutManager -import androidx.recyclerview.widget.RecyclerView -import com.example.myapplication.friend.* -import com.example.myapplication.todo.Todo_main -import kotlinx.android.synthetic.main.friend_add.* -import kotlinx.android.synthetic.main.friend_add_list_item.view.* -import kotlinx.android.synthetic.main.friend_main.* -import retrofit2.Call -import retrofit2.Callback -import retrofit2.Response - - -class Friend_add : AppCompatActivity() { - val api = APIS.create() - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContentView(R.layout.friend_add) - - // 검색어를 입력할 Input 창 - val friend_search_input : EditText= findViewById(R.id.friend_search_input) - // 검색어 검색 버튼 - val friend_search_button : Button= findViewById