-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIN-44] feat: 초기 유저 정보 , 코드 POST 구현(#20)
- Loading branch information
Showing
36 changed files
with
615 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
app/src/main/java/com/najudoryeong/mineme/MineMeApplication.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
package com.najudoryeong.mineme | ||
|
||
import android.app.Application | ||
import android.util.Log | ||
import com.example.common.util.NATIVE_APP_KEY | ||
import com.kakao.sdk.common.KakaoSdk | ||
import com.kakao.sdk.common.util.Utility | ||
import dagger.hilt.android.HiltAndroidApp | ||
|
||
@HiltAndroidApp | ||
class MineMeApplication : Application() { | ||
override fun onCreate() { | ||
super.onCreate() | ||
KakaoSdk.init(this, NATIVE_APP_KEY) | ||
//printAppKeyHash() | ||
} | ||
|
||
private fun printAppKeyHash() { | ||
val keyHash = Utility.getKeyHash(this) | ||
Log.d("KeyHash", keyHash) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
common-ui/src/main/java/com/najudoryeong/mineme/common_ui/DialogForPermission.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package com.najudoryeong.mineme.common_ui | ||
|
||
import android.app.Dialog | ||
import android.content.Context | ||
import android.graphics.Color | ||
import android.graphics.drawable.ColorDrawable | ||
import android.os.Bundle | ||
import com.najudoryeong.mineme.common_ui.databinding.DialogForPermissionBinding | ||
|
||
class DialogForPermission( | ||
context: Context, | ||
private val message: String, | ||
private val imgId: Int, | ||
private val onClickButton: () -> Unit | ||
) : Dialog(context){ | ||
|
||
private lateinit var binding: DialogForPermissionBinding | ||
|
||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
binding = DialogForPermissionBinding.inflate(layoutInflater).apply { | ||
dialogTv.text = message | ||
dialogIv.setImageResource(imgId) | ||
dialogButton.setOnClickListener { | ||
onClickButton.invoke() | ||
dismiss() | ||
} | ||
} | ||
setContentView(binding.root) | ||
|
||
window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT)) | ||
} | ||
|
||
class Builder(private val context: Context) { | ||
private var message = "" | ||
private var imgId = 0 | ||
private var onClickButton = {} | ||
|
||
fun setMessage(message: String) = apply { | ||
this.message = message | ||
} | ||
|
||
fun setImg(imgId: Int) = apply { | ||
this.imgId = imgId | ||
} | ||
|
||
fun setOnClickButton(onClickButton: () -> Unit) = apply { | ||
this.onClickButton = onClickButton | ||
} | ||
|
||
fun build() = DialogForPermission( | ||
context, | ||
message, | ||
imgId, | ||
onClickButton | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools"> | ||
|
||
<FrameLayout | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content"> | ||
|
||
<androidx.cardview.widget.CardView | ||
android:layout_width="300dp" | ||
android:layout_height="240dp" | ||
android:layout_margin="8dp" | ||
app:cardCornerRadius="@dimen/dialog_radius"> | ||
|
||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:padding="26dp"> | ||
|
||
<ImageView | ||
android:id="@+id/dialog_iv" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<TextView | ||
android:id="@+id/dialog_tv" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="17dp" | ||
android:gravity="center" | ||
android:lineSpacingExtra="@dimen/basic_spacingExtra" | ||
android:text="위치 권한 요청합니다" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@id/dialog_iv" /> | ||
|
||
<com.google.android.material.button.MaterialButton | ||
android:id="@+id/dialog_button" | ||
android:layout_width="match_parent" | ||
android:layout_height="50dp" | ||
android:layout_marginTop="17dp" | ||
android:text="@string/confirm" | ||
android:textSize="@dimen/basic_btn_textSize" | ||
app:layout_constraintTop_toBottomOf="@id/dialog_tv" /> | ||
|
||
<TextView | ||
android:id="@+id/dialog_info_tv" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:gravity="center" | ||
android:text="확인을 누르시면 동의 및 다음 단계로 넘어갑니다." | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintTop_toBottomOf="@id/dialog_button" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
|
||
</androidx.cardview.widget.CardView> | ||
|
||
</FrameLayout> | ||
</layout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<string name="hello_blank_fragment">Hello blank fragment</string> | ||
<string name="app_name">mineme</string> | ||
<string name="next">다음</string> | ||
<string name="confirm">확인</string> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
<uses-permission android:name="android.permission.INTERNET" /> | ||
|
||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> | ||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> | ||
<uses-permission android:name="android.permission.CAMERA" /> | ||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" /> | ||
|
||
</manifest> |
5 changes: 5 additions & 0 deletions
5
common/src/main/java/com/example/common/data/dto/CodeRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.example.common.data.dto | ||
|
||
data class CodeRequest( | ||
val code : String | ||
) |
6 changes: 6 additions & 0 deletions
6
common/src/main/java/com/example/common/data/dto/NullResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.example.common.data.dto | ||
|
||
data class NullResponse( | ||
val success: Boolean, | ||
val data: String? | ||
) |
6 changes: 6 additions & 0 deletions
6
common/src/main/java/com/example/common/data/dto/UserInfoRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.example.common.data.dto | ||
|
||
data class UserInfoRequest( | ||
val nickname: String, | ||
val birthday: String | ||
) |
5 changes: 5 additions & 0 deletions
5
common/src/main/java/com/example/common/data/entity/ProviderName.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.example.common.data.entity | ||
|
||
enum class ProviderType(providerType: String) { | ||
KAKAO("KAKAO") | ||
} |
25 changes: 25 additions & 0 deletions
25
common/src/main/java/com/example/common/data/source/UserService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.example.common.data.source | ||
|
||
import com.example.common.data.dto.CodeRequest | ||
import com.example.common.data.dto.UserInfoRequest | ||
import com.example.common.data.dto.NullResponse | ||
import retrofit2.http.Body | ||
import retrofit2.http.Header | ||
import retrofit2.http.POST | ||
|
||
interface UserService { | ||
|
||
@POST("api/v1/user/info") | ||
suspend fun postUserInfo( | ||
@Header("Authorization") token : String, | ||
@Body userInfoRequest: UserInfoRequest | ||
) : NullResponse | ||
|
||
|
||
@POST("api/v1/user/code") | ||
suspend fun postTargetCode( | ||
@Header("Authorization") token : String, | ||
@Body userCodeRequest: CodeRequest | ||
) : NullResponse | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.