-
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.
- Loading branch information
Showing
14 changed files
with
165 additions
and
33 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
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
data/src/main/java/com/photosurfer/android/data/remote/datasource/RemoteTagListDataSource.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.photosurfer.android.data.remote.datasource | ||
|
||
import com.photosurfer.android.data.remote.calladapter.NetworkState | ||
import com.photosurfer.android.data.remote.model.response.BaseResponse | ||
import com.photosurfer.android.data.remote.model.response.TagListResponse | ||
|
||
interface RemoteTagListDataSource { | ||
|
||
suspend fun getTagList(): NetworkState<BaseResponse<TagListResponse>> | ||
} |
14 changes: 14 additions & 0 deletions
14
...c/main/java/com/photosurfer/android/data/remote/datasource/RemoteTagListDataSourceImpl.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 com.photosurfer.android.data.remote.datasource | ||
|
||
import com.photosurfer.android.data.remote.calladapter.NetworkState | ||
import com.photosurfer.android.data.remote.model.response.BaseResponse | ||
import com.photosurfer.android.data.remote.model.response.TagListResponse | ||
import com.photosurfer.android.data.remote.service.ChooseTagService | ||
import javax.inject.Inject | ||
|
||
class RemoteTagListDataSourceImpl @Inject constructor( | ||
private val chooseTagListService: ChooseTagService | ||
): RemoteTagListDataSource { | ||
override suspend fun getTagList(): NetworkState<BaseResponse<TagListResponse>> = | ||
chooseTagListService.getTagList() | ||
} |
8 changes: 2 additions & 6 deletions
8
data/src/main/java/com/photosurfer/android/data/remote/mapper/TagMapper.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,13 +1,9 @@ | ||
package com.photosurfer.android.data.remote.mapper | ||
|
||
import com.photosurfer.android.data.remote.model.request.Tag | ||
import com.photosurfer.android.domain.entity.TagIdNameType | ||
import com.photosurfer.android.domain.entity.TagNameType | ||
import javax.inject.Inject | ||
|
||
class TagMapper @Inject constructor() { | ||
|
||
fun toDomainTag(tag: com.photosurfer.android.domain.entity.request.Tag):Tag = | ||
Tag(name = tag.name, type = tag.type) | ||
|
||
fun toDataTag(tag: Tag):com.photosurfer.android.domain.entity.request.Tag = | ||
com.photosurfer.android.domain.entity.request.Tag(name = tag.name, type = tag.type) | ||
} |
31 changes: 31 additions & 0 deletions
31
data/src/main/java/com/photosurfer/android/data/remote/model/response/TagListResponse.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,31 @@ | ||
package com.photosurfer.android.data.remote.model.response | ||
|
||
|
||
import com.photosurfer.android.domain.entity.TagInfo | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class TagListResponse( | ||
@SerialName("often") | ||
val often: Often, | ||
@SerialName("recent") | ||
val recent: Recent, | ||
@SerialName("platform") | ||
val platform: Platform | ||
) | ||
|
||
data class Often( | ||
@SerialName("tags") | ||
val tags: List<TagInfo> | ||
) | ||
|
||
data class Recent( | ||
@SerialName("tags") | ||
val tags: List<TagInfo> | ||
) | ||
|
||
data class Platform( | ||
@SerialName("tags") | ||
val tags: List<TagInfo> | ||
) |
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
domain/src/main/java/com/photosurfer/android/domain/entity/ThreeTagList.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 com.photosurfer.android.domain.entity | ||
|
||
data class ThreeTagList( | ||
val recentTagList: MutableList<TagInfo>, | ||
val oftenTagList: MutableList<TagInfo>, | ||
val platformTagList: MutableList<TagInfo> | ||
) |
8 changes: 6 additions & 2 deletions
8
domain/src/main/java/com/photosurfer/android/domain/repository/ChooseTagRepository.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,15 @@ | ||
package com.photosurfer.android.domain.repository | ||
|
||
import com.photosurfer.android.domain.entity.TagIdNameType | ||
import com.photosurfer.android.domain.entity.TagInfo | ||
import com.photosurfer.android.domain.entity.ThreeTagList | ||
import com.photosurfer.android.domain.entity.request.DomainChooseTagRequest | ||
import com.photosurfer.android.domain.entity.request.Tag | ||
|
||
interface ChooseTagRepository { | ||
|
||
suspend fun postTag( | ||
domainChooseTagRequest: DomainChooseTagRequest | ||
): Result<List<Tag>> | ||
): Result<List<TagIdNameType>> | ||
|
||
suspend fun getTagList(): Result<ThreeTagList> | ||
} |
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
6 changes: 3 additions & 3 deletions
6
...re/register-tag/src/main/java/com/photosurfer/android/register_tag/RegisterTagActivity.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