Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ package team.retum.common.enums
enum class AttachmentType {
FILE,
URL,
NONE,
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private fun FetchRecruitmentsResponse.RecruitmentResponse.toEntity() =
false -> MilitarySupport.FALSE
else -> null
},
hiringJobs = this.hiringJobs,
hiringJobs = this.hiringJobs.orEmpty(),
bookmarked = this.bookmarked,
status = this.status,
year = this.year,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ private fun FetchAppliedCompaniesResponse.ApplicationResponse.toEntity() =
private fun FetchAppliedCompaniesResponse.ApplicationResponse.AttachmentResponse.toEntity() =
AppliedCompaniesEntity.ApplicationEntity.AttachmentEntity(
url = this.url,
type = this.attachmentType,
type = AttachmentType.entries.find { it.name == this.attachmentType } ?: AttachmentType.NONE,
)
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ data class BannersEntity(
@Immutable
data class BannerEntity(
val bannerId: Long,
val bannerUrl: String,
val title: String,
val content: String,
val bannerType: BannerType,
val detailId: Long,
)
Expand All @@ -22,7 +23,8 @@ internal fun FetchBannersResponse.toEntity() = BannersEntity(

private fun FetchBannersResponse.BannerResponse.toEntity() = BannersEntity.BannerEntity(
bannerId = this.bannerId,
bannerUrl = this.bannerUrl,
title = this.title.orEmpty(),
content = this.content.orEmpty(),
bannerType = this.bannerType,
detailId = this.detailId,
)
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ data class FetchRecruitmentsResponse(
@Json(name = "company_profile_url") val companyProfileUrl: String,
@Json(name = "train_pay") val trainPay: Long,
@Json(name = "military_support") val militarySupport: Boolean?,
@Json(name = "hiring_jobs") val hiringJobs: String,
@Json(name = "hiring_jobs") val hiringJobs: String?,
@Json(name = "bookmarked") val bookmarked: Boolean,
@Json(name = "status") val status: RecruitmentStatus?,
@Json(name = "year") val year: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package team.retum.network.model.response.application
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import team.retum.common.enums.ApplyStatus
import team.retum.common.enums.AttachmentType

@JsonClass(generateAdapter = true)
data class FetchAppliedCompaniesResponse(
Expand All @@ -21,7 +20,7 @@ data class FetchAppliedCompaniesResponse(
@JsonClass(generateAdapter = true)
data class AttachmentResponse(
@Json(name = "url") val url: String,
@Json(name = "type") val attachmentType: AttachmentType,
@Json(name = "type") val attachmentType: String,
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ data class FetchBannersResponse(
@JsonClass(generateAdapter = true)
data class BannerResponse(
@Json(name = "id") val bannerId: Long,
@Json(name = "banner_url") val bannerUrl: String,
@Json(name = "title") val title: String?,
@Json(name = "content") val content: String?,
@Json(name = "banner_type") val bannerType: BannerType,
@Json(name = "detail_id") val detailId: Long,
)
Expand Down
24 changes: 20 additions & 4 deletions feature/home/src/main/java/team/retum/home/ui/HomeScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,26 @@ private fun Banner(
onEmploymentClick = onEmploymentClick,
)
} else {
AsyncImage(
model = banners.getOrNull(page - 1)?.bannerUrl,
contentDescription = "banner",
)
val banner = banners.getOrNull(page - 1)
Column(
modifier = Modifier
.fillMaxWidth()
.height(150.dp)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
.padding(24.dp),
verticalArrangement = Arrangement.Center,
) {
JobisText(
text = banner?.title.orEmpty(),
style = JobisTypography.SubHeadLine,
color = JobisTheme.colors.onSurface,
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
)
Spacer(modifier = Modifier.height(4.dp))
JobisText(
text = banner?.content.orEmpty(),
style = JobisTypography.Description,
color = JobisTheme.colors.onSurfaceVariant,
)
}
}
}
}
Expand Down
Loading