From c31a9e547feccbf8d2182f7cdc07b06819fe4469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=AA=85=ED=9B=88?= Date: Sat, 30 Nov 2024 23:19:14 +0900 Subject: [PATCH] :recycle: :: Apply API Changed --- .../training/TrainingProgramListResponseEntity.kt | 15 ++++++--------- .../response/TrainingProgramListResponse.kt | 15 ++++++--------- .../response/TrainingProgramListResponseMapper.kt | 10 +++------- 3 files changed, 15 insertions(+), 25 deletions(-) diff --git a/core/model/src/main/java/com/school_of_company/model/entity/training/TrainingProgramListResponseEntity.kt b/core/model/src/main/java/com/school_of_company/model/entity/training/TrainingProgramListResponseEntity.kt index af980f07..443e2b88 100644 --- a/core/model/src/main/java/com/school_of_company/model/entity/training/TrainingProgramListResponseEntity.kt +++ b/core/model/src/main/java/com/school_of_company/model/entity/training/TrainingProgramListResponseEntity.kt @@ -1,12 +1,9 @@ package com.school_of_company.model.entity.training data class TrainingProgramListResponseEntity( - val essential: List, - val choice: List -) { - data class Training( - val title: String, - val startedAt: String, - val endedAt: String, - ) -} + val id: Long, + val title: String, + val startedAt: String, + val endedAt: String, + val category: String +) diff --git a/core/network/src/main/java/com/school_of_company/network/dto/training/response/TrainingProgramListResponse.kt b/core/network/src/main/java/com/school_of_company/network/dto/training/response/TrainingProgramListResponse.kt index 33330677..d788859d 100644 --- a/core/network/src/main/java/com/school_of_company/network/dto/training/response/TrainingProgramListResponse.kt +++ b/core/network/src/main/java/com/school_of_company/network/dto/training/response/TrainingProgramListResponse.kt @@ -5,12 +5,9 @@ import com.squareup.moshi.JsonClass @JsonClass(generateAdapter = true) data class TrainingProgramListResponse( - @Json(name = "essential") val essential: List, - @Json(name = "choice") val choice: List -) { - data class Training( - @Json(name = "title") val title: String, - @Json(name = "startedAt") val startedAt: String, - @Json(name = "endedAt") val endedAt: String - ) -} \ No newline at end of file + @Json(name = "id") val id: Long, + @Json(name = "title") val title: String, + @Json(name = "startedAt") val startedAt: String, + @Json(name = "endedAt") val endedAt: String, + @Json(name = "category") val category: String, +) \ No newline at end of file diff --git a/core/network/src/main/java/com/school_of_company/network/mapper/training/response/TrainingProgramListResponseMapper.kt b/core/network/src/main/java/com/school_of_company/network/mapper/training/response/TrainingProgramListResponseMapper.kt index abeb5b3d..ca12593e 100644 --- a/core/network/src/main/java/com/school_of_company/network/mapper/training/response/TrainingProgramListResponseMapper.kt +++ b/core/network/src/main/java/com/school_of_company/network/mapper/training/response/TrainingProgramListResponseMapper.kt @@ -6,13 +6,9 @@ import com.squareup.moshi.Json fun TrainingProgramListResponse.toEntity(): TrainingProgramListResponseEntity = TrainingProgramListResponseEntity( - essential = this.essential.map { it.toEntity() }, - choice = this.choice.map { it.toEntity() } - ) - -fun TrainingProgramListResponse.Training.toEntity(): TrainingProgramListResponseEntity.Training = - TrainingProgramListResponseEntity.Training( + id = this.id, title = this.title, startedAt = this.startedAt, - endedAt = this.endedAt + endedAt = this.endedAt, + category = this.category ) \ No newline at end of file