-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
94 changed files
with
672 additions
and
607 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
common/systemDesign/src/main/java/city/zouitel/systemDesign/CommonConstants.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
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
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
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
28 changes: 20 additions & 8 deletions
28
core/database/src/main/java/city/zouitel/database/mapper/AudioMapper.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,15 +1,27 @@ | ||
package city.zouitel.database.mapper | ||
|
||
import city.zouitel.database.mapper.base.Mapper | ||
import city.zouitel.repository.model.Audio as OutAudio | ||
import city.zouitel.database.model.AudioEntity as InAudio | ||
|
||
class AudioMapper: Mapper.Base<InAudio, OutAudio> { | ||
override fun toLocal(data: OutAudio): InAudio = with(data) { | ||
InAudio(id, title, path, uri, size, duration) | ||
} | ||
class AudioMapper { | ||
|
||
override fun readOnly(data: InAudio): OutAudio = with(data) { | ||
OutAudio(id, title, path, uri, size, duration) | ||
} | ||
fun toRepo(audios: List<InAudio>) = audios.map { toRepo(it) } | ||
|
||
fun toRepo(audio: InAudio) = OutAudio( | ||
id = audio.id, | ||
title = audio.title, | ||
path = audio.path, | ||
uri = audio.uri, | ||
size = audio.size, | ||
duration = audio.duration | ||
) | ||
|
||
fun fromRepo(audio: OutAudio) = InAudio( | ||
id = audio.id, | ||
title = audio.title, | ||
path = audio.path, | ||
uri = audio.uri, | ||
size = audio.size, | ||
duration = audio.duration | ||
) | ||
} |
35 changes: 25 additions & 10 deletions
35
core/database/src/main/java/city/zouitel/database/mapper/DataMapper.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,17 +1,32 @@ | ||
package city.zouitel.database.mapper | ||
|
||
import city.zouitel.database.mapper.base.Mapper | ||
import city.zouitel.repository.model.Data | ||
import city.zouitel.database.model.DataEntity as InData | ||
import city.zouitel.repository.model.Data as OutData | ||
|
||
class DataMapper: Mapper.Base<InData, OutData> { | ||
override fun toLocal(data: OutData): InData = with(data){ | ||
InData(uid, title, description, priority, color, textColor, date, | ||
trashed, reminding) | ||
} | ||
class DataMapper { | ||
|
||
override fun readOnly(data: InData): OutData = with(data){ | ||
OutData(uid, title, description, priority, color, textColor, date, | ||
removed, reminding) | ||
} | ||
fun toRepo(data: InData) = OutData( | ||
uid = data.uid, | ||
title = data.title, | ||
description = data.description, | ||
priority = data.priority, | ||
color = data.color, | ||
textColor = data.textColor, | ||
date = data.date, | ||
removed = data.removed, | ||
reminding = data.reminding | ||
) | ||
|
||
fun fromRepo(data: OutData) = InData( | ||
uid = data.uid, | ||
title = data.title, | ||
description = data.description, | ||
priority = data.priority, | ||
color = data.color, | ||
textColor = data.textColor, | ||
date = data.date, | ||
removed = data.removed, | ||
reminding = data.reminding | ||
) | ||
} |
Oops, something went wrong.