talks.dart 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. import 'package:json_annotation/json_annotation.dart';
  2. part 'talks.g.dart';
  3. @JsonSerializable()
  4. class TalkBean {
  5. @JsonKey(name: 'id')
  6. late final String id;
  7. @JsonKey(name: 'taskId')
  8. String? taskId;
  9. @JsonKey(name: 'ssid')
  10. String? ssid;
  11. @JsonKey(name: 'audioUrl')
  12. String? audioUrl;
  13. @JsonKey(name: 'duration')
  14. double? duration;
  15. @JsonKey(name: 'characters')
  16. int? characters;
  17. @JsonKey(name: 'status')
  18. int? status;
  19. @JsonKey(name: 'title')
  20. String? title;
  21. @JsonKey(name: 'summary')
  22. String? summary;
  23. @JsonKey(name: 'createTime')
  24. String? createTime;
  25. @JsonKey(name: 'example')
  26. bool? isExample;
  27. @JsonKey(name: 'oversizeFile')
  28. bool? oversizeFile;
  29. TalkBean(
  30. {required this.id,
  31. this.taskId,
  32. this.ssid,
  33. this.audioUrl,
  34. this.duration,
  35. this.characters,
  36. this.status,
  37. this.title,
  38. this.summary,
  39. this.createTime,
  40. this.isExample,
  41. this.oversizeFile});
  42. factory TalkBean.fromJson(Map<String, dynamic> json) =>
  43. _$TalkBeanFromJson(json);
  44. TalkBean copyWith({
  45. String? id,
  46. String? taskId,
  47. String? ssid,
  48. String? audioUrl,
  49. double? duration,
  50. int? characters,
  51. int? status,
  52. String? title,
  53. String? summary,
  54. String? createTime,
  55. bool? isExample,
  56. bool? oversizeFile,
  57. }) {
  58. return TalkBean(
  59. id: id ?? this.id,
  60. taskId: taskId ?? this.taskId,
  61. ssid: ssid ?? this.ssid,
  62. audioUrl: audioUrl ?? this.audioUrl,
  63. duration: duration ?? this.duration,
  64. characters: characters ?? this.characters,
  65. status: status ?? this.status,
  66. title: title ?? this.title,
  67. summary: summary ?? this.summary,
  68. createTime: createTime ?? this.createTime,
  69. isExample: isExample ?? this.isExample,
  70. oversizeFile: oversizeFile ?? this.oversizeFile,
  71. );
  72. }
  73. }
  74. class TalkStatus {
  75. TalkStatus._();
  76. //(0等待生成 1生成中,都处于生成中) 2成功 3失败 4未分析
  77. static int analysing = 0;
  78. static int waitAnalysis = 1;
  79. static int analysisSuccess = 2;
  80. static int analysisFail = 3;
  81. static int notAnalysis = 4;
  82. }