index.dart 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. import '../../values/index.dart';
  2. class O2SearchV2Form {
  3. int? page;
  4. String? query;
  5. int? size;
  6. O2SearchV2Form({this.page, this.query, this.size = O2.o2DefaultPageSize});
  7. Map<String, dynamic> toJson() => {
  8. "page": page,
  9. "query": query,
  10. "size": size,
  11. };
  12. }
  13. class O2SearchV2PageModel {
  14. List<O2SearchV2Entry>? documentList;
  15. int? count;
  16. O2SearchV2PageModel({this.documentList, this.count});
  17. factory O2SearchV2PageModel.fromJson(Map<String, dynamic> map) =>
  18. O2SearchV2PageModel(
  19. count: map['count'],
  20. documentList: map['documentList'] == null
  21. ? []
  22. : List<O2SearchV2Entry>.from(
  23. map['documentList'].map((e) => O2SearchV2Entry.fromJson(e))),
  24. );
  25. Map<String, dynamic> toJson() => {
  26. "count": count,
  27. "documentList": documentList == null
  28. ? []
  29. : List<Map<String, dynamic>>.from(
  30. documentList!.map((e) => e.toJson()))
  31. };
  32. }
  33. class O2SearchV2Entry {
  34. String? id; // 业务id
  35. String? category; // cms processPlatform
  36. String? title;
  37. String? highlighting; // html
  38. String? summary; // 文字
  39. String? creatorPerson;
  40. String? creatorUnit;
  41. String? indexTime;
  42. String? createTime;
  43. String? updateTime;
  44. O2SearchV2Entry(
  45. {this.id,
  46. this.category,
  47. this.title,
  48. this.highlighting,
  49. this.summary,
  50. this.creatorPerson,
  51. this.creatorUnit,
  52. this.indexTime,
  53. this.createTime,
  54. this.updateTime});
  55. factory O2SearchV2Entry.fromJson(Map<String, dynamic> map) => O2SearchV2Entry(
  56. id: map['id'],
  57. category: map['category'],
  58. title: map['title'],
  59. highlighting: map['highlighting'],
  60. summary: map['summary'],
  61. creatorPerson: map['creatorPerson'],
  62. creatorUnit: map['creatorUnit'],
  63. indexTime: map['indexTime'],
  64. createTime: map['createTime'],
  65. updateTime: map['updateTime'],
  66. );
  67. Map<String, dynamic> toJson() => {
  68. "id": id,
  69. "category": category,
  70. "title": title,
  71. "highlighting": highlighting,
  72. "summary": summary,
  73. "creatorPerson": creatorPerson,
  74. "creatorUnit": creatorUnit,
  75. "indexTime": indexTime,
  76. "createTime": createTime,
  77. "updateTime": updateTime,
  78. };
  79. }