- 필수과제
- 로그인 페이지 만들기 (SignInActivity)
- 회원가입 페이지 만들기 (SignUpActivity)
- 자기소개 페이지 만들기 (HomeActivity)
- 필수과제
-
HomeActivity 하단에 FollowerRecyclerView, RepositoryRecyclerView 만들기
- 로그인, 회원가입 서버 통신 구현
- POSTMAN테스트
- signIn Test
- signUp Test
- retrofit Interface
interface SoptService {
@POST("/auth/signin")
fun postLogin(
@Body body: RequestSignIn
): Call<ResponseSignIn>
@POST("/auth/signup")
fun postSignUp(
@Body body: RequestSignUp
): Call<ResponseSignUp>
}
- 구현체
object ServiceCreator {
private const val BASE_URL = "http://13.124.62.236"
private val retrofit: Retrofit = Retrofit.Builder()
.baseUrl(BASE_URL)
.addConverterFactory(GsonConverterFactory.create())
.build()
val soptService: SoptService = retrofit.create(SoptService::class.java)
}
- Request/Response객체에 대한 코드
- RequestSignUp
data class RequestSignUp(
@SerializedName("name")
val name: String,
val email: String,
val password: String
)
- ResponseSignUp
data class ResponseSignUp(
val status: Int,
val message: String,
val data: Data
) {
data class Data(
val id: String
)
}