Skip to content

Commit

Permalink
[NETWORK] #18 - Add Network Logic
Browse files Browse the repository at this point in the history
  • Loading branch information
mdb1217 committed May 21, 2022
1 parent dc0537f commit fc00902
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
package org.sopt.sopkathon5.andorid.data

import org.sopt.sopkathon5.andorid.data.service.MyPageService
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory

object ServiceCreator {
private const val BASE_URL = "https://asia-northeast3-we-sopt-29.cloudfunctions.net/api/"
private const val BASE_URL = "54.180.144.204:5001/"

private val retrofit: Retrofit = Retrofit
.Builder()
.baseUrl(BASE_URL)
.addConverterFactory(GsonConverterFactory.create())
.build()

val myPageService = retrofit.create(MyPageService::class.java)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package org.sopt.sopkathon5.andorid.data.model.request

data class RequestMissionCheck(
val _id: String,
val userId: Int,
val dailyId: String,
val completeMissions: List<String>
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.sopt.sopkathon5.andorid.data.model.response

data class ResponseStoreDaily(
val status: Int,
val success: Boolean,
val message: String,
val data: List<Data>
) {
data class Data(
val _id: String,
val userId: Int,
val userName: String,
val dailyId: String,
val completeMissions: List<List<String>>,
val __v: Int
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.sopt.sopkathon5.andorid.data.service

import org.sopt.sopkathon5.andorid.data.model.response.ResponseStoreDaily
import retrofit2.Call
import retrofit2.http.GET

interface MyPageService {
@GET("daily/1")
fun getStoredDaily(): Call<ResponseStoreDaily>
}

0 comments on commit fc00902

Please sign in to comment.