-
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.
Merge pull request #25 from EarthGardener/feature/24_login_mypage_ref…
…actor Feature/24 login mypage refactor
- Loading branch information
Showing
51 changed files
with
380 additions
and
163 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
9 changes: 9 additions & 0 deletions
9
EarthGardener/app/src/main/java/team/gdsc/earthgardener/data/api/ProfileService.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,9 @@ | ||
package team.gdsc.earthgardener.data.api | ||
|
||
import retrofit2.http.GET | ||
import team.gdsc.earthgardener.data.model.response.profile.ResProfileSuccessData | ||
|
||
interface ProfileService { | ||
@GET("user/profile") | ||
suspend fun getProfile() : ResProfileSuccessData | ||
} |
7 changes: 0 additions & 7 deletions
7
...r/app/src/main/java/team/gdsc/earthgardener/data/datasource/email/CheckEmailDataSource.kt
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
...src/main/java/team/gdsc/earthgardener/data/datasource/nickname/CheckNicknameDataSource.kt
This file was deleted.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
...er/app/src/main/java/team/gdsc/earthgardener/data/datasource/profile/ProfileDataSource.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,7 @@ | ||
package team.gdsc.earthgardener.data.datasource.profile | ||
|
||
import team.gdsc.earthgardener.data.model.response.profile.ResProfileSuccessData | ||
|
||
interface ProfileDataSource { | ||
suspend fun getProfile(): ResProfileSuccessData | ||
} |
11 changes: 11 additions & 0 deletions
11
.../src/main/java/team/gdsc/earthgardener/data/datasource/profile/ProfileRemoteDataSource.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,11 @@ | ||
package team.gdsc.earthgardener.data.datasource.profile | ||
|
||
import team.gdsc.earthgardener.data.api.ProfileService | ||
import team.gdsc.earthgardener.data.model.response.profile.ResProfileSuccessData | ||
|
||
class ProfileRemoteDataSource(private val profileService: ProfileService) | ||
:ProfileDataSource{ | ||
override suspend fun getProfile(): ResProfileSuccessData { | ||
return profileService.getProfile() | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...ener/app/src/main/java/team/gdsc/earthgardener/data/datasource/signin/SignInDataSource.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,8 @@ | ||
package team.gdsc.earthgardener.data.datasource.signin | ||
|
||
import team.gdsc.earthgardener.data.model.request.signin.ReqSignInSuccessData | ||
import team.gdsc.earthgardener.data.model.response.signin.ResSignInSuccessData | ||
|
||
interface SignInDataSource { | ||
suspend fun postSignIn(data: ReqSignInSuccessData): ResSignInSuccessData | ||
} |
13 changes: 13 additions & 0 deletions
13
...pp/src/main/java/team/gdsc/earthgardener/data/datasource/signin/SignInRemoteDataSource.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,13 @@ | ||
package team.gdsc.earthgardener.data.datasource.signin | ||
|
||
import team.gdsc.earthgardener.data.api.LoginService | ||
import team.gdsc.earthgardener.data.model.request.signin.ReqSignInSuccessData | ||
import team.gdsc.earthgardener.data.model.response.signin.ResSignInSuccessData | ||
|
||
class SignInRemoteDataSource(private val loginService: LoginService) | ||
: SignInDataSource{ | ||
override suspend fun postSignIn(data: ReqSignInSuccessData): ResSignInSuccessData { | ||
return loginService.postSignIn(data) | ||
} | ||
|
||
} |
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
7 changes: 7 additions & 0 deletions
7
...rc/main/java/team/gdsc/earthgardener/data/datasource/signup/email/CheckEmailDataSource.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,7 @@ | ||
package team.gdsc.earthgardener.data.datasource.signup.email | ||
|
||
import team.gdsc.earthgardener.data.model.response.signup.ResCheckEmailSuccessData | ||
|
||
interface CheckEmailDataSource { | ||
suspend fun getCheckEmail(email: String): ResCheckEmailSuccessData | ||
} |
7 changes: 4 additions & 3 deletions
7
...ource/email/CheckEmailRemoteDataSource.kt → ...ignup/email/CheckEmailRemoteDataSource.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
7 changes: 7 additions & 0 deletions
7
...n/java/team/gdsc/earthgardener/data/datasource/signup/nickname/CheckNicknameDataSource.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,7 @@ | ||
package team.gdsc.earthgardener.data.datasource.signup.nickname | ||
|
||
import team.gdsc.earthgardener.data.model.response.signup.ResCheckNicknameSuccessData | ||
|
||
interface CheckNicknameDataSource { | ||
suspend fun getCheckNickname(nickname: String): ResCheckNicknameSuccessData | ||
} |
4 changes: 2 additions & 2 deletions
4
...nickname/CheckNicknameRemoteDataSource.kt → ...nickname/CheckNicknameRemoteDataSource.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
19 changes: 19 additions & 0 deletions
19
EarthGardener/app/src/main/java/team/gdsc/earthgardener/data/mapper/profile/ProfileMapper.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,19 @@ | ||
package team.gdsc.earthgardener.data.mapper.profile | ||
|
||
import team.gdsc.earthgardener.data.model.response.profile.ResProfileSuccessData | ||
import team.gdsc.earthgardener.domain.profile.ProfileData | ||
|
||
object ProfileMapper { | ||
fun mapperProfileSuccessData(resProfileSuccessData: ResProfileSuccessData) | ||
: ProfileData { | ||
return ProfileData( | ||
message = resProfileSuccessData.message, | ||
status = resProfileSuccessData.status, | ||
data = ProfileData.ProfileInfo( | ||
resProfileSuccessData.data.email, | ||
resProfileSuccessData.data.nickname, | ||
resProfileSuccessData.data.image_url | ||
) | ||
) | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
EarthGardener/app/src/main/java/team/gdsc/earthgardener/data/mapper/signin/SignInMapper.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,16 @@ | ||
package team.gdsc.earthgardener.data.mapper.signin | ||
|
||
import team.gdsc.earthgardener.data.model.response.signin.ResSignInSuccessData | ||
import team.gdsc.earthgardener.domain.signin.SigninSuccessData | ||
|
||
object SignInMapper { | ||
|
||
fun mapperSignInSuccessData(resSignInSuccessData: ResSignInSuccessData) | ||
: SigninSuccessData { | ||
return SigninSuccessData( | ||
message = resSignInSuccessData.message, | ||
status = resSignInSuccessData.status, | ||
token = resSignInSuccessData.token | ||
) | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
...hgardener/data/mapper/CheckEmailMapper.kt → ...er/data/mapper/signup/CheckEmailMapper.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
4 changes: 2 additions & 2 deletions
4
...rdener/data/mapper/CheckNicknameMapper.kt → ...data/mapper/signup/CheckNicknameMapper.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
4 changes: 2 additions & 2 deletions
4
...earthgardener/data/mapper/SignUpMapper.kt → ...rdener/data/mapper/signup/SignUpMapper.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
11 changes: 11 additions & 0 deletions
11
...p/src/main/java/team/gdsc/earthgardener/data/model/request/signin/ReqSignInSuccessData.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,11 @@ | ||
package team.gdsc.earthgardener.data.model.request.signin | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class ReqSignInSuccessData( | ||
@SerializedName("email") | ||
val email: String, | ||
|
||
@SerializedName("pw") | ||
val pw: String | ||
) |
25 changes: 25 additions & 0 deletions
25
...rc/main/java/team/gdsc/earthgardener/data/model/response/profile/ResProfileSuccessData.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 team.gdsc.earthgardener.data.model.response.profile | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class ResProfileSuccessData( | ||
@SerializedName("message") | ||
val message: String, | ||
|
||
@SerializedName("data") | ||
val data: Profile, | ||
|
||
@SerializedName("status") | ||
val status: Int | ||
){ | ||
data class Profile( | ||
@SerializedName("email") | ||
val email: String, | ||
|
||
@SerializedName("nickname") | ||
val nickname: String, | ||
|
||
@SerializedName("image_url") | ||
val image_url: String | ||
) | ||
} |
7 changes: 7 additions & 0 deletions
7
.../src/main/java/team/gdsc/earthgardener/data/model/response/signin/ResSignInSuccessData.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,7 @@ | ||
package team.gdsc.earthgardener.data.model.response.signin | ||
|
||
data class ResSignInSuccessData( | ||
val message: String, | ||
val status: Int, | ||
val token: String | ||
) |
2 changes: 1 addition & 1 deletion
2
...odel/response/ResCheckEmailSuccessData.kt → ...sponse/signup/ResCheckEmailSuccessData.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
2 changes: 1 addition & 1 deletion
2
...l/response/ResCheckNicknameSuccessData.kt → ...nse/signup/ResCheckNicknameSuccessData.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
2 changes: 1 addition & 1 deletion
2
...ta/model/response/ResSignUpSuccessData.kt → ...l/response/signup/ResSignUpSuccessData.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
13 changes: 13 additions & 0 deletions
13
...pp/src/main/java/team/gdsc/earthgardener/data/repository/profile/ProfileRepositoryImpl.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,13 @@ | ||
package team.gdsc.earthgardener.data.repository.profile | ||
|
||
import team.gdsc.earthgardener.data.datasource.profile.ProfileDataSource | ||
import team.gdsc.earthgardener.data.mapper.profile.ProfileMapper | ||
import team.gdsc.earthgardener.domain.profile.ProfileData | ||
import team.gdsc.earthgardener.domain.profile.ProfileRepository | ||
|
||
class ProfileRepositoryImpl(private val profileDataSource: ProfileDataSource) | ||
: ProfileRepository { | ||
override suspend fun getProfileResult(): ProfileData { | ||
return ProfileMapper.mapperProfileSuccessData(profileDataSource.getProfile()) | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
.../app/src/main/java/team/gdsc/earthgardener/data/repository/signin/SignInRepositoryImpl.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,14 @@ | ||
package team.gdsc.earthgardener.data.repository.signin | ||
|
||
import team.gdsc.earthgardener.data.datasource.signin.SignInDataSource | ||
import team.gdsc.earthgardener.data.mapper.signin.SignInMapper | ||
import team.gdsc.earthgardener.data.model.request.signin.ReqSignInSuccessData | ||
import team.gdsc.earthgardener.domain.signin.SignInRepository | ||
import team.gdsc.earthgardener.domain.signin.SigninSuccessData | ||
|
||
class SignInRepositoryImpl(private val signInDataSource: SignInDataSource) | ||
:SignInRepository{ | ||
override suspend fun postSignInResult(data: ReqSignInSuccessData): SigninSuccessData { | ||
return SignInMapper.mapperSignInSuccessData(signInDataSource.postSignIn(data)) | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
...ta/repository/CheckEmailRepositoryImpl.kt → ...sitory/signup/CheckEmailRepositoryImpl.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
6 changes: 3 additions & 3 deletions
6
...repository/CheckNicknameRepositoryImpl.kt → ...ory/signup/CheckNicknameRepositoryImpl.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
4 changes: 2 additions & 2 deletions
4
...r/data/repository/SignUpRepositoryImpl.kt → ...repository/signup/SignUpRepositoryImpl.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
15 changes: 10 additions & 5 deletions
15
EarthGardener/app/src/main/java/team/gdsc/earthgardener/di/DataSourceModule.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,22 +1,27 @@ | ||
package team.gdsc.earthgardener.di | ||
|
||
import org.koin.dsl.module | ||
import team.gdsc.earthgardener.data.datasource.email.CheckEmailDataSource | ||
import team.gdsc.earthgardener.data.datasource.email.CheckEmailRemoteDataSource | ||
import team.gdsc.earthgardener.data.datasource.nickname.CheckNicknameDataSource | ||
import team.gdsc.earthgardener.data.datasource.nickname.CheckNicknameRemoteDataSource | ||
import team.gdsc.earthgardener.data.datasource.signup.email.CheckEmailDataSource | ||
import team.gdsc.earthgardener.data.datasource.signup.email.CheckEmailRemoteDataSource | ||
import team.gdsc.earthgardener.data.datasource.signup.nickname.CheckNicknameDataSource | ||
import team.gdsc.earthgardener.data.datasource.signup.nickname.CheckNicknameRemoteDataSource | ||
import team.gdsc.earthgardener.data.datasource.tree.TreeInfoDataSource | ||
import team.gdsc.earthgardener.data.datasource.tree.TreeInfoRemoteDataSource | ||
import team.gdsc.earthgardener.data.datasource.tree.TreeNameDataSource | ||
import team.gdsc.earthgardener.data.datasource.tree.TreeNameRemoteDataSource | ||
import team.gdsc.earthgardener.data.datasource.post.PostLocalDataSource | ||
import team.gdsc.earthgardener.data.datasource.post.PostRemoteDataSource | ||
import team.gdsc.earthgardener.data.datasource.post.PostDataSource | ||
import team.gdsc.earthgardener.data.datasource.profile.ProfileDataSource | ||
import team.gdsc.earthgardener.data.datasource.profile.ProfileRemoteDataSource | ||
import team.gdsc.earthgardener.data.datasource.signin.SignInDataSource | ||
import team.gdsc.earthgardener.data.datasource.signin.SignInRemoteDataSource | ||
|
||
val dataSourceModule = module { | ||
single<CheckEmailDataSource> { CheckEmailRemoteDataSource(get()) } | ||
single<CheckNicknameDataSource> { CheckNicknameRemoteDataSource(get()) } | ||
single<TreeInfoDataSource> { TreeInfoRemoteDataSource(get()) } | ||
single<TreeNameDataSource> { TreeNameRemoteDataSource(get()) } | ||
single<PostDataSource>{ PostRemoteDataSource(get()) } | ||
single<SignInDataSource>{ SignInRemoteDataSource(get()) } | ||
single<ProfileDataSource>{ ProfileRemoteDataSource(get())} | ||
} |
Oops, something went wrong.