-
Notifications
You must be signed in to change notification settings - Fork 2
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
11 changed files
with
189 additions
and
229 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
20 changes: 20 additions & 0 deletions
20
shared/src/commonMain/kotlin/data/base/BaseResponseData.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,20 @@ | ||
package data.base | ||
|
||
import kotlinx.serialization.Serializable | ||
import util.network.NetworkResult | ||
import util.network.networkErrorWithLog | ||
|
||
|
||
@Serializable | ||
data class BaseResponseData<T>( | ||
val code: Int, | ||
val message: String, | ||
val data: T | ||
) { | ||
fun toNetworkResult(): NetworkResult<T> { | ||
return when (code) { | ||
10000 -> NetworkResult.Success(data) | ||
else -> networkErrorWithLog(code, "获取失败") | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package data.emptyRoom | ||
|
||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class EmptyRoom( | ||
val build: String, | ||
val location: String, | ||
val capacity: String, | ||
val type: String | ||
) |
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
54 changes: 21 additions & 33 deletions
54
shared/src/commonMain/kotlin/repository/EmptyRoomRepository.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
Oops, something went wrong.