Skip to content

Commit

Permalink
[#139] del : 불필요한 import 제거 및 warning 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
serioushyeon committed Oct 17, 2024
1 parent bbafa7e commit d768b9f
Showing 1 changed file with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import androidx.lifecycle.ViewModel
import androidx.navigation.fragment.findNavController
import com.project.balpyo.MainActivity
import com.project.balpyo.R
import com.project.balpyo.Sign.SignUpCompleteFragment
import com.project.balpyo.Sign.SignUpTermsFragment
import com.project.balpyo.Utils.MyApplication
import com.project.balpyo.Utils.PreferenceHelper
import com.project.balpyo.api.ApiClient
Expand All @@ -18,7 +16,6 @@ import com.project.balpyo.api.request.SignInRequest
import com.project.balpyo.api.request.SignUpRequest
import com.project.balpyo.api.response.BaseResponse
import com.project.balpyo.api.response.SignInResponse
import com.project.balpyo.api.response.StorageListResult
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
Expand All @@ -33,7 +30,7 @@ class SignViewModel: ViewModel() {
override fun onResponse(call: Call<BaseResponse>, response: Response<BaseResponse>) {
if (response.isSuccessful) {
// 정상적으로 통신이 성공된 경우
var result: BaseResponse? = response.body()
val result: BaseResponse? = response.body()
Log.d("##", "onResponse 성공: " + result?.toString())
fragment.findNavController().navigate(R.id.signUpCertificationFragment)
} else {
Expand All @@ -55,15 +52,15 @@ class SignViewModel: ViewModel() {
}

fun signIn(fragment: Fragment, mainActivity: MainActivity) {
var apiClient = ApiClient(mainActivity)
var tokenManager = TokenManager(mainActivity)
val apiClient = ApiClient(mainActivity)
val tokenManager = TokenManager(mainActivity)

apiClient.apiService.signIn(SignInRequest(MyApplication.email,MyApplication.password))?.enqueue(object :
Callback<SignInResponse> {
override fun onResponse(call: Call<SignInResponse>, response: Response<SignInResponse>) {
if (response.isSuccessful) {
// 정상적으로 통신이 성공된 경우
var result: SignInResponse? = response.body()
val result: SignInResponse? = response.body()
tokenManager.saveToken("${result?.token}")
Log.d("##", "onResponse 성공: " + result?.toString())
signInResponse.value = result!!
Expand Down Expand Up @@ -93,15 +90,15 @@ class SignViewModel: ViewModel() {
})
}
fun signInForNavigate(fragment: Fragment, mainActivity: MainActivity) {
var apiClient = ApiClient(mainActivity)
var tokenManager = TokenManager(mainActivity)
val apiClient = ApiClient(mainActivity)
val tokenManager = TokenManager(mainActivity)

apiClient.apiService.signIn(SignInRequest(MyApplication.email,MyApplication.password))?.enqueue(object :
Callback<SignInResponse> {
override fun onResponse(call: Call<SignInResponse>, response: Response<SignInResponse>) {
if (response.isSuccessful) {
// 정상적으로 통신이 성공된 경우
var result: SignInResponse? = response.body()
val result: SignInResponse? = response.body()
tokenManager.saveToken("${result?.token}")
Log.d("##", "onResponse 성공: " + result?.toString())
signInResponse.value = result!!
Expand Down

0 comments on commit d768b9f

Please sign in to comment.