Skip to content

Commit

Permalink
rename/#9: 함수명 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
youjin09222 committed May 10, 2024
1 parent 9e8fb05 commit d50abcc
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 11 deletions.
4 changes: 2 additions & 2 deletions app/src/main/java/com/sopt/now/test/data/AuthService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import retrofit2.http.POST

interface AuthService {
@POST("member/join")
fun signUp(
fun postSignUp(
@Body request: RequestSignUpDto,
): Call<ResponseAuthDto>

@POST("member/login")
fun login(
fun postLogin(
@Body request: RequestLoginDto,
): Call<ResponseAuthDto>
}
2 changes: 1 addition & 1 deletion app/src/main/java/com/sopt/now/test/data/FriendService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import retrofit2.http.Query

interface FriendService {
@GET("users")
fun friendInfo(
fun getFriendInfo(
@Query("page") page: Int,
): Call<ResponseFriendDto>
}
2 changes: 1 addition & 1 deletion app/src/main/java/com/sopt/now/test/data/UserService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ import retrofit2.http.GET

interface UserService {
@GET("member/info")
fun userInfo(
fun getUserInfo(
): Call<ResponseUserInfoDto>
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class HomeViewModel() : ViewModel() {
val friendInfoLiveData = MutableLiveData<ResponseFriendDto?>()

fun getFriendInfo(page: Int) {
friendService.friendInfo(page).enqueue(object : Callback<ResponseFriendDto> {
friendService.getFriendInfo(page).enqueue(object : Callback<ResponseFriendDto> {
override fun onResponse(
call: Call<ResponseFriendDto>,
response: Response<ResponseFriendDto>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import android.widget.Toast
import androidx.activity.viewModels
import androidx.appcompat.app.AppCompatActivity
import com.sopt.now.databinding.ActivityLoginBinding
import com.sopt.now.test.data.ApiFactory
import com.sopt.now.test.data.UserPreference
import com.sopt.now.test.data.dto.request.RequestLoginDto

class LoginActivity : AppCompatActivity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class LoginViewModel : ViewModel() {
private lateinit var userPreference: UserPreference

fun login(request: RequestLoginDto) {
authService.login(request).enqueue(object : Callback<ResponseAuthDto> {
authService.postLogin(request).enqueue(object : Callback<ResponseAuthDto> {
override fun onResponse(
call: Call<ResponseAuthDto>,
response: Response<ResponseAuthDto>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class SignUpViewModel : ViewModel() {
val liveData = MutableLiveData<BaseState>()

fun signUp(request: RequestSignUpDto) {
authService.signUp(request).enqueue(object : Callback<ResponseAuthDto> {
authService.postSignUp(request).enqueue(object : Callback<ResponseAuthDto> {
override fun onResponse(
call: Call<ResponseAuthDto>,
response: Response<ResponseAuthDto>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@ class UserInfoViewModel : ViewModel() {
}

fun userInfo() {
userService.userInfo().enqueue(object : Callback<ResponseUserInfoDto> {
userService.getUserInfo().enqueue(object : Callback<ResponseUserInfoDto> {
override fun onResponse(
call: Call<ResponseUserInfoDto>,
response: Response<ResponseUserInfoDto>,
) {
if (response.isSuccessful) {
val data: ResponseUserInfoDto? = response.body()
val userId = response.headers()["location"]
userInfoLiveData.value = data

liveData.value = BaseState(
Expand Down

0 comments on commit d50abcc

Please sign in to comment.