-
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.
Showing
43 changed files
with
323 additions
and
363 deletions.
There are no files selected for viewing
8 changes: 4 additions & 4 deletions
8
data/src/main/java/com/terning/data/datasource/ScrapDataSource.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,18 +1,18 @@ | ||
package com.terning.data.datasource | ||
|
||
import com.terning.data.dto.NonDataBaseResponse | ||
import com.terning.domain.entity.request.ScrapRequestModel | ||
import com.terning.domain.entity.CalendarScrapRequest | ||
|
||
interface ScrapDataSource { | ||
suspend fun postScrap( | ||
scrapRequestModel: ScrapRequestModel, | ||
calendarScrapRequest: CalendarScrapRequest, | ||
): NonDataBaseResponse | ||
|
||
suspend fun deleteScrap( | ||
scrapRequestModel: ScrapRequestModel, | ||
calendarScrapRequest: CalendarScrapRequest, | ||
): NonDataBaseResponse | ||
|
||
suspend fun patchScrap( | ||
scrapRequestModel: ScrapRequestModel, | ||
calendarScrapRequest: CalendarScrapRequest, | ||
): NonDataBaseResponse | ||
} |
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
19 changes: 19 additions & 0 deletions
19
data/src/main/java/com/terning/data/mapper/CalendarScrapDetailListMapper.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,19 @@ | ||
package com.terning.data.mapper | ||
|
||
import com.terning.data.dto.response.CalendarMonthListResponseDto | ||
import com.terning.domain.entity.CalendarScrapDetail | ||
|
||
fun CalendarMonthListResponseDto.toCalendarScrapDetailList(): List<CalendarScrapDetail> = scraps.map { scrap -> | ||
CalendarScrapDetail( | ||
scrapId = scrap.scrapId, | ||
internshipAnnouncementId = scrap.internshipAnnouncementId, | ||
title = scrap.title, | ||
dDay = scrap.dDay, | ||
workingPeriod = scrap.workingPeriod, | ||
color = scrap.color, | ||
companyImage = scrap.companyImage, | ||
startYear = scrap.startYear, | ||
startMonth = scrap.startMonth, | ||
deadLine = deadline | ||
) | ||
} |
18 changes: 18 additions & 0 deletions
18
data/src/main/java/com/terning/data/mapper/CalendarScrapDetailMapper.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,18 @@ | ||
package com.terning.data.mapper | ||
|
||
import com.terning.data.dto.response.CalendarDayListResponseDto | ||
import com.terning.domain.entity.CalendarScrapDetail | ||
|
||
fun CalendarDayListResponseDto.toCalendarScrapDetail() = | ||
CalendarScrapDetail( | ||
scrapId = scrapId, | ||
internshipAnnouncementId = internshipAnnouncementId, | ||
title = title, | ||
dDay = dDay, | ||
workingPeriod = workingPeriod, | ||
color = color, | ||
companyImage = companyImage, | ||
startYear = startYear, | ||
startMonth = startMonth, | ||
deadLine = "" | ||
) |
14 changes: 14 additions & 0 deletions
14
data/src/main/java/com/terning/data/mapper/CalendarScrapMapper.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.mapper | ||
|
||
import com.terning.data.dto.response.CalendarMonthResponseDto | ||
import com.terning.domain.entity.CalendarScrap | ||
|
||
fun CalendarMonthResponseDto.toCalendarScrapList(): List<CalendarScrap> = scraps.map { scrap -> | ||
CalendarScrap( | ||
scrapId = scrap.scrapId, | ||
title = scrap.title, | ||
color = scrap.color, | ||
deadLine = deadline, | ||
isScrapped = true | ||
) | ||
} |
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
14 changes: 7 additions & 7 deletions
14
data/src/main/java/com/terning/data/repositoryimpl/ScrapRepositoryImpl.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,25 +1,25 @@ | ||
package com.terning.data.repositoryimpl | ||
|
||
import com.terning.data.datasource.ScrapDataSource | ||
import com.terning.domain.entity.request.ScrapRequestModel | ||
import com.terning.domain.entity.CalendarScrapRequest | ||
import com.terning.domain.repository.ScrapRepository | ||
import javax.inject.Inject | ||
|
||
class ScrapRepositoryImpl @Inject constructor( | ||
private val scrapDataSource: ScrapDataSource, | ||
) : ScrapRepository { | ||
override suspend fun postScrap(scrapRequestModel: ScrapRequestModel) | ||
override suspend fun postScrap(calendarScrapRequest: CalendarScrapRequest) | ||
: Result<Unit> = runCatching { | ||
scrapDataSource.postScrap(scrapRequestModel) | ||
scrapDataSource.postScrap(calendarScrapRequest) | ||
} | ||
|
||
override suspend fun deleteScrap(scrapRequestModel: ScrapRequestModel) | ||
override suspend fun deleteScrap(calendarScrapRequest: CalendarScrapRequest) | ||
: Result<Unit> = runCatching { | ||
scrapDataSource.deleteScrap(scrapRequestModel) | ||
scrapDataSource.deleteScrap(calendarScrapRequest) | ||
} | ||
|
||
override suspend fun patchScrap(scrapRequestModel: ScrapRequestModel) | ||
override suspend fun patchScrap(calendarScrapRequest: CalendarScrapRequest) | ||
: Result<Unit> = runCatching { | ||
scrapDataSource.patchScrap(scrapRequestModel) | ||
scrapDataSource.patchScrap(calendarScrapRequest) | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
...ain/entity/response/CalendarScrapModel.kt → ...om/terning/domain/entity/CalendarScrap.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
4 changes: 2 additions & 2 deletions
4
...tity/response/CalendarScrapDetailModel.kt → ...ning/domain/entity/CalendarScrapDetail.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
6 changes: 6 additions & 0 deletions
6
domain/src/main/java/com/terning/domain/entity/CalendarScrapRequest.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,6 @@ | ||
package com.terning.domain.entity | ||
|
||
data class CalendarScrapRequest( | ||
val id: Long, | ||
val color: Int? = 0, | ||
) |
6 changes: 0 additions & 6 deletions
6
domain/src/main/java/com/terning/domain/entity/request/ScrapRequestModel.kt
This file was deleted.
Oops, something went wrong.
10 changes: 5 additions & 5 deletions
10
domain/src/main/java/com/terning/domain/repository/CalendarRepository.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,11 @@ | ||
package com.terning.domain.repository | ||
|
||
import com.terning.domain.entity.response.CalendarScrapDetailModel | ||
import com.terning.domain.entity.response.CalendarScrapModel | ||
import com.terning.domain.entity.CalendarScrapDetail | ||
import com.terning.domain.entity.CalendarScrap | ||
import java.time.LocalDate | ||
|
||
interface CalendarRepository{ | ||
suspend fun getScrapMonth(year: Int, month: Int): Result<Map<String, List<CalendarScrapModel>>> | ||
suspend fun getScrapMonthList(year: Int, month: Int): Result<Map<String,List<CalendarScrapDetailModel>>> | ||
suspend fun getScrapDayList(currentDate: LocalDate): Result<List<CalendarScrapDetailModel>> | ||
suspend fun getScrapMonth(year: Int, month: Int): Result<Map<String, List<CalendarScrap>>> | ||
suspend fun getScrapMonthList(year: Int, month: Int): Result<Map<String,List<CalendarScrapDetail>>> | ||
suspend fun getScrapDayList(currentDate: LocalDate): Result<List<CalendarScrapDetail>> | ||
} |
8 changes: 4 additions & 4 deletions
8
domain/src/main/java/com/terning/domain/repository/ScrapRepository.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,9 +1,9 @@ | ||
package com.terning.domain.repository | ||
|
||
import com.terning.domain.entity.request.ScrapRequestModel | ||
import com.terning.domain.entity.CalendarScrapRequest | ||
|
||
interface ScrapRepository { | ||
suspend fun postScrap(scrapRequestModel: ScrapRequestModel): Result<Unit> | ||
suspend fun deleteScrap(scrapRequestModel: ScrapRequestModel): Result<Unit> | ||
suspend fun patchScrap(scrapRequestModel: ScrapRequestModel): Result<Unit> | ||
suspend fun postScrap(calendarScrapRequest: CalendarScrapRequest): Result<Unit> | ||
suspend fun deleteScrap(calendarScrapRequest: CalendarScrapRequest): Result<Unit> | ||
suspend fun patchScrap(calendarScrapRequest: CalendarScrapRequest): Result<Unit> | ||
} |
Oops, something went wrong.