From 252e82ca69387833750148fe17b2ebc9b65a48da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=98=84=EB=B9=88?= <82383983+leehyeonbin@users.noreply.github.com> Date: Sat, 15 Apr 2023 16:12:57 +0900 Subject: [PATCH 01/17] =?UTF-8?q?=E2=9C=A8=EF=B8=8F=20::=20create=20extens?= =?UTF-8?q?ion=20of=20convert=20applicant=20list=20data=20between=20data?= =?UTF-8?q?=20layer=20and=20domain=20layer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../get_applicant_list/ApplicantListResponse.kt | 17 +++++++++++++++-- .../GetApplicantListResponse.kt | 8 ++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/msg/gcms/data/remote/dto/applicant/get_applicant_list/ApplicantListResponse.kt b/app/src/main/java/com/msg/gcms/data/remote/dto/applicant/get_applicant_list/ApplicantListResponse.kt index 8f27450f..5be41c52 100644 --- a/app/src/main/java/com/msg/gcms/data/remote/dto/applicant/get_applicant_list/ApplicantListResponse.kt +++ b/app/src/main/java/com/msg/gcms/data/remote/dto/applicant/get_applicant_list/ApplicantListResponse.kt @@ -1,9 +1,10 @@ package com.msg.gcms.data.remote.dto.applicant.get_applicant_list import com.google.gson.annotations.SerializedName +import com.msg.gcms.domain.data.applicant.get_applicant_list.ApplicantListData import java.util.UUID -data class ApplicantListResponse ( +data class ApplicantListResponse( @SerializedName("uuid") val uuid: UUID, @SerializedName("email") @@ -18,4 +19,16 @@ data class ApplicantListResponse ( val number: Int, @SerializedName("profileImg") val profileImg: String? -) \ No newline at end of file +) + +fun ApplicantListResponse.toApplicantListData(): ApplicantListData { + return ApplicantListData( + uuid = uuid, + email = email, + name = name, + grade = grade, + classNum = classNum, + number = number, + profileImg = profileImg + ) +} \ No newline at end of file diff --git a/app/src/main/java/com/msg/gcms/data/remote/dto/applicant/get_applicant_list/GetApplicantListResponse.kt b/app/src/main/java/com/msg/gcms/data/remote/dto/applicant/get_applicant_list/GetApplicantListResponse.kt index f7087518..2cc18b5f 100644 --- a/app/src/main/java/com/msg/gcms/data/remote/dto/applicant/get_applicant_list/GetApplicantListResponse.kt +++ b/app/src/main/java/com/msg/gcms/data/remote/dto/applicant/get_applicant_list/GetApplicantListResponse.kt @@ -1,6 +1,7 @@ package com.msg.gcms.data.remote.dto.applicant.get_applicant_list import com.google.gson.annotations.SerializedName +import com.msg.gcms.domain.data.applicant.get_applicant_list.GetApplicantListData data class GetApplicantListResponse( @SerializedName("scope") @@ -8,3 +9,10 @@ data class GetApplicantListResponse( @SerializedName("applicantList") val applicantList: List ) + +fun GetApplicantListResponse.toApplicantListData(): GetApplicantListData { + return GetApplicantListData( + applicantList = applicantList.map { it.toApplicantListData() }, + userScope = userScope + ) +} \ No newline at end of file From 7118a90c5b2c076506d65380733c0f2b3cded847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=98=84=EB=B9=88?= <82383983+leehyeonbin@users.noreply.github.com> Date: Sat, 15 Apr 2023 16:15:57 +0900 Subject: [PATCH 02/17] =?UTF-8?q?=E2=9A=B0=EF=B8=8F=20::=20Remove=20legacy?= =?UTF-8?q?=20applicant=20mappers=20that=20were=20converting=20applicant?= =?UTF-8?q?=20data?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../msg/gcms/data/mapper/ApplicantMapper.kt | 28 ------------------- 1 file changed, 28 deletions(-) delete mode 100644 app/src/main/java/com/msg/gcms/data/mapper/ApplicantMapper.kt diff --git a/app/src/main/java/com/msg/gcms/data/mapper/ApplicantMapper.kt b/app/src/main/java/com/msg/gcms/data/mapper/ApplicantMapper.kt deleted file mode 100644 index 983e4a51..00000000 --- a/app/src/main/java/com/msg/gcms/data/mapper/ApplicantMapper.kt +++ /dev/null @@ -1,28 +0,0 @@ -package com.msg.gcms.data.mapper - -import com.msg.gcms.data.remote.dto.applicant.get_applicant_list.ApplicantListResponse -import com.msg.gcms.data.remote.dto.applicant.get_applicant_list.GetApplicantListResponse -import com.msg.gcms.domain.data.applicant.get_applicant_list.ApplicantListData -import com.msg.gcms.domain.data.applicant.get_applicant_list.GetApplicantListData - -object ApplicantMapper { - - fun mapperToGetApplicantListData(data: GetApplicantListResponse): GetApplicantListData { - return GetApplicantListData( - applicantList = data.applicantList.map { mapperToApplicantListData(it) }, - userScope = data.userScope - ) - } - - private fun mapperToApplicantListData(data: ApplicantListResponse): ApplicantListData { - return ApplicantListData( - classNum = data.classNum, - email = data.email, - grade = data.grade, - name = data.name, - number = data.number, - profileImg = data.profileImg, - uuid = data.uuid - ) - } -} \ No newline at end of file From f0ff0459a724d358bf17963b2f1acbe8e18820b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=98=84=EB=B9=88?= <82383983+leehyeonbin@users.noreply.github.com> Date: Sat, 15 Apr 2023 16:36:39 +0900 Subject: [PATCH 03/17] =?UTF-8?q?=E2=9C=A8=EF=B8=8F=20::=20create=20extens?= =?UTF-8?q?ion=20of=20convert=20auth=20data=20between=20data=20layer=20and?= =?UTF-8?q?=20domain=20layer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/remote/dto/auth/response/SignInResponse.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/src/main/java/com/msg/gcms/data/remote/dto/auth/response/SignInResponse.kt b/app/src/main/java/com/msg/gcms/data/remote/dto/auth/response/SignInResponse.kt index 163c0311..4fe34a2f 100644 --- a/app/src/main/java/com/msg/gcms/data/remote/dto/auth/response/SignInResponse.kt +++ b/app/src/main/java/com/msg/gcms/data/remote/dto/auth/response/SignInResponse.kt @@ -1,6 +1,7 @@ package com.msg.gcms.data.remote.dto.auth.response import com.google.gson.annotations.SerializedName +import com.msg.gcms.domain.data.auth.SignInResponseData data class SignInResponse( @SerializedName("accessToken") @@ -12,3 +13,12 @@ data class SignInResponse( @SerializedName("refreshExp") val refreshExp: String ) + +fun SignInResponse.toSignInData(): SignInResponseData { + return SignInResponseData( + accessToken = accessToken, + refreshToken = refreshToken, + accessExp = accessExp, + refreshExp = refreshExp + ) +} From c4cb8adfe09adcf74cd5313edd9f4b7a50dcb496 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=98=84=EB=B9=88?= <82383983+leehyeonbin@users.noreply.github.com> Date: Sat, 15 Apr 2023 16:37:03 +0900 Subject: [PATCH 04/17] =?UTF-8?q?=E2=9A=B0=EF=B8=8F=20::=20Remove=20legacy?= =?UTF-8?q?=20auth=20mappers=20that=20were=20converting=20auth=20data?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/msg/gcms/data/mapper/AuthMapper.kt | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 app/src/main/java/com/msg/gcms/data/mapper/AuthMapper.kt diff --git a/app/src/main/java/com/msg/gcms/data/mapper/AuthMapper.kt b/app/src/main/java/com/msg/gcms/data/mapper/AuthMapper.kt deleted file mode 100644 index 30699d07..00000000 --- a/app/src/main/java/com/msg/gcms/data/mapper/AuthMapper.kt +++ /dev/null @@ -1,16 +0,0 @@ -package com.msg.gcms.data.mapper - -import com.msg.gcms.data.remote.dto.auth.response.SignInResponse -import com.msg.gcms.domain.data.auth.SignInResponseData - -object AuthMapper { - - fun mapperToSignInData(data: SignInResponse): SignInResponseData{ - return SignInResponseData( - accessToken = data.accessToken, - refreshToken = data.refreshToken, - accessExp = data.accessExp, - refreshExp = data.refreshExp - ) - } -} \ No newline at end of file From 0f0c79a95d5cfe3e36212af4d6354017f95f284e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=98=84=EB=B9=88?= <82383983+leehyeonbin@users.noreply.github.com> Date: Sat, 15 Apr 2023 16:40:14 +0900 Subject: [PATCH 05/17] =?UTF-8?q?=E2=9C=A8=EF=B8=8F=20::=20create=20extens?= =?UTF-8?q?ion=20of=20convert=20clubList=20data=20between=20data=20layer?= =?UTF-8?q?=20and=20domain=20layer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/club/get_club_list/GetClubListResponse.kt | 12 ++++++++++++ .../msg/gcms/data/repository/ClubRepositoryImpl.kt | 5 ++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/msg/gcms/data/remote/dto/club/get_club_list/GetClubListResponse.kt b/app/src/main/java/com/msg/gcms/data/remote/dto/club/get_club_list/GetClubListResponse.kt index bd9ac987..a409e157 100644 --- a/app/src/main/java/com/msg/gcms/data/remote/dto/club/get_club_list/GetClubListResponse.kt +++ b/app/src/main/java/com/msg/gcms/data/remote/dto/club/get_club_list/GetClubListResponse.kt @@ -1,6 +1,7 @@ package com.msg.gcms.data.remote.dto.club.get_club_list import com.google.gson.annotations.SerializedName +import com.msg.gcms.domain.data.club.get_club_list.GetClubListData data class GetClubListResponse( @SerializedName("id") @@ -12,3 +13,14 @@ data class GetClubListResponse( @SerializedName("bannerImg") val bannerUrl: String ) + +fun List.toClubListData(): List { + return this.map { + GetClubListData( + id = it.id, + bannerUrl = it.bannerUrl, + title = it.title, + type = it.type + ) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/msg/gcms/data/repository/ClubRepositoryImpl.kt b/app/src/main/java/com/msg/gcms/data/repository/ClubRepositoryImpl.kt index a04e8a77..99b39aa8 100644 --- a/app/src/main/java/com/msg/gcms/data/repository/ClubRepositoryImpl.kt +++ b/app/src/main/java/com/msg/gcms/data/repository/ClubRepositoryImpl.kt @@ -7,6 +7,7 @@ import com.msg.gcms.data.local.entity.ClubEntity import com.msg.gcms.data.mapper.ClubMapper import com.msg.gcms.data.remote.datasource.club.ClubDataSource import com.msg.gcms.data.remote.dto.club.create_club.CreateClubRequest +import com.msg.gcms.data.remote.dto.club.get_club_list.toClubListData import com.msg.gcms.data.remote.dto.club.modify_club_info.ModifyClubInfoRequest import com.msg.gcms.domain.data.club.create_club.CreateClubData import com.msg.gcms.domain.data.club.get_club_detail.ClubDetailData @@ -93,9 +94,7 @@ class ClubRepositoryImpl @Inject constructor( private fun onRemoteObservable(type: String) = flow { emit( - ClubMapper.mapperToGetClubListData( - remoteDataSource.getClubList(type = type) - ) + remoteDataSource.getClubList(type = type).toClubListData() ) } From e0cdfd94b705e6fe3fbe7a7e2cca21b2b1c1f29f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=98=84=EB=B9=88?= <82383983+leehyeonbin@users.noreply.github.com> Date: Sat, 15 Apr 2023 16:44:32 +0900 Subject: [PATCH 06/17] =?UTF-8?q?=E2=9C=A8=EF=B8=8F=20::=20create=20extens?= =?UTF-8?q?ion=20of=20convert=20clubDetail=20and=20clubMember=20data=20bet?= =?UTF-8?q?ween=20data=20layer=20and=20domain=20layer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../get_club_detail/ClubDetailResponse.kt | 20 +++++++++++++++++++ .../get_club_detail/ClubMemberResponse.kt | 13 ++++++++++++ 2 files changed, 33 insertions(+) diff --git a/app/src/main/java/com/msg/gcms/data/remote/dto/club/get_club_detail/ClubDetailResponse.kt b/app/src/main/java/com/msg/gcms/data/remote/dto/club/get_club_detail/ClubDetailResponse.kt index a62b5964..a9a85e21 100644 --- a/app/src/main/java/com/msg/gcms/data/remote/dto/club/get_club_detail/ClubDetailResponse.kt +++ b/app/src/main/java/com/msg/gcms/data/remote/dto/club/get_club_detail/ClubDetailResponse.kt @@ -1,6 +1,7 @@ package com.msg.gcms.data.remote.dto.club.get_club_detail import com.google.gson.annotations.SerializedName +import com.msg.gcms.domain.data.club.get_club_detail.ClubDetailData data class ClubDetailResponse( @SerializedName("id") @@ -32,3 +33,22 @@ data class ClubDetailResponse( @SerializedName("isApplied") val isApplied: Boolean ) + +fun ClubDetailResponse.toClubDetailData(): ClubDetailData { + return ClubDetailData( + activityImgs = activityImgs, + bannerImg = bannerImg, + contact = contact, + content = content, + head = head.toClubMemberData(), + id = id, + isApplied = isApplied, + isOpened = isOpened, + member = member.map { it.toClubMemberData() }, + name = name, + notionLink = notionLink, + scope = scope, + teacher = teacher, + type = type + ) +} \ No newline at end of file diff --git a/app/src/main/java/com/msg/gcms/data/remote/dto/club/get_club_detail/ClubMemberResponse.kt b/app/src/main/java/com/msg/gcms/data/remote/dto/club/get_club_detail/ClubMemberResponse.kt index d66d530a..9a4c1950 100644 --- a/app/src/main/java/com/msg/gcms/data/remote/dto/club/get_club_detail/ClubMemberResponse.kt +++ b/app/src/main/java/com/msg/gcms/data/remote/dto/club/get_club_detail/ClubMemberResponse.kt @@ -1,6 +1,7 @@ package com.msg.gcms.data.remote.dto.club.get_club_detail import com.google.gson.annotations.SerializedName +import com.msg.gcms.domain.data.club.get_club_detail.ClubMemberData import java.util.UUID data class ClubMemberResponse( @@ -19,3 +20,15 @@ data class ClubMemberResponse( @SerializedName("profileImg") val userImg: String?, ) + +fun ClubMemberResponse.toClubMemberData(): ClubMemberData { + return ClubMemberData( + uuid = uuid, + email = email, + `class` = `class`, + grade = grade, + name = name, + num = num, + userImg = userImg + ) +} From 1ecca54c0213e47a099a96efc71931af40fc383f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=98=84=EB=B9=88?= <82383983+leehyeonbin@users.noreply.github.com> Date: Sat, 15 Apr 2023 16:44:58 +0900 Subject: [PATCH 07/17] =?UTF-8?q?=E2=9A=B0=EF=B8=8F=20::=20Remove=20legacy?= =?UTF-8?q?=20auth=20mappers=20that=20were=20converting=20club=20data?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/msg/gcms/data/mapper/ClubMapper.kt | 54 ------------------- 1 file changed, 54 deletions(-) delete mode 100644 app/src/main/java/com/msg/gcms/data/mapper/ClubMapper.kt diff --git a/app/src/main/java/com/msg/gcms/data/mapper/ClubMapper.kt b/app/src/main/java/com/msg/gcms/data/mapper/ClubMapper.kt deleted file mode 100644 index a0a5346a..00000000 --- a/app/src/main/java/com/msg/gcms/data/mapper/ClubMapper.kt +++ /dev/null @@ -1,54 +0,0 @@ -package com.msg.gcms.data.mapper - -import com.msg.gcms.data.remote.dto.club.get_club_detail.ClubDetailResponse -import com.msg.gcms.data.remote.dto.club.get_club_detail.ClubMemberResponse -import com.msg.gcms.data.remote.dto.club.get_club_list.GetClubListResponse -import com.msg.gcms.domain.data.club.get_club_detail.ClubDetailData -import com.msg.gcms.domain.data.club.get_club_detail.ClubMemberData -import com.msg.gcms.domain.data.club.get_club_list.GetClubListData - -object ClubMapper { - - fun mapperToGetClubListData(data: List): List { - return data.map { - GetClubListData( - id = it.id, - bannerUrl = it.bannerUrl, - title = it.title, - type = it.type - ) - } - } - - fun mapperToDetailData(data: ClubDetailResponse): ClubDetailData { - return ClubDetailData( - activityImgs = data.activityImgs, - bannerImg = data.bannerImg, - contact = data.contact, - content = data.content, - head = mapperToMemberData(data.head), - id = data.id, - isApplied = data.isApplied, - isOpened = data.isOpened, - member = data.member.map { mapperToMemberData(it) }, - name = data.name, - notionLink = data.notionLink, - scope = data.scope, - teacher = data.teacher, - type = data.type - - ) - } - - private fun mapperToMemberData(data: ClubMemberResponse): ClubMemberData { - return ClubMemberData( - uuid = data.uuid, - email = data.email, - `class` = data.`class`, - grade = data.grade, - name = data.name, - num = data.num, - userImg = data.userImg - ) - } -} \ No newline at end of file From d3d6907027519e25dabb1fbc152b1ae2cd5d7114 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=98=84=EB=B9=88?= <82383983+leehyeonbin@users.noreply.github.com> Date: Sat, 15 Apr 2023 16:50:21 +0900 Subject: [PATCH 08/17] =?UTF-8?q?=E2=9C=A8=EF=B8=8F=20::=20create=20extens?= =?UTF-8?q?ion=20of=20convert=20member=20data=20between=20data=20layer=20a?= =?UTF-8?q?nd=20domain=20layer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../get_club_member/GetClubMemberResponse.kt | 10 ++++++++++ .../club_member/get_club_member/MemberResponse.kt | 14 ++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/app/src/main/java/com/msg/gcms/data/remote/dto/club_member/get_club_member/GetClubMemberResponse.kt b/app/src/main/java/com/msg/gcms/data/remote/dto/club_member/get_club_member/GetClubMemberResponse.kt index 39f2119c..9fbf88c0 100644 --- a/app/src/main/java/com/msg/gcms/data/remote/dto/club_member/get_club_member/GetClubMemberResponse.kt +++ b/app/src/main/java/com/msg/gcms/data/remote/dto/club_member/get_club_member/GetClubMemberResponse.kt @@ -1,6 +1,7 @@ package com.msg.gcms.data.remote.dto.club_member.get_club_member import com.google.gson.annotations.SerializedName +import com.msg.gcms.domain.data.club_member.get_club_member.GetClubMemberData data class GetClubMemberResponse( @SerializedName("scope") @@ -8,3 +9,12 @@ data class GetClubMemberResponse( @SerializedName("clubMember") val requestUser: List ) + +fun GetClubMemberResponse.toClubMemberData(): GetClubMemberData { + return GetClubMemberData( + userScope = userScope, + requestUser = requestUser.map { + it.toMemberData() + } + ) +} diff --git a/app/src/main/java/com/msg/gcms/data/remote/dto/club_member/get_club_member/MemberResponse.kt b/app/src/main/java/com/msg/gcms/data/remote/dto/club_member/get_club_member/MemberResponse.kt index ee3fcbfc..5593ef90 100644 --- a/app/src/main/java/com/msg/gcms/data/remote/dto/club_member/get_club_member/MemberResponse.kt +++ b/app/src/main/java/com/msg/gcms/data/remote/dto/club_member/get_club_member/MemberResponse.kt @@ -1,6 +1,7 @@ package com.msg.gcms.data.remote.dto.club_member.get_club_member import com.google.gson.annotations.SerializedName +import com.msg.gcms.domain.data.club_member.get_club_member.MemberData import java.util.UUID data class MemberResponse( @@ -21,3 +22,16 @@ data class MemberResponse( @SerializedName("scope") val scope: String ) + +fun MemberResponse.toMemberData(): MemberData{ + return MemberData( + uuid = uuid, + email = email, + name = name, + grade = grade, + `class` = `class`, + num = num, + userImg = userImg, + scope = scope + ) +} From 3a1e5989810c850414646699a1ec837c378cad40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=98=84=EB=B9=88?= <82383983+leehyeonbin@users.noreply.github.com> Date: Sat, 15 Apr 2023 17:00:57 +0900 Subject: [PATCH 09/17] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20::=20Modify=20the=20?= =?UTF-8?q?extension=20to=20just=20convert=20atomic=20data?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../club/get_club_list/GetClubListResponse.kt | 16 +++++++--------- .../gcms/data/repository/ClubRepositoryImpl.kt | 6 +++--- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/com/msg/gcms/data/remote/dto/club/get_club_list/GetClubListResponse.kt b/app/src/main/java/com/msg/gcms/data/remote/dto/club/get_club_list/GetClubListResponse.kt index a409e157..4d4fec38 100644 --- a/app/src/main/java/com/msg/gcms/data/remote/dto/club/get_club_list/GetClubListResponse.kt +++ b/app/src/main/java/com/msg/gcms/data/remote/dto/club/get_club_list/GetClubListResponse.kt @@ -14,13 +14,11 @@ data class GetClubListResponse( val bannerUrl: String ) -fun List.toClubListData(): List { - return this.map { - GetClubListData( - id = it.id, - bannerUrl = it.bannerUrl, - title = it.title, - type = it.type - ) - } +fun GetClubListResponse.toClubListData(): GetClubListData { + return GetClubListData( + id = id, + bannerUrl = bannerUrl, + title = title, + type = type + ) } \ No newline at end of file diff --git a/app/src/main/java/com/msg/gcms/data/repository/ClubRepositoryImpl.kt b/app/src/main/java/com/msg/gcms/data/repository/ClubRepositoryImpl.kt index 99b39aa8..a82be7b0 100644 --- a/app/src/main/java/com/msg/gcms/data/repository/ClubRepositoryImpl.kt +++ b/app/src/main/java/com/msg/gcms/data/repository/ClubRepositoryImpl.kt @@ -4,9 +4,9 @@ import Macaroni import android.util.Log import com.msg.gcms.data.local.datasource.club.ClubLocalDataSource import com.msg.gcms.data.local.entity.ClubEntity -import com.msg.gcms.data.mapper.ClubMapper import com.msg.gcms.data.remote.datasource.club.ClubDataSource import com.msg.gcms.data.remote.dto.club.create_club.CreateClubRequest +import com.msg.gcms.data.remote.dto.club.get_club_detail.toClubDetailData import com.msg.gcms.data.remote.dto.club.get_club_list.toClubListData import com.msg.gcms.data.remote.dto.club.modify_club_info.ModifyClubInfoRequest import com.msg.gcms.domain.data.club.create_club.CreateClubData @@ -36,7 +36,7 @@ class ClubRepositoryImpl @Inject constructor( } override suspend fun getDetail(clubId: Long): ClubDetailData { - return ClubMapper.mapperToDetailData(remoteDataSource.getDetail(clubId)) + return remoteDataSource.getDetail(clubId).toClubDetailData() } override suspend fun postCreateClub(body: CreateClubData) { @@ -94,7 +94,7 @@ class ClubRepositoryImpl @Inject constructor( private fun onRemoteObservable(type: String) = flow { emit( - remoteDataSource.getClubList(type = type).toClubListData() + remoteDataSource.getClubList(type = type).map { it.toClubListData() } ) } From 8e80a6bd4eb592bf211ae9855656a041c5dd0314 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=98=84=EB=B9=88?= <82383983+leehyeonbin@users.noreply.github.com> Date: Sat, 15 Apr 2023 17:01:39 +0900 Subject: [PATCH 10/17] =?UTF-8?q?=E2=9A=B0=EF=B8=8F=20::=20Remove=20legacy?= =?UTF-8?q?=20club=20member=20mappers=20that=20were=20converting=20club=20?= =?UTF-8?q?member?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../msg/gcms/data/mapper/ClubMemberMapper.kt | 31 ------------------- 1 file changed, 31 deletions(-) delete mode 100644 app/src/main/java/com/msg/gcms/data/mapper/ClubMemberMapper.kt diff --git a/app/src/main/java/com/msg/gcms/data/mapper/ClubMemberMapper.kt b/app/src/main/java/com/msg/gcms/data/mapper/ClubMemberMapper.kt deleted file mode 100644 index d1c9cc56..00000000 --- a/app/src/main/java/com/msg/gcms/data/mapper/ClubMemberMapper.kt +++ /dev/null @@ -1,31 +0,0 @@ -package com.msg.gcms.data.mapper - -import com.msg.gcms.data.remote.dto.club_member.get_club_member.GetClubMemberResponse -import com.msg.gcms.data.remote.dto.club_member.get_club_member.MemberResponse -import com.msg.gcms.domain.data.club_member.get_club_member.GetClubMemberData -import com.msg.gcms.domain.data.club_member.get_club_member.MemberData - -object ClubMemberMapper { - - fun mapperToClubMemberData(data: GetClubMemberResponse): GetClubMemberData { - return GetClubMemberData( - userScope = data.userScope, - requestUser = data.requestUser.map { - mapperToMemberData(it) - } - ) - } - - private fun mapperToMemberData(data: MemberResponse): MemberData { - return MemberData( - uuid = data.uuid, - email = data.email, - name = data.name, - grade = data.grade, - `class` = data.`class`, - num = data.num, - userImg = data.userImg, - scope = data.scope - ) - } -} \ No newline at end of file From fa67fcc655cae5918a59f03b206ec10e302c80e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=98=84=EB=B9=88?= <82383983+leehyeonbin@users.noreply.github.com> Date: Sat, 15 Apr 2023 17:03:09 +0900 Subject: [PATCH 11/17] =?UTF-8?q?=E2=9C=A8=EF=B8=8F=20::=20create=20extens?= =?UTF-8?q?ion=20of=20convert=20image=20between=20data=20layer=20and=20dom?= =?UTF-8?q?ain=20layer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/msg/gcms/data/remote/dto/image/ImageResponse.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/msg/gcms/data/remote/dto/image/ImageResponse.kt b/app/src/main/java/com/msg/gcms/data/remote/dto/image/ImageResponse.kt index 5942159d..e9b9f53b 100644 --- a/app/src/main/java/com/msg/gcms/data/remote/dto/image/ImageResponse.kt +++ b/app/src/main/java/com/msg/gcms/data/remote/dto/image/ImageResponse.kt @@ -1,8 +1,13 @@ package com.msg.gcms.data.remote.dto.image import com.google.gson.annotations.SerializedName +import com.msg.gcms.domain.data.image.ImageData data class ImageResponse( @SerializedName("images") val images: List -) \ No newline at end of file +) + +fun ImageResponse.toImageData(): ImageData { + return ImageData(images = images) +} \ No newline at end of file From 05ff3e6d44889c9fba3f5026fbc2ea3b5895deb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=98=84=EB=B9=88?= <82383983+leehyeonbin@users.noreply.github.com> Date: Sat, 15 Apr 2023 17:03:33 +0900 Subject: [PATCH 12/17] =?UTF-8?q?=E2=9A=B0=EF=B8=8F=20::=20Remove=20legacy?= =?UTF-8?q?=20image=20mappers=20that=20were=20converting=20image?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/msg/gcms/data/mapper/ImageMapper.kt | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 app/src/main/java/com/msg/gcms/data/mapper/ImageMapper.kt diff --git a/app/src/main/java/com/msg/gcms/data/mapper/ImageMapper.kt b/app/src/main/java/com/msg/gcms/data/mapper/ImageMapper.kt deleted file mode 100644 index 35aeb6ec..00000000 --- a/app/src/main/java/com/msg/gcms/data/mapper/ImageMapper.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.msg.gcms.data.mapper - -import com.msg.gcms.data.remote.dto.image.ImageResponse -import com.msg.gcms.domain.data.image.ImageData - -object ImageMapper { - - fun mapperToImageData(data: ImageResponse): ImageData { - return ImageData(images = data.images) - } -} \ No newline at end of file From 58f1ea40d8f3ddb9e1912bd8c2a2c4016cc950b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=98=84=EB=B9=88?= <82383983+leehyeonbin@users.noreply.github.com> Date: Sat, 15 Apr 2023 17:08:14 +0900 Subject: [PATCH 13/17] =?UTF-8?q?=E2=9C=A8=EF=B8=8F=20::=20create=20extens?= =?UTF-8?q?ion=20of=20convert=20profile=20data=20between=20data=20layer=20?= =?UTF-8?q?and=20domain=20layer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/get_my_profile/GetMyProfileResponse.kt | 14 ++++++++++++++ .../dto/user/get_my_profile/ProfileClubResponse.kt | 12 +++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/msg/gcms/data/remote/dto/user/get_my_profile/GetMyProfileResponse.kt b/app/src/main/java/com/msg/gcms/data/remote/dto/user/get_my_profile/GetMyProfileResponse.kt index bc9b5515..381acfa1 100644 --- a/app/src/main/java/com/msg/gcms/data/remote/dto/user/get_my_profile/GetMyProfileResponse.kt +++ b/app/src/main/java/com/msg/gcms/data/remote/dto/user/get_my_profile/GetMyProfileResponse.kt @@ -1,6 +1,7 @@ package com.msg.gcms.data.remote.dto.user.get_my_profile import com.google.gson.annotations.SerializedName +import com.msg.gcms.domain.data.user.get_my_profile.GetMyProfileData import java.util.UUID data class GetMyProfileResponse( @@ -21,3 +22,16 @@ data class GetMyProfileResponse( @SerializedName("clubs") val clubs: List ) + +fun GetMyProfileResponse.toGetMyProfileData(): GetMyProfileData { + return GetMyProfileData( + classNum = classNum, + clubs = clubs.map { it.toProfileClubData() }, + email = email, + grade = grade, + name = name, + number = number, + profileImg = profileImg, + uuid = uuid + ) +} diff --git a/app/src/main/java/com/msg/gcms/data/remote/dto/user/get_my_profile/ProfileClubResponse.kt b/app/src/main/java/com/msg/gcms/data/remote/dto/user/get_my_profile/ProfileClubResponse.kt index a99ac2c9..cd25cf2b 100644 --- a/app/src/main/java/com/msg/gcms/data/remote/dto/user/get_my_profile/ProfileClubResponse.kt +++ b/app/src/main/java/com/msg/gcms/data/remote/dto/user/get_my_profile/ProfileClubResponse.kt @@ -1,6 +1,7 @@ package com.msg.gcms.data.remote.dto.user.get_my_profile import com.google.gson.annotations.SerializedName +import com.msg.gcms.domain.data.user.get_my_profile.ProfileClubData data class ProfileClubResponse( @SerializedName("id") @@ -11,4 +12,13 @@ data class ProfileClubResponse( val bannerImg: String, @SerializedName("name") val title: String -) \ No newline at end of file +) + +fun ProfileClubResponse.toProfileClubData(): ProfileClubData { + return ProfileClubData( + id = id, + type = type, + bannerImg = bannerImg, + title = title + ) +} \ No newline at end of file From d451a92cabfbaaf96036a707dac8a6824514a009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=98=84=EB=B9=88?= <82383983+leehyeonbin@users.noreply.github.com> Date: Sat, 15 Apr 2023 17:09:53 +0900 Subject: [PATCH 14/17] =?UTF-8?q?=E2=9C=A8=EF=B8=8F=20::=20create=20extens?= =?UTF-8?q?ion=20of=20convert=20search=20user=20data=20between=20data=20la?= =?UTF-8?q?yer=20and=20domain=20layer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/user/search_user/GetSearchUserResponse.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/src/main/java/com/msg/gcms/data/remote/dto/user/search_user/GetSearchUserResponse.kt b/app/src/main/java/com/msg/gcms/data/remote/dto/user/search_user/GetSearchUserResponse.kt index 61e84ee2..0fb5d6dd 100644 --- a/app/src/main/java/com/msg/gcms/data/remote/dto/user/search_user/GetSearchUserResponse.kt +++ b/app/src/main/java/com/msg/gcms/data/remote/dto/user/search_user/GetSearchUserResponse.kt @@ -1,6 +1,7 @@ package com.msg.gcms.data.remote.dto.user.search_user import com.google.gson.annotations.SerializedName +import com.msg.gcms.domain.data.user.search_user.GetSearchUserData import java.util.UUID data class GetSearchUserResponse( @@ -19,3 +20,15 @@ data class GetSearchUserResponse( @SerializedName("profileImg") val profileImg: String? ) + +fun GetSearchUserResponse.toGetSearchUserData(): GetSearchUserData { + return GetSearchUserData( + classNum = classNum, + email = email, + grade = grade, + name = name, + number = number, + profileImg = profileImg, + uuid = uuid + ) +} \ No newline at end of file From 76b3cfb51d5cc32373980305d290d93ce0e535f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=98=84=EB=B9=88?= <82383983+leehyeonbin@users.noreply.github.com> Date: Sat, 15 Apr 2023 17:11:56 +0900 Subject: [PATCH 15/17] =?UTF-8?q?=E2=9C=A8=EF=B8=8F=20::=20create=20extens?= =?UTF-8?q?ion=20of=20convert=20profile=20image=20data=20between=20data=20?= =?UTF-8?q?layer=20and=20domain=20layer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/get_profile_image/GetProfileImageResponse.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/msg/gcms/data/remote/dto/user/get_profile_image/GetProfileImageResponse.kt b/app/src/main/java/com/msg/gcms/data/remote/dto/user/get_profile_image/GetProfileImageResponse.kt index b3e65ee5..6ad3065e 100644 --- a/app/src/main/java/com/msg/gcms/data/remote/dto/user/get_profile_image/GetProfileImageResponse.kt +++ b/app/src/main/java/com/msg/gcms/data/remote/dto/user/get_profile_image/GetProfileImageResponse.kt @@ -1,8 +1,15 @@ package com.msg.gcms.data.remote.dto.user.get_profile_image import com.google.gson.annotations.SerializedName +import com.msg.gcms.domain.data.user.get_profile_image.GetProfileImageData data class GetProfileImageResponse( @SerializedName("profileImg") val profileImg: String?, -) \ No newline at end of file +) + +fun GetProfileImageResponse.toGetProfileImageData(): GetProfileImageData { + return GetProfileImageData( + profileImg = profileImg + ) +} \ No newline at end of file From 4176fa6619579668fe0d033147d894f3438ea864 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=98=84=EB=B9=88?= <82383983+leehyeonbin@users.noreply.github.com> Date: Sat, 15 Apr 2023 17:12:15 +0900 Subject: [PATCH 16/17] =?UTF-8?q?=E2=9A=B0=EF=B8=8F=20::=20Remove=20legacy?= =?UTF-8?q?=20profile=20image=20mappers=20that=20were=20converting=20profi?= =?UTF-8?q?le=20image?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/msg/gcms/data/mapper/UserMapper.kt | 53 ------------------- 1 file changed, 53 deletions(-) delete mode 100644 app/src/main/java/com/msg/gcms/data/mapper/UserMapper.kt diff --git a/app/src/main/java/com/msg/gcms/data/mapper/UserMapper.kt b/app/src/main/java/com/msg/gcms/data/mapper/UserMapper.kt deleted file mode 100644 index 7d997bc3..00000000 --- a/app/src/main/java/com/msg/gcms/data/mapper/UserMapper.kt +++ /dev/null @@ -1,53 +0,0 @@ -package com.msg.gcms.data.mapper - -import com.msg.gcms.data.remote.dto.user.get_my_profile.GetMyProfileResponse -import com.msg.gcms.data.remote.dto.user.get_my_profile.ProfileClubResponse -import com.msg.gcms.data.remote.dto.user.get_profile_image.GetProfileImageResponse -import com.msg.gcms.data.remote.dto.user.search_user.GetSearchUserResponse -import com.msg.gcms.domain.data.user.get_my_profile.GetMyProfileData -import com.msg.gcms.domain.data.user.get_my_profile.ProfileClubData -import com.msg.gcms.domain.data.user.get_profile_image.GetProfileImageData -import com.msg.gcms.domain.data.user.search_user.GetSearchUserData - -object UserMapper { - - fun mapperToGetMyProfileData(data: GetMyProfileResponse): GetMyProfileData { - return GetMyProfileData( - classNum = data.classNum, - clubs = data.clubs.map { mapperToProfileClubData(it) }, - email = data.email, - grade = data.grade, - name = data.name, - number = data.number, - profileImg = data.profileImg, - uuid = data.uuid - ) - } - - private fun mapperToProfileClubData(data: ProfileClubResponse): ProfileClubData { - return ProfileClubData( - id = data.id, - type = data.type, - bannerImg = data.bannerImg, - title = data.title - ) - } - - fun mapperToGetSearchUserData(data: GetSearchUserResponse): GetSearchUserData { - return GetSearchUserData( - classNum = data.classNum, - email = data.email, - grade = data.grade, - name = data.name, - number = data.number, - profileImg = data.profileImg, - uuid = data.uuid - ) - } - - fun mapperToGetProfileImageData(data: GetProfileImageResponse): GetProfileImageData { - return GetProfileImageData( - profileImg = data.profileImg - ) - } -} \ No newline at end of file From 678ba184cbbe7a0d6ca1a194d0d14e7f3e65b5ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=98=84=EB=B9=88?= <82383983+leehyeonbin@users.noreply.github.com> Date: Sat, 15 Apr 2023 17:14:03 +0900 Subject: [PATCH 17/17] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20::=20apply=20the=20e?= =?UTF-8?q?xtension=20for=20each=20data=20type=20convert=20between=20data?= =?UTF-8?q?=20layer=20and=20domain=20layer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/repository/ApplicantRepositoryImpl.kt | 4 ++-- .../msg/gcms/data/repository/AuthRepositoryImpl.kt | 14 ++++++-------- .../data/repository/ClubMemberRepositoryImpl.kt | 4 ++-- .../gcms/data/repository/ImageRepositoryImpl.kt | 4 ++-- .../msg/gcms/data/repository/UserRepositoryImpl.kt | 10 ++++++---- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/com/msg/gcms/data/repository/ApplicantRepositoryImpl.kt b/app/src/main/java/com/msg/gcms/data/repository/ApplicantRepositoryImpl.kt index 8f230084..3c605469 100644 --- a/app/src/main/java/com/msg/gcms/data/repository/ApplicantRepositoryImpl.kt +++ b/app/src/main/java/com/msg/gcms/data/repository/ApplicantRepositoryImpl.kt @@ -1,9 +1,9 @@ package com.msg.gcms.data.repository -import com.msg.gcms.data.mapper.ApplicantMapper import com.msg.gcms.data.remote.datasource.applicant.ApplicantDataSource import com.msg.gcms.data.remote.dto.applicant.club_apply_accept.ClubApplyAcceptRequest import com.msg.gcms.data.remote.dto.applicant.club_apply_reject.ClubApplyRejectRequest +import com.msg.gcms.data.remote.dto.applicant.get_applicant_list.toApplicantListData import com.msg.gcms.domain.data.applicant.clubApplyAccept.ClubApplyAcceptData import com.msg.gcms.domain.data.applicant.club_apply_reject.ClubApplyRejectData import com.msg.gcms.domain.data.applicant.get_applicant_list.GetApplicantListData @@ -14,7 +14,7 @@ class ApplicantRepositoryImpl @Inject constructor( private val dataSource: ApplicantDataSource ): ApplicantRepository { override suspend fun getApplicantList(clubId: Long): GetApplicantListData { - return ApplicantMapper.mapperToGetApplicantListData(dataSource.getApplicantList(clubId = clubId)) + return dataSource.getApplicantList(clubId = clubId).toApplicantListData() } override suspend fun postClubApply(clubId: Long) { diff --git a/app/src/main/java/com/msg/gcms/data/repository/AuthRepositoryImpl.kt b/app/src/main/java/com/msg/gcms/data/repository/AuthRepositoryImpl.kt index 91a1ed18..659810fe 100644 --- a/app/src/main/java/com/msg/gcms/data/repository/AuthRepositoryImpl.kt +++ b/app/src/main/java/com/msg/gcms/data/repository/AuthRepositoryImpl.kt @@ -1,10 +1,10 @@ package com.msg.gcms.data.repository import com.msg.gcms.data.local.datasource.LocalDataSource -import com.msg.gcms.data.mapper.AuthMapper import com.msg.gcms.data.remote.datasource.auth.AuthDataSource import com.msg.gcms.data.remote.dto.auth.request.RefreshRequest import com.msg.gcms.data.remote.dto.auth.request.SignInRequest +import com.msg.gcms.data.remote.dto.auth.response.toSignInData import com.msg.gcms.domain.data.auth.SignInRequestData import com.msg.gcms.domain.data.auth.SignInResponseData import com.msg.gcms.domain.exception.NeedLoginException @@ -17,14 +17,12 @@ class AuthRepositoryImpl @Inject constructor( private val localDataSource: LocalDataSource ) : AuthRepository { override suspend fun postRegistration(body: SignInRequestData): SignInResponseData = - AuthMapper.mapperToSignInData( - remoteDatasource.postRegistration( - body = SignInRequest( - code = body.code, - token = body.token - ) + remoteDatasource.postRegistration( + body = SignInRequest( + code = body.code, + token = body.token ) - ) + ).toSignInData() override suspend fun logout() = remoteDatasource.logout() diff --git a/app/src/main/java/com/msg/gcms/data/repository/ClubMemberRepositoryImpl.kt b/app/src/main/java/com/msg/gcms/data/repository/ClubMemberRepositoryImpl.kt index 4fac4a4d..cec096b0 100644 --- a/app/src/main/java/com/msg/gcms/data/repository/ClubMemberRepositoryImpl.kt +++ b/app/src/main/java/com/msg/gcms/data/repository/ClubMemberRepositoryImpl.kt @@ -1,8 +1,8 @@ package com.msg.gcms.data.repository -import com.msg.gcms.data.mapper.ClubMemberMapper import com.msg.gcms.data.remote.datasource.club_member.ClubMemberDataSource import com.msg.gcms.data.remote.dto.club_member.delegation_of_manager.DelegationOfManagerRequest +import com.msg.gcms.data.remote.dto.club_member.get_club_member.toClubMemberData import com.msg.gcms.data.remote.dto.club_member.member_expelled.MemberExpelledRequest import com.msg.gcms.domain.data.club_member.delegation_of_manager.DelegationOfManagerData import com.msg.gcms.domain.data.club_member.get_club_member.GetClubMemberData @@ -14,7 +14,7 @@ class ClubMemberRepositoryImpl @Inject constructor( private val datasource: ClubMemberDataSource ) : ClubMemberRepository { override suspend fun getMemberList(clubId: Long): GetClubMemberData { - return ClubMemberMapper.mapperToClubMemberData(datasource.getMemberList(clubId = clubId)) + return datasource.getMemberList(clubId = clubId).toClubMemberData() } override suspend fun deleteMemberExpel( diff --git a/app/src/main/java/com/msg/gcms/data/repository/ImageRepositoryImpl.kt b/app/src/main/java/com/msg/gcms/data/repository/ImageRepositoryImpl.kt index ce6fd173..6d12fe35 100644 --- a/app/src/main/java/com/msg/gcms/data/repository/ImageRepositoryImpl.kt +++ b/app/src/main/java/com/msg/gcms/data/repository/ImageRepositoryImpl.kt @@ -1,7 +1,7 @@ package com.msg.gcms.data.repository -import com.msg.gcms.data.mapper.ImageMapper import com.msg.gcms.data.remote.datasource.image.ImageDataSource +import com.msg.gcms.data.remote.dto.image.toImageData import com.msg.gcms.domain.data.image.ImageData import com.msg.gcms.domain.repository.ImageRepository import okhttp3.MultipartBody @@ -11,6 +11,6 @@ class ImageRepositoryImpl @Inject constructor( private val datasource: ImageDataSource ) : ImageRepository { override suspend fun postImage(image: List): ImageData { - return ImageMapper.mapperToImageData(datasource.postImage(image = image)) + return datasource.postImage(image = image).toImageData() } } \ No newline at end of file diff --git a/app/src/main/java/com/msg/gcms/data/repository/UserRepositoryImpl.kt b/app/src/main/java/com/msg/gcms/data/repository/UserRepositoryImpl.kt index 2b58cb3a..2bed4f61 100644 --- a/app/src/main/java/com/msg/gcms/data/repository/UserRepositoryImpl.kt +++ b/app/src/main/java/com/msg/gcms/data/repository/UserRepositoryImpl.kt @@ -1,8 +1,10 @@ package com.msg.gcms.data.repository -import com.msg.gcms.data.mapper.UserMapper import com.msg.gcms.data.remote.datasource.user.UserDataSource +import com.msg.gcms.data.remote.dto.user.get_my_profile.toGetMyProfileData +import com.msg.gcms.data.remote.dto.user.get_profile_image.toGetProfileImageData import com.msg.gcms.data.remote.dto.user.modify_profile_image.ModifyProfileImageRequest +import com.msg.gcms.data.remote.dto.user.search_user.toGetSearchUserData import com.msg.gcms.domain.data.user.get_my_profile.GetMyProfileData import com.msg.gcms.domain.data.user.get_profile_image.GetProfileImageData import com.msg.gcms.domain.data.user.modify_profile_image.ModifyProfileImageData @@ -14,7 +16,7 @@ class UserRepositoryImpl @Inject constructor( private val dataSource: UserDataSource ) : UserRepository { override suspend fun getUserInfo(): GetMyProfileData { - return UserMapper.mapperToGetMyProfileData(dataSource.getUserInfo()) + return dataSource.getUserInfo().toGetMyProfileData() } override suspend fun putProfile( @@ -25,11 +27,11 @@ class UserRepositoryImpl @Inject constructor( override suspend fun getUserSearch(QueryString: Map): List { return dataSource.getUserSearch(QueryString) - .map { UserMapper.mapperToGetSearchUserData(it) } + .map { it.toGetSearchUserData() } } override suspend fun getProfileImage(): GetProfileImageData { - return UserMapper.mapperToGetProfileImageData(dataSource.getProfileImage()) + return dataSource.getProfileImage().toGetProfileImageData() } override suspend fun deleteUser() {