-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Domain logic bug in the models #73
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
928eff7
#60 list.api.domain.model.ICharacterItem -> core.api.domain.model.ICh…
ntnsmirnov eafebf7
#60 CharacterDetail now inherits from ICharacter
ntnsmirnov d75ce2c
#60 ICharacterFavorite deleted. It changed to ICharacter.
ntnsmirnov d064be3
#60 Character entity and CharacterMapper
ntnsmirnov 298b837
#60 CharacterDetail removed
ntnsmirnov 7422ea0
#60 CharacterItem removed
ntnsmirnov d327c8a
#60 Mapper moved to repository
ntnsmirnov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
...s/list/api/domain/model/ICharacterItem.kt → ...cters/core/api/domain/model/ICharacter.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: 3 additions & 4 deletions
7
...va/com/stepango/blockme/feature/characters/core/api/domain/repository/MarvelRepository.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,11 +1,10 @@ | ||
package com.stepango.blockme.feature.characters.core.api.domain.repository | ||
|
||
import com.stepango.blockme.core.network.library.response.BaseResponse | ||
import com.stepango.blockme.feature.characters.core.api.data.response.CharacterResponse | ||
import com.stepango.blockme.feature.characters.core.api.domain.model.ICharacter | ||
|
||
interface MarvelRepository { | ||
|
||
suspend fun getCharacter(id: Long): BaseResponse<CharacterResponse> | ||
suspend fun getCharacter(id: Long): ICharacter | ||
|
||
suspend fun getCharacters(offset: Int, limit: Int): BaseResponse<CharacterResponse> | ||
suspend fun getCharacters(offset: Int, limit: Int): List<ICharacter> | ||
} |
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
10 changes: 10 additions & 0 deletions
10
...src/main/java/com/stepango/blockme/feature/characters/core/impl/domain/model/Character.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,10 @@ | ||
package com.stepango.blockme.feature.characters.core.impl.domain.model | ||
|
||
import com.stepango.blockme.feature.characters.core.api.domain.model.ICharacter | ||
|
||
data class Character( | ||
override val id: Long, | ||
override val name: String, | ||
override val description: String, | ||
override val imageUrl: String | ||
) : ICharacter |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
api( | ||
packageName = "com.stepango.blockme.character.detail.api", | ||
owner = Teams.core | ||
owner = Teams.core, | ||
dependencies = deps( | ||
target(":feature:characters:core:api") | ||
) | ||
) |
Empty file.
8 changes: 0 additions & 8 deletions
8
.../java/com/stepango/blockme/feature/characters/detail/api/domain/model/ICharacterDetail.kt
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
...stepango/blockme/feature/characters/detail/impl/presentation/ICharacterDetailViewModel.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
41 changes: 0 additions & 41 deletions
41
.../com/stepango/blockme/feature/characters/detail/impl/data/mapper/CharacterDetailMapper.kt
This file was deleted.
Oops, something went wrong.
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
26 changes: 0 additions & 26 deletions
26
.../java/com/stepango/blockme/feature/characters/detail/impl/domain/model/CharacterDetail.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good improvement!
Now we have only 3 types of "Character"!
But we can do more, what do you think, if we'll remove
CharacterItem
andCharacterDetail
? I think about added single entity implementation ofICharacter
into core:impl, for exampleclass Character : ICharacter
And other domains
Character Details/Items/Favorites
will use only ICharacter type with default core implementation under hood.In that case, will be only one
Character
single entity with unique structure placed in the core target.What do you think?