Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/week compose 06 #12

Open
wants to merge 12 commits into
base: develop-compose
Choose a base branch
from
3 changes: 3 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,7 @@ dependencies {
// define any required OkHttp artifacts without version
implementation("com.squareup.okhttp3:okhttp")
implementation("com.squareup.okhttp3:logging-interceptor")

implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9")
implementation 'com.google.android.gms:play-services-location:21.2.0'
}
15 changes: 9 additions & 6 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,25 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.NOWSOPTAndroid"
tools:targetApi="31"
android:usesCleartextTraffic="true"
>
tools:targetApi="31">
<uses-library
android:name="org.apache.http.legacy"
android:required="false" />

Comment on lines +17 to +20
Copy link
Member

Choose a reason for hiding this comment

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

이건 μ–΄λ–€κ±°μ£ ??

<activity
android:name=".SignUpActivity"
android:name=".presentation.SignUp.SignUpActivity"
android:exported="false"
android:label="@string/title_activity_sign_up"
android:theme="@style/Theme.NOWSOPTAndroid" />
<activity
android:name=".MainActivity"
android:name=".presentation.MainActivity"
android:exported="false"
android:label="@string/title_activity_login"
android:label="@string/title_activity_main"
android:theme="@style/Theme.NOWSOPTAndroid" />

<activity
android:name=".LoginActivity"
android:name=".presentation.Login.LoginActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.NOWSOPTAndroid">
Expand Down
13 changes: 0 additions & 13 deletions app/src/main/java/com/sopt/now/compose/Constants/Constant.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.sopt.now.compose.Friend
import com.sopt.now.compose.presentation.Home.Friend
import com.sopt.now.compose.R


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.res.colorResource
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.sopt.now.compose.Friend
import com.sopt.now.compose.presentation.Home.Friend
import com.sopt.now.compose.R


Expand Down
Empty file.
188 changes: 0 additions & 188 deletions app/src/main/java/com/sopt/now/compose/SignUpActivity.kt

This file was deleted.

29 changes: 0 additions & 29 deletions app/src/main/java/com/sopt/now/compose/api/AuthService.kt

This file was deleted.

33 changes: 33 additions & 0 deletions app/src/main/java/com/sopt/now/compose/data/AuthRepoImpl.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.sopt.now.compose.data

import com.sopt.now.compose.data.api.AuthService
import com.sopt.now.compose.data.dto.LoginDto.RequestLogInDto
import com.sopt.now.compose.data.dto.SignUpDto.RequestSignUpDto
import com.sopt.now.compose.domain.AuthRepository
import com.sopt.now.compose.domain.model.AuthEntity
import retrofit2.Response

class AuthRepoImpl(
private val authService: AuthService,
) : AuthRepository {
override suspend fun logIn(authEntity: AuthEntity): Result<Response<Unit>> = runCatching {
authService.logIn(
request = RequestLogInDto(
authenticationId = authEntity.id,
password = authEntity.pw
)
)
}

override suspend fun signUp(authEntity: AuthEntity): Result<Response<Unit>> = runCatching {
authService.signUp(
request = RequestSignUpDto(
authenticationId = authEntity.id,
password = authEntity.pw,
nickname = authEntity.name ?: "",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
nickname = authEntity.name ?: "",
nickname = authEntity.name.orEmpty(),

μΏ„ν‹€λ¦°μ˜ ν™•μž₯ν•¨μˆ˜λ„ μ‚¬μš© κ°€λŠ₯ν•΄μš”!

phone = authEntity.phone ?: ""

)
)
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sopt.now.compose.api
package com.sopt.now.compose.data.api

import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConverterFactory
import com.sopt.now.compose.BuildConfig
Expand All @@ -15,7 +15,6 @@ object ApiFactory {
.addConverterFactory(Json.asConverterFactory("application/json".toMediaType()))
.build()
}

inline fun <reified T> create(): T = retrofit.create(T::class.java)
}

Expand Down
30 changes: 30 additions & 0 deletions app/src/main/java/com/sopt/now/compose/data/api/AuthService.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.sopt.now.compose.data.api

import com.sopt.now.compose.data.dto.LoginDto.RequestLogInDto
import com.sopt.now.compose.data.dto.SignUpDto.RequestSignUpDto
import com.sopt.now.compose.data.dto.LoginDto.ResponseLogInDto
import com.sopt.now.compose.data.dto.SignUpDto.ResponseSignUpDto
import com.sopt.now.compose.data.dto.ResponseUserProfile
import retrofit2.Call
import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.Header
import retrofit2.http.POST

interface AuthService {
@POST("member/join")
suspend fun signUp(
@Body request: RequestSignUpDto,
): Response<Unit>

@POST("member/login")
suspend fun logIn(
@Body request: RequestLogInDto,
): Response<Unit>

@GET("member/info")
fun getUserInfo(
@Header("memberId") memberId : Int
): Call<ResponseUserProfile>
Copy link
Member

Choose a reason for hiding this comment

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

μ–˜λ„ Response둜 λ°”κΎΈμ–΄λ³΄μ•Όμš”

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sopt.now.compose.dto
package com.sopt.now.compose.data.dto.LoginDto

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sopt.now.compose.dto
package com.sopt.now.compose.data.dto.LoginDto

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sopt.now.compose.dto
package com.sopt.now.compose.data.dto

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
Expand Down
Loading