-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop' into feat/#92-intern-info
# Conflicts: # app/src/main/java/com/terning/point/di/DataSourceModule.kt # app/src/main/java/com/terning/point/di/RepositoryModule.kt # app/src/main/java/com/terning/point/di/ServiceModule.kt
- Loading branch information
Showing
14 changed files
with
214 additions
and
187 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
8 changes: 8 additions & 0 deletions
8
data/src/main/java/com/terning/data/datasource/HomeDataSource.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,8 @@ | ||
package com.terning.data.datasource | ||
|
||
import com.terning.data.dto.BaseResponse | ||
import com.terning.data.dto.response.HomeTodayInternResponseDto | ||
|
||
interface HomeDataSource { | ||
suspend fun getTodayIntern(): BaseResponse<List<HomeTodayInternResponseDto>> | ||
} |
14 changes: 14 additions & 0 deletions
14
data/src/main/java/com/terning/data/datasourceimpl/HomeDataSourceImpl.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.terning.data.datasourceimpl | ||
|
||
import com.terning.data.datasource.HomeDataSource | ||
import com.terning.data.dto.BaseResponse | ||
import com.terning.data.dto.response.HomeTodayInternResponseDto | ||
import com.terning.data.service.HomeService | ||
import javax.inject.Inject | ||
|
||
class HomeDataSourceImpl @Inject constructor( | ||
private val homeService: HomeService, | ||
) : HomeDataSource { | ||
override suspend fun getTodayIntern(): BaseResponse<List<HomeTodayInternResponseDto>> = | ||
homeService.getHomeTodayIntern() | ||
} |
41 changes: 41 additions & 0 deletions
41
data/src/main/java/com/terning/data/dto/response/HomeTodayInternResponseDto.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,41 @@ | ||
package com.terning.data.dto.response | ||
|
||
import com.terning.domain.entity.response.HomeTodayInternModel | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class HomeTodayInternResponseDto( | ||
@SerialName("scrapId") | ||
val scrapId: Long, | ||
@SerialName("internshipAnnouncementId") | ||
val internshipAnnouncementId: Long, | ||
@SerialName("companyImage") | ||
val companyImage: String, | ||
@SerialName("title") | ||
val title: String, | ||
@SerialName("dDay") | ||
val dDay: String, | ||
@SerialName("deadline") | ||
val deadline: String, | ||
@SerialName("workingPeriod") | ||
val workingPeriod: String, | ||
@SerialName("color") | ||
val color: String, | ||
@SerialName("startYearMonth") | ||
val startYearMonth: String, | ||
|
||
) { | ||
fun toHomeTodayInternList(): HomeTodayInternModel = | ||
HomeTodayInternModel( | ||
scrapId = this.scrapId, | ||
internshipAnnouncementId = this.internshipAnnouncementId, | ||
companyImage = this.companyImage, | ||
title = this.title, | ||
dDay = this.dDay, | ||
deadline = this.deadline, | ||
workingPeriod = this.workingPeriod, | ||
startYearMonth = this.startYearMonth, | ||
color = this.color, | ||
) | ||
} |
17 changes: 17 additions & 0 deletions
17
data/src/main/java/com/terning/data/repositoryimpl/HomeRepositoryImpl.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,17 @@ | ||
package com.terning.data.repositoryimpl | ||
|
||
import com.terning.data.datasource.HomeDataSource | ||
import com.terning.domain.entity.response.HomeTodayInternModel | ||
import com.terning.domain.repository.HomeRepository | ||
import javax.inject.Inject | ||
|
||
class HomeRepositoryImpl @Inject constructor( | ||
private val homeDataSource: HomeDataSource, | ||
) : HomeRepository { | ||
override suspend fun getHomeTodayInternList(): Result<List<HomeTodayInternModel>> = | ||
runCatching { | ||
homeDataSource.getTodayIntern().result.map { | ||
it.toHomeTodayInternList() | ||
} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
data/src/main/java/com/terning/data/service/HomeService.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.terning.data.service | ||
|
||
import com.terning.data.dto.BaseResponse | ||
import com.terning.data.dto.response.HomeTodayInternResponseDto | ||
import retrofit2.http.GET | ||
|
||
interface HomeService { | ||
@GET("api/v1/home/today") | ||
suspend fun getHomeTodayIntern(): BaseResponse<List<HomeTodayInternResponseDto>> | ||
} |
13 changes: 13 additions & 0 deletions
13
domain/src/main/java/com/terning/domain/entity/response/HomeTodayInternModel.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,13 @@ | ||
package com.terning.domain.entity.response | ||
|
||
data class HomeTodayInternModel( | ||
val scrapId: Long, | ||
val internshipAnnouncementId: Long, | ||
val companyImage: String, | ||
val title: String, | ||
val dDay: String, | ||
val deadline: String, | ||
val workingPeriod: String, | ||
val color: String, | ||
val startYearMonth: String, | ||
) |
7 changes: 7 additions & 0 deletions
7
domain/src/main/java/com/terning/domain/repository/HomeRepository.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.terning.domain.repository | ||
|
||
import com.terning.domain.entity.response.HomeTodayInternModel | ||
|
||
interface HomeRepository { | ||
suspend fun getHomeTodayInternList(): Result<List<HomeTodayInternModel>> | ||
} |
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
8 changes: 8 additions & 0 deletions
8
feature/src/main/java/com/terning/feature/home/home/HomeSideEffect.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,8 @@ | ||
package com.terning.feature.home.home | ||
|
||
import androidx.annotation.StringRes | ||
|
||
sealed class HomeSideEffect { | ||
data object NavigateToChangeFilter : HomeSideEffect() | ||
data class ShowToast(@StringRes val message: Int) : HomeSideEffect() | ||
} |
Oops, something went wrong.