-
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
12 changed files
with
122 additions
and
18 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
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
18 changes: 18 additions & 0 deletions
18
data/src/main/java/nexters/hyomk/data/model/request/UpdateFcmInfoDTO.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 nexters.hyomk.data.model.request | ||
|
||
import com.google.gson.annotations.SerializedName | ||
import nexters.hyomk.domain.model.FcmInfo | ||
|
||
data class UpdateFcmInfoDTO( | ||
@SerializedName("token") val token: String, | ||
@SerializedName("deviceUuid") val deviceUuid: String, | ||
@SerializedName("status") val status: String, | ||
) | ||
|
||
fun FcmInfo.toRequestDTO(): UpdateFcmInfoDTO { | ||
return UpdateFcmInfoDTO( | ||
token = this.token, | ||
deviceUuid = this.deviceId, | ||
status = this.status.name, | ||
) | ||
} |
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
5 changes: 5 additions & 0 deletions
5
domain/src/main/java/nexters/hyomk/domain/model/AlarmStatus.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,5 @@ | ||
package nexters.hyomk.domain.model | ||
|
||
enum class AlarmStatus { | ||
ON, OFF | ||
} |
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 nexters.hyomk.domain.model | ||
|
||
data class FcmInfo( | ||
val token: String, | ||
val deviceId: String, | ||
val status: AlarmStatus | ||
) |
3 changes: 2 additions & 1 deletion
3
domain/src/main/java/nexters/hyomk/domain/repository/DeviceInfoRepository.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,10 @@ | ||
package nexters.hyomk.domain.repository | ||
|
||
import kotlinx.coroutines.flow.Flow | ||
import nexters.hyomk.domain.model.FcmInfo | ||
|
||
interface DeviceInfoRepository { | ||
suspend fun getDeviceId(): Flow<String?> | ||
suspend fun initDeviceId(deviceId: String) | ||
suspend fun changeAlarmState(): Flow<Unit> | ||
suspend fun changeAlarmState(request: FcmInfo): Flow<Unit> | ||
} |
3 changes: 2 additions & 1 deletion
3
domain/src/main/java/nexters/hyomk/domain/usecase/UpdateAnniversaryAlarmStateUseCase.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,7 +1,8 @@ | ||
package nexters.hyomk.domain.usecase | ||
|
||
import kotlinx.coroutines.flow.Flow | ||
import nexters.hyomk.domain.model.FcmInfo | ||
|
||
interface UpdateAnniversaryAlarmStateUseCase { | ||
suspend fun invoke(): Flow<Unit> | ||
suspend fun invoke(request: FcmInfo): Flow<Unit> | ||
} |
3 changes: 2 additions & 1 deletion
3
.../src/main/java/nexters/hyomk/domain/usecaseImpl/UpdateAnniversaryAlarmStateUseCaseImpl.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,12 +1,13 @@ | ||
package nexters.hyomk.domain.usecaseImpl | ||
|
||
import kotlinx.coroutines.flow.Flow | ||
import nexters.hyomk.domain.model.FcmInfo | ||
import nexters.hyomk.domain.repository.DeviceInfoRepository | ||
import nexters.hyomk.domain.usecase.UpdateAnniversaryAlarmStateUseCase | ||
import javax.inject.Inject | ||
|
||
class UpdateAnniversaryAlarmStateUseCaseImpl @Inject constructor( | ||
private val deviceInfoRepository: DeviceInfoRepository, | ||
) : UpdateAnniversaryAlarmStateUseCase { | ||
override suspend fun invoke(): Flow<Unit> = deviceInfoRepository.changeAlarmState() | ||
override suspend fun invoke(request: FcmInfo): Flow<Unit> = deviceInfoRepository.changeAlarmState(request) | ||
} |