opt: unify trending api & feat: search recommend (#694)

* opt: unify trending api

* opt: disable icon

* feat: search recommend

* mod: recommend api
This commit is contained in:
My-Responsitories
2025-04-16 12:16:45 +08:00
committed by GitHub
parent 3638d65008
commit f0e3b776bb
18 changed files with 285 additions and 452 deletions

View File

@@ -1,47 +1,28 @@
class TrendingList {
int? position;
class SearchKeywordList {
String? keyword;
String? showName;
int? wordType;
String? icon;
bool? showLiveIcon;
SearchKeywordList.fromJson(Map<String, dynamic> json) {
keyword = json['keyword'] as String?;
}
}
class TrendingList extends SearchKeywordList {
String? showName;
// 4/5热 11话题 8普通 7直播
int? wordType;
int? hotId;
String? isCommercial;
int? resourceId;
bool? showLiveIcon;
TrendingList({
this.position,
this.keyword,
this.showName,
this.wordType,
this.icon,
this.hotId,
this.isCommercial,
this.resourceId,
this.showLiveIcon,
});
factory TrendingList.fromJson(Map<String, dynamic> json) => TrendingList(
position: json['position'] as int?,
keyword: json['keyword'] as String?,
showName: json['show_name'] as String?,
wordType: json['word_type'] as int?,
icon: json['icon'] as String?,
hotId: json['hot_id'] as int?,
isCommercial: json['is_commercial'] as String?,
resourceId: json['resource_id'] as int?,
showLiveIcon: json['show_live_icon'] as bool?,
);
Map<String, dynamic> toJson() => {
'position': position,
'keyword': keyword,
'show_name': showName,
'word_type': wordType,
'icon': icon,
'hot_id': hotId,
'is_commercial': isCommercial,
'resource_id': resourceId,
'show_live_icon': showLiveIcon,
};
TrendingList.fromJson(Map<String, dynamic> json) : super.fromJson(json) {
showName = json['show_name'] as String?;
wordType = json['word_type'] as int?;
icon = json['icon'] as String?;
hotId = json['hot_id'] as int?;
isCommercial = json['is_commercial'] as String?;
resourceId = json['resource_id'] as int?;
showLiveIcon = json['show_live_icon'] as bool?;
}
}