Skip to content

Commit a0ddad6

Browse files
committed
Refactor field name of SubjectRecommendation.
1 parent d765835 commit a0ddad6

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

app/shared/app-data/src/commonMain/kotlin/domain/episode/GetSubjectRecommendationFlowUseCase.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class SubjectRecommendation(
1717
val subjectId: Long?,
1818
val name: String,
1919
val nameCn: String?,
20-
val airingDateDesc: String,
21-
val ratingDesc: String,
20+
val primaryDesc: String,
21+
val secondaryDesc: String,
2222
val imageUrl: String,
2323
val uri: String?,
2424
)
@@ -34,8 +34,8 @@ class GetSubjectRecommendationUseCaseImpl(private val service: SubjectService) :
3434
subjectId = it.subjectId,
3535
name = it.subjectName,
3636
nameCn = it.subjectNameCn,
37-
airingDateDesc = it.primaryDesc,
38-
ratingDesc = it.secondaryDesc,
37+
primaryDesc = it.primaryDesc,
38+
secondaryDesc = it.secondaryDesc,
3939
imageUrl = it.imageUrl,
4040
uri = it.uri,
4141
)

app/shared/src/commonMain/kotlin/ui/subject/episode/details/components/SubjectRecommendationItem.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@ fun SubjectRecommendationItem(
5858

5959
Column {
6060
Text(
61-
item.airingDateDesc,
61+
item.primaryDesc,
6262
style = MaterialTheme.typography.bodySmall,
6363
color = MaterialTheme.colorScheme.onSurfaceVariant,
6464
maxLines = 1,
6565
overflow = TextOverflow.Ellipsis,
6666
)
6767
Text(
68-
item.ratingDesc,
68+
item.secondaryDesc,
6969
style = MaterialTheme.typography.bodySmall,
7070
color = MaterialTheme.colorScheme.onSurfaceVariant,
7171
maxLines = 1,

app/shared/ui-subject/src/androidMain/kotlin/ui/subject/episode/details/TestEpisodes.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ val TestSubjectRecommendations = buildList {
6565
nameCn = "推荐条目中文名称 $it",
6666
imageUrl = "",
6767
uri = null,
68-
airingDateDesc = "2021 年 10 月",
69-
ratingDesc = "2 万收藏 · 8.0 分",
68+
primaryDesc = "2021 年 10 月",
69+
secondaryDesc = "2 万收藏 · 8.0 分",
7070
),
7171
)
7272
}

0 commit comments

Comments
 (0)