|
|
@@ -1,3 +1,4 @@
|
|
|
+import 'package:get/get.dart';
|
|
|
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
|
|
part 'talks.g.dart';
|
|
|
@@ -22,14 +23,14 @@ class TalkBean {
|
|
|
@JsonKey(name: 'characters')
|
|
|
int? characters;
|
|
|
|
|
|
- @JsonKey(name: 'status')
|
|
|
- int? status;
|
|
|
+ @JsonKey(name: 'status', fromJson: _intFromJson, includeToJson: false)
|
|
|
+ Rxn<int> status;
|
|
|
|
|
|
- @JsonKey(name: 'title')
|
|
|
- String? title;
|
|
|
+ @JsonKey(name: 'title', fromJson: _stringFromJson, includeToJson: false)
|
|
|
+ Rxn<String> title;
|
|
|
|
|
|
- @JsonKey(name: 'summary')
|
|
|
- String? summary;
|
|
|
+ @JsonKey(name: 'summary', fromJson: _stringFromJson, includeToJson: false)
|
|
|
+ Rxn<String> summary;
|
|
|
|
|
|
@JsonKey(name: 'createTime')
|
|
|
String? createTime;
|
|
|
@@ -47,9 +48,9 @@ class TalkBean {
|
|
|
this.audioUrl,
|
|
|
this.duration,
|
|
|
this.characters,
|
|
|
- this.status,
|
|
|
- this.title,
|
|
|
- this.summary,
|
|
|
+ required this.status,
|
|
|
+ required this.title,
|
|
|
+ required this.summary,
|
|
|
this.createTime,
|
|
|
this.isExample,
|
|
|
this.oversizeFile});
|
|
|
@@ -57,34 +58,22 @@ class TalkBean {
|
|
|
factory TalkBean.fromJson(Map<String, dynamic> json) =>
|
|
|
_$TalkBeanFromJson(json);
|
|
|
|
|
|
- TalkBean copyWith({
|
|
|
- String? id,
|
|
|
- String? taskId,
|
|
|
- String? ssid,
|
|
|
- String? audioUrl,
|
|
|
- double? duration,
|
|
|
- int? characters,
|
|
|
- int? status,
|
|
|
- String? title,
|
|
|
- String? summary,
|
|
|
- String? createTime,
|
|
|
- bool? isExample,
|
|
|
- bool? oversizeFile,
|
|
|
- }) {
|
|
|
- return TalkBean(
|
|
|
- id: id ?? this.id,
|
|
|
- taskId: taskId ?? this.taskId,
|
|
|
- ssid: ssid ?? this.ssid,
|
|
|
- audioUrl: audioUrl ?? this.audioUrl,
|
|
|
- duration: duration ?? this.duration,
|
|
|
- characters: characters ?? this.characters,
|
|
|
- status: status ?? this.status,
|
|
|
- title: title ?? this.title,
|
|
|
- summary: summary ?? this.summary,
|
|
|
- createTime: createTime ?? this.createTime,
|
|
|
- isExample: isExample ?? this.isExample,
|
|
|
- oversizeFile: oversizeFile ?? this.oversizeFile,
|
|
|
- );
|
|
|
+ static _stringFromJson(String? txt) => Rxn(txt);
|
|
|
+
|
|
|
+ static _intFromJson(int? txt) => Rxn(txt);
|
|
|
+
|
|
|
+ void updateBean(TalkBean talkBean) {
|
|
|
+ taskId = talkBean.taskId;
|
|
|
+ ssid = talkBean.ssid;
|
|
|
+ audioUrl = talkBean.audioUrl;
|
|
|
+ duration = talkBean.duration;
|
|
|
+ characters = talkBean.characters;
|
|
|
+ status.value = talkBean.status.value;
|
|
|
+ title.value = talkBean.title.value;
|
|
|
+ summary.value = talkBean.summary.value;
|
|
|
+ createTime = talkBean.createTime;
|
|
|
+ isExample = talkBean.isExample;
|
|
|
+ oversizeFile = talkBean.oversizeFile;
|
|
|
}
|
|
|
}
|
|
|
|