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

🔀 :: (#417) - modify the methods of transfer data between data layer and domain layer #418

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
252e82c
✨️ :: create extension of convert applicant list data between data la…
leehyeonbin Apr 15, 2023
7118a90
⚰️ :: Remove legacy applicant mappers that were converting applicant …
leehyeonbin Apr 15, 2023
f0ff045
✨️ :: create extension of convert auth data between data layer and do…
leehyeonbin Apr 15, 2023
c4cb8ad
⚰️ :: Remove legacy auth mappers that were converting auth data
leehyeonbin Apr 15, 2023
0f0c79a
✨️ :: create extension of convert clubList data between data layer an…
leehyeonbin Apr 15, 2023
e0cdfd9
✨️ :: create extension of convert clubDetail and clubMember data betw…
leehyeonbin Apr 15, 2023
1ecca54
⚰️ :: Remove legacy auth mappers that were converting club data
leehyeonbin Apr 15, 2023
d3d6907
✨️ :: create extension of convert member data between data layer and …
leehyeonbin Apr 15, 2023
3a1e598
♻️ :: Modify the extension to just convert atomic data
leehyeonbin Apr 15, 2023
8e80a6b
⚰️ :: Remove legacy club member mappers that were converting club member
leehyeonbin Apr 15, 2023
fa67fcc
✨️ :: create extension of convert image between data layer and domain…
leehyeonbin Apr 15, 2023
05ff3e6
⚰️ :: Remove legacy image mappers that were converting image
leehyeonbin Apr 15, 2023
58f1ea4
✨️ :: create extension of convert profile data between data layer and…
leehyeonbin Apr 15, 2023
d451a92
✨️ :: create extension of convert search user data between data layer…
leehyeonbin Apr 15, 2023
76b3cfb
✨️ :: create extension of convert profile image data between data lay…
leehyeonbin Apr 15, 2023
4176fa6
⚰️ :: Remove legacy profile image mappers that were converting profil…
leehyeonbin Apr 15, 2023
678ba18
♻️ :: apply the extension for each data type convert between data lay…
leehyeonbin Apr 15, 2023
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
28 changes: 0 additions & 28 deletions app/src/main/java/com/msg/gcms/data/mapper/ApplicantMapper.kt

This file was deleted.

16 changes: 0 additions & 16 deletions app/src/main/java/com/msg/gcms/data/mapper/AuthMapper.kt

This file was deleted.

54 changes: 0 additions & 54 deletions app/src/main/java/com/msg/gcms/data/mapper/ClubMapper.kt

This file was deleted.

31 changes: 0 additions & 31 deletions app/src/main/java/com/msg/gcms/data/mapper/ClubMemberMapper.kt

This file was deleted.

11 changes: 0 additions & 11 deletions app/src/main/java/com/msg/gcms/data/mapper/ImageMapper.kt

This file was deleted.

53 changes: 0 additions & 53 deletions app/src/main/java/com/msg/gcms/data/mapper/UserMapper.kt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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")
Expand All @@ -18,4 +19,16 @@ data class ApplicantListResponse (
val number: Int,
@SerializedName("profileImg")
val profileImg: String?
)
)

fun ApplicantListResponse.toApplicantListData(): ApplicantListData {
return ApplicantListData(
uuid = uuid,
email = email,
name = name,
grade = grade,
classNum = classNum,
number = number,
profileImg = profileImg
)
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
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")
val userScope: String,
@SerializedName("applicantList")
val applicantList: List<ApplicantListResponse>
)

fun GetApplicantListResponse.toApplicantListData(): GetApplicantListData {
return GetApplicantListData(
applicantList = applicantList.map { it.toApplicantListData() },
userScope = userScope
)
}
Original file line number Diff line number Diff line change
@@ -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")
Expand All @@ -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
)
}
Original file line number Diff line number Diff line change
@@ -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")
Expand Down Expand Up @@ -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
)
}
Original file line number Diff line number Diff line change
@@ -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(
Expand All @@ -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
)
}
Original file line number Diff line number Diff line change
@@ -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")
Expand All @@ -12,3 +13,12 @@ data class GetClubListResponse(
@SerializedName("bannerImg")
val bannerUrl: String
)

fun GetClubListResponse.toClubListData(): GetClubListData {
return GetClubListData(
id = id,
bannerUrl = bannerUrl,
title = title,
type = type
)
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
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")
val userScope: String,
@SerializedName("clubMember")
val requestUser: List<MemberResponse>
)

fun GetClubMemberResponse.toClubMemberData(): GetClubMemberData {
return GetClubMemberData(
userScope = userScope,
requestUser = requestUser.map {
it.toMemberData()
}
)
}
Loading