upload_info.dart 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import 'package:json_annotation/json_annotation.dart';
  2. part 'upload_info.g.dart';
  3. /// 上传信息
  4. @JsonSerializable()
  5. class UploadInfo {
  6. /// 唯一id
  7. @JsonKey(name: "id")
  8. String? id;
  9. /// 文件名称
  10. @JsonKey(name: "fileName")
  11. String? fileName;
  12. /// 文件的绝对路径
  13. @JsonKey(name: "filePath")
  14. String? filePath;
  15. /// 文件场景类型
  16. @JsonKey(name: "uploadSceneType")
  17. String? uploadSceneType;
  18. /// 上传状态
  19. @JsonKey(name: "uploadState")
  20. String? uploadState;
  21. /// 文件的远程访问Url,上传成功后赋值
  22. @JsonKey(name: "fileUrl")
  23. String? fileUrl;
  24. /// 文件的cdn前缀,上传成功后赋值
  25. @JsonKey(name: "fileUrlCdnPrefix")
  26. String? fileUrlCdnPrefix;
  27. /// 后端需要用的路径,不包含cdn前缀
  28. @JsonKey(name: "fileBackendPath")
  29. String? fileBackendPath;
  30. UploadInfo({
  31. this.id,
  32. this.fileName,
  33. this.filePath,
  34. this.uploadSceneType,
  35. this.uploadState,
  36. this.fileBackendPath,
  37. });
  38. Map<String, dynamic> toJson() => _$UploadInfoToJson(this);
  39. factory UploadInfo.fromJson(Map<String, dynamic> json) =>
  40. _$UploadInfoFromJson(json);
  41. }