-
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
174 additions
and
29 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
16 changes: 16 additions & 0 deletions
16
library/src/commonMain/kotlin/io/wellmate/api/client/app/IngredientFields.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,16 @@ | ||
package io.wellmate.api.client.app | ||
|
||
import kotlinx.serialization.Serializable | ||
|
||
|
||
@Serializable | ||
class IngredientFields( | ||
val name: String, | ||
val amount: Float, | ||
|
||
val kilocalories: Int, | ||
val proteins: Float, | ||
val carbohydrates: Float, | ||
val fats: Float, | ||
val sugars: Float, | ||
) |
9 changes: 9 additions & 0 deletions
9
library/src/commonMain/kotlin/io/wellmate/api/client/app/MealFields.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,9 @@ | ||
package io.wellmate.api.client.app | ||
|
||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
class MealFields( | ||
val name: String, | ||
val ingredients: List<IngredientFields>, | ||
) |
6 changes: 6 additions & 0 deletions
6
library/src/commonMain/kotlin/io/wellmate/api/client/app/Message.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 io.wellmate.api.client.app | ||
|
||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class Message(val message: String) |
6 changes: 6 additions & 0 deletions
6
library/src/commonMain/kotlin/io/wellmate/api/client/auth/Email.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 io.wellmate.api.client.auth | ||
|
||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class Email(val email: String) |
8 changes: 8 additions & 0 deletions
8
library/src/commonMain/kotlin/io/wellmate/api/client/auth/OAuthToken.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 io.wellmate.api.client.auth | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
|
||
@Serializable | ||
data class OAuthToken(@SerialName("access_token") val accessToken: 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
16 changes: 16 additions & 0 deletions
16
library/src/commonMain/kotlin/io/wellmate/api/client/userData/PotentialUser.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,16 @@ | ||
package io.wellmate.api.client.userData | ||
|
||
import kotlinx.datetime.LocalDateTime | ||
import kotlinx.datetime.serializers.LocalDateTimeIso8601Serializer | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class PotentialUserFields(val email: String, val name: String, val info: String?) | ||
|
||
@Serializable | ||
data class PotentialUser( | ||
val email: String, | ||
val name: String, | ||
val info: String?, | ||
@Serializable(with = LocalDateTimeIso8601Serializer::class) val added: LocalDateTime | ||
) |
37 changes: 37 additions & 0 deletions
37
library/src/commonMain/kotlin/io/wellmate/api/client/userData/UserInfo.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,37 @@ | ||
package io.wellmate.api.client.userData | ||
|
||
import kotlinx.datetime.LocalDateTime | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
import kotlinx.datetime.serializers.LocalDateTimeIso8601Serializer | ||
|
||
@Serializable | ||
enum class Sex { | ||
@SerialName("m") M, | ||
@SerialName("f") F, | ||
} | ||
|
||
@Serializable | ||
data class UserInfoFields( | ||
val name: String?, | ||
val surname: String?, | ||
|
||
@Serializable(with = LocalDateTimeIso8601Serializer::class) val birthday: LocalDateTime?, | ||
val sex: Sex?, | ||
val weight: Int?, | ||
val height: Int?, | ||
val country: String?, | ||
) | ||
|
||
@Serializable | ||
data class UserInfo( | ||
@SerialName("user_id") val userId: Int?, | ||
val name: String?, | ||
val surname: String?, | ||
|
||
@Serializable(with = LocalDateTimeIso8601Serializer::class) val birthday: LocalDateTime?, | ||
val sex: Sex?, | ||
val weight: Int?, | ||
val height: Int?, | ||
val country: String?, | ||
) |