-
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.
- Loading branch information
1 parent
b88fb6d
commit ef9380d
Showing
24 changed files
with
165 additions
and
78 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
10 changes: 10 additions & 0 deletions
10
app/src/main/java/tj/rsdevteam/inmuslim/data/models/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,10 @@ | ||
package tj.rsdevteam.inmuslim.data.models | ||
|
||
/** | ||
* Created by Rustam Safarov on 6/25/24. | ||
* github.com/rustamsafarovrs | ||
*/ | ||
|
||
data class Message( | ||
val message: 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
2 changes: 1 addition & 1 deletion
2
.../inmuslim/data/models/network/Resource.kt → ...sdevteam/inmuslim/data/models/Resource.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
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
10 changes: 10 additions & 0 deletions
10
app/src/main/java/tj/rsdevteam/inmuslim/data/models/User.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 tj.rsdevteam.inmuslim.data.models | ||
|
||
/** | ||
* Created by Rustam Safarov on 6/25/24. | ||
* github.com/rustamsafarovrs | ||
*/ | ||
|
||
data class User( | ||
val id: Long | ||
) |
7 changes: 3 additions & 4 deletions
7
...data/models/network/GetRegionsResponse.kt → ...inmuslim/data/models/api/GetRegionsDTO.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,16 +1,15 @@ | ||
package tj.rsdevteam.inmuslim.data.models.network | ||
package tj.rsdevteam.inmuslim.data.models.api | ||
|
||
import com.squareup.moshi.JsonClass | ||
import tj.rsdevteam.inmuslim.data.models.Region | ||
|
||
/** | ||
* Created by Rustam Safarov on 14/08/23. | ||
* github.com/rustamsafarovrs | ||
*/ | ||
|
||
@JsonClass(generateAdapter = true) | ||
data class GetRegionsResponse( | ||
data class GetRegionsDTO( | ||
val result: Int, | ||
val msg: String, | ||
val regions: List<Region> | ||
val regions: List<RegionDTO> | ||
) |
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
7 changes: 3 additions & 4 deletions
7
.../data/models/network/GetTimingResponse.kt → .../inmuslim/data/models/api/GetTimingDTO.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,20 +1,19 @@ | ||
package tj.rsdevteam.inmuslim.data.models.network | ||
package tj.rsdevteam.inmuslim.data.models.api | ||
|
||
import com.squareup.moshi.Json | ||
import com.squareup.moshi.JsonClass | ||
import tj.rsdevteam.inmuslim.data.models.Timing | ||
|
||
/** | ||
* Created by Rustam Safarov on 8/13/23. | ||
* github.com/rustamsafarovrs | ||
*/ | ||
|
||
@JsonClass(generateAdapter = true) | ||
data class GetTimingResponse( | ||
data class GetTimingDTO( | ||
val result: Int, | ||
val msg: String, | ||
val region: String, | ||
@Json(name = "begin_date") | ||
val beginDate: String, | ||
val timing: Timing | ||
val timing: TimingDTO | ||
) |
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: 14 additions & 0 deletions
14
app/src/main/java/tj/rsdevteam/inmuslim/data/models/api/RegionDTO.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 tj.rsdevteam.inmuslim.data.models.api | ||
|
||
import com.squareup.moshi.JsonClass | ||
|
||
/** | ||
* Created by Rustam Safarov on 14/08/23. | ||
* github.com/rustamsafarovrs | ||
*/ | ||
|
||
@JsonClass(generateAdapter = true) | ||
data class RegionDTO( | ||
val id: Long, | ||
val name: 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
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
app/src/main/java/tj/rsdevteam/inmuslim/data/models/api/TimingDTO.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 tj.rsdevteam.inmuslim.data.models.api | ||
|
||
import com.squareup.moshi.JsonClass | ||
|
||
/** | ||
* Created by Rustam Safarov on 8/13/23. | ||
* github.com/rustamsafarovrs | ||
*/ | ||
|
||
@JsonClass(generateAdapter = true) | ||
data class TimingDTO( | ||
val fajr: String, | ||
val sunrise: String, | ||
val zuhr: String, | ||
val asr: String, | ||
val sunset: String, | ||
val maghrib: String, | ||
val isha: 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
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
11 changes: 0 additions & 11 deletions
11
app/src/main/java/tj/rsdevteam/inmuslim/data/models/network/ApiError.kt
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
53 changes: 53 additions & 0 deletions
53
app/src/main/java/tj/rsdevteam/inmuslim/data/repositories/Mappers.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,53 @@ | ||
package tj.rsdevteam.inmuslim.data.repositories | ||
|
||
import tj.rsdevteam.inmuslim.data.models.Message | ||
import tj.rsdevteam.inmuslim.data.models.Region | ||
import tj.rsdevteam.inmuslim.data.models.Timing | ||
import tj.rsdevteam.inmuslim.data.models.User | ||
import tj.rsdevteam.inmuslim.data.models.api.MessageDTO | ||
import tj.rsdevteam.inmuslim.data.models.api.RegionDTO | ||
import tj.rsdevteam.inmuslim.data.models.api.RegisterUserDTO | ||
import tj.rsdevteam.inmuslim.data.models.api.TimingDTO | ||
import tj.rsdevteam.inmuslim.data.models.api.UpdateMessagingIdDTO | ||
|
||
/** | ||
* Created by Rustam Safarov on 6/25/24. | ||
* github.com/rustamsafarovrs | ||
*/ | ||
|
||
fun RegionDTO.toRegion(): Region { | ||
return Region( | ||
id = this.id, | ||
name = this.name | ||
) | ||
} | ||
|
||
fun TimingDTO.toTiming(): Timing { | ||
return Timing( | ||
fajr = this.fajr, | ||
sunrise = this.sunrise, | ||
zuhr = this.zuhr, | ||
asr = this.asr, | ||
sunset = this.sunset, | ||
maghrib = this.maghrib, | ||
isha = this.isha | ||
) | ||
} | ||
|
||
fun MessageDTO.toMessage(): Message { | ||
return Message( | ||
message = this.msg | ||
) | ||
} | ||
|
||
fun RegisterUserDTO.toUser(): User { | ||
return User( | ||
id = this.id | ||
) | ||
} | ||
|
||
fun UpdateMessagingIdDTO.toMessage(): Message { | ||
return Message( | ||
message = this.msg | ||
) | ||
} |
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.