Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.eatssu.android.data.remote.dto.response

import com.eatssu.common.enums.Provider
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class MyPageResponse(
@SerialName("nickname") val nickname: String? = null,
@SerialName("provider") val provider: Provider? = null,
@SerialName("departmentId") val departmentId: Long? = null,
@SerialName("departmentName") val departmentName: String? = null,
@SerialName("collegeId") val collegeId: Long? = null,
@SerialName("collegeName") val collegeName: String? = null,
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.eatssu.android.data.remote.dto.request.ChangeNicknameRequest
import com.eatssu.android.data.remote.dto.request.UserDepartmentRequest
import com.eatssu.android.data.remote.dto.response.CollegeResponse
import com.eatssu.android.data.remote.dto.response.DepartmentResponse
import com.eatssu.android.data.remote.dto.response.MyNickNameResponse
import com.eatssu.android.data.remote.dto.response.MyPageResponse
import com.eatssu.android.data.remote.dto.response.PartnershipResponse
import com.eatssu.android.data.remote.dto.response.UserCollegeDepartmentResponse
import retrofit2.http.Body
Expand All @@ -28,7 +28,7 @@ interface UserService {
): ApiResult<Boolean>

@GET("users/mypage") //내 정보 모아보기
suspend fun getMyInfo(): ApiResult<MyNickNameResponse>
suspend fun getMyInfo(): ApiResult<MyPageResponse>

@DELETE("users") //유저 탈퇴
suspend fun signOut(): ApiResult<Boolean>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/com/eatssu/android/di/NetworkModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ object NetworkModule {
@Singleton
@Provides
fun provideJson(): Json = Json {
ignoreUnknownKeys = true
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To further improve parsing robustness, consider also setting coerceInputValues = true. This will prevent crashes if the API sends null for a non-nullable field by coercing it to a default value (e.g., 0 for Int, "" for String). This aligns well with the goal of making the client more resilient to API changes.

        ignoreUnknownKeys = true
        coerceInputValues = true

}

// 토큰이 필요한 okhttpClient
Expand Down