-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Tạo model và dto cho get study set by id request
- Loading branch information
Showing
9 changed files
with
109 additions
and
4 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
app/src/main/java/com/pwhs/quickmem/data/dto/color/ColorResponseDto.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.pwhs.quickmem.data.dto.color | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class ColorResponseDto( | ||
@SerializedName("id") | ||
val id: Int, | ||
|
||
@SerializedName("name") | ||
val name: String, | ||
|
||
@SerializedName("hexValue") | ||
val hexValue: String | ||
) |
34 changes: 34 additions & 0 deletions
34
app/src/main/java/com/pwhs/quickmem/data/dto/study_set/GetStudySetResponseDto.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,34 @@ | ||
package com.pwhs.quickmem.data.dto.study_set | ||
|
||
import com.google.gson.annotations.SerializedName | ||
import com.pwhs.quickmem.data.dto.color.ColorResponseDto | ||
import com.pwhs.quickmem.data.dto.subject.SubjectResponseDto | ||
|
||
data class GetStudySetResponseDto( | ||
@SerializedName("id") | ||
val id: String, | ||
|
||
@SerializedName("title") | ||
val title: String, | ||
|
||
@SerializedName("description") | ||
val description: String, | ||
|
||
@SerializedName("isPublic") | ||
val isPublic: Boolean, | ||
|
||
@SerializedName("createdAt") | ||
val createdAt: String, // Sử dụng String hoặc LocalDateTime | ||
|
||
@SerializedName("updatedAt") | ||
val updatedAt: String, | ||
|
||
@SerializedName("ownerId") | ||
val ownerId: String, | ||
|
||
@SerializedName("subject") | ||
val subject: SubjectResponseDto? = null, | ||
|
||
@SerializedName("color") | ||
val color: ColorResponseDto? = null | ||
) |
11 changes: 11 additions & 0 deletions
11
app/src/main/java/com/pwhs/quickmem/data/dto/subject/SubjectResponseDto.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,11 @@ | ||
package com.pwhs.quickmem.data.dto.subject | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class SubjectResponseDto( | ||
@SerializedName("id") | ||
val id: Int, | ||
|
||
@SerializedName("name") | ||
val name: String | ||
) |
16 changes: 16 additions & 0 deletions
16
app/src/main/java/com/pwhs/quickmem/data/mapper/color/ColorMapper.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 com.pwhs.quickmem.data.mapper.color | ||
|
||
import com.pwhs.quickmem.data.dto.color.ColorResponseDto | ||
import com.pwhs.quickmem.domain.model.color.ColorModel | ||
|
||
fun ColorResponseDto.toColorModel() = ColorModel( | ||
id = id, | ||
name = name, | ||
hexValue = hexValue | ||
) | ||
|
||
fun ColorModel.toColorResponseDto() = ColorResponseDto( | ||
id = id, | ||
name = name, | ||
hexValue = hexValue | ||
) |
14 changes: 14 additions & 0 deletions
14
app/src/main/java/com/pwhs/quickmem/data/mapper/subject/SubjectMapper.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.pwhs.quickmem.data.mapper.subject | ||
|
||
import com.pwhs.quickmem.data.dto.subject.SubjectResponseDto | ||
import com.pwhs.quickmem.domain.model.subject.SubjectModel | ||
|
||
fun SubjectResponseDto.toSubjectModel() = SubjectModel( | ||
id = id, | ||
name = name, | ||
) | ||
|
||
fun SubjectModel.toSubjectResponseDto() = SubjectResponseDto( | ||
id = id, | ||
name = name, | ||
) |
16 changes: 16 additions & 0 deletions
16
app/src/main/java/com/pwhs/quickmem/domain/model/study_set/GetStudySetResponseModel.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 com.pwhs.quickmem.domain.model.study_set | ||
|
||
import com.pwhs.quickmem.data.dto.color.ColorResponseDto | ||
import com.pwhs.quickmem.data.dto.subject.SubjectResponseDto | ||
|
||
data class GetStudySetResponseModel( | ||
val id: String, | ||
val title: String, | ||
val description: String, | ||
val isPublic: Boolean, | ||
val createdAt: String, | ||
val updatedAt: String, | ||
val ownerId: String, | ||
val subject: SubjectResponseDto? = null, | ||
val color: ColorResponseDto? = null | ||
) |
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