vitalResidence.m.dart 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. import 'liveConsultation.m.dart';
  2. import 'notification.m.dart';
  3. import 'device.m.dart';
  4. class CreateResidenceRequest extends TokenRequest{
  5. String? code;
  6. String? townCode;
  7. String? name;
  8. CreateResidenceRequest({
  9. this.code,
  10. this.townCode,
  11. this.name,
  12. String? token,
  13. }) : super(
  14. token: token,
  15. );
  16. factory CreateResidenceRequest.fromJson(Map<String, dynamic> map) {
  17. return CreateResidenceRequest(
  18. code: map['Code'],
  19. townCode: map['TownCode'],
  20. name: map['Name'],
  21. token: map['Token'],
  22. );
  23. }
  24. Map<String, dynamic> toJson() {
  25. final map = super.toJson();
  26. if (code != null)
  27. map['Code'] = code;
  28. if (townCode != null)
  29. map['TownCode'] = townCode;
  30. if (name != null)
  31. map['Name'] = name;
  32. return map;
  33. }
  34. }
  35. class ResidenceDTO extends BaseDTO{
  36. String? code;
  37. String? provinceCode;
  38. String? cityCode;
  39. String? districtCode;
  40. String? townName;
  41. String? townCode;
  42. String? name;
  43. ResidenceDTO({
  44. this.code,
  45. this.provinceCode,
  46. this.cityCode,
  47. this.districtCode,
  48. this.townName,
  49. this.townCode,
  50. this.name,
  51. DateTime? createTime,
  52. DateTime? updateTime,
  53. }) : super(
  54. createTime: createTime,
  55. updateTime: updateTime,
  56. );
  57. factory ResidenceDTO.fromJson(Map<String, dynamic> map) {
  58. return ResidenceDTO(
  59. code: map['Code'],
  60. provinceCode: map['ProvinceCode'],
  61. cityCode: map['CityCode'],
  62. districtCode: map['DistrictCode'],
  63. townName: map['TownName'],
  64. townCode: map['TownCode'],
  65. name: map['Name'],
  66. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  67. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  68. );
  69. }
  70. Map<String, dynamic> toJson() {
  71. final map = super.toJson();
  72. if (code != null)
  73. map['Code'] = code;
  74. if (provinceCode != null)
  75. map['ProvinceCode'] = provinceCode;
  76. if (cityCode != null)
  77. map['CityCode'] = cityCode;
  78. if (districtCode != null)
  79. map['DistrictCode'] = districtCode;
  80. if (townName != null)
  81. map['TownName'] = townName;
  82. if (townCode != null)
  83. map['TownCode'] = townCode;
  84. if (name != null)
  85. map['Name'] = name;
  86. return map;
  87. }
  88. }
  89. class GetResidenceRequest extends TokenRequest{
  90. String? code;
  91. GetResidenceRequest({
  92. this.code,
  93. String? token,
  94. }) : super(
  95. token: token,
  96. );
  97. factory GetResidenceRequest.fromJson(Map<String, dynamic> map) {
  98. return GetResidenceRequest(
  99. code: map['Code'],
  100. token: map['Token'],
  101. );
  102. }
  103. Map<String, dynamic> toJson() {
  104. final map = super.toJson();
  105. if (code != null)
  106. map['Code'] = code;
  107. return map;
  108. }
  109. }
  110. class GetResidenceByKeyRequest extends TokenRequest{
  111. String? key;
  112. String? value;
  113. GetResidenceByKeyRequest({
  114. this.key,
  115. this.value,
  116. String? token,
  117. }) : super(
  118. token: token,
  119. );
  120. factory GetResidenceByKeyRequest.fromJson(Map<String, dynamic> map) {
  121. return GetResidenceByKeyRequest(
  122. key: map['Key'],
  123. value: map['Value'],
  124. token: map['Token'],
  125. );
  126. }
  127. Map<String, dynamic> toJson() {
  128. final map = super.toJson();
  129. if (key != null)
  130. map['Key'] = key;
  131. if (value != null)
  132. map['Value'] = value;
  133. return map;
  134. }
  135. }
  136. class ResidencePageRequest extends PageRequest{
  137. ResidencePageRequest({
  138. int pageIndex = 0,
  139. int pageSize = 0,
  140. String? token,
  141. }) : super(
  142. pageIndex: pageIndex,
  143. pageSize: pageSize,
  144. token: token,
  145. );
  146. factory ResidencePageRequest.fromJson(Map<String, dynamic> map) {
  147. return ResidencePageRequest(
  148. pageIndex: map['PageIndex'],
  149. pageSize: map['PageSize'],
  150. token: map['Token'],
  151. );
  152. }
  153. Map<String, dynamic> toJson() {
  154. final map = super.toJson();
  155. return map;
  156. }
  157. }
  158. class RemoveResidenceRequest extends TokenRequest{
  159. String? code;
  160. RemoveResidenceRequest({
  161. this.code,
  162. String? token,
  163. }) : super(
  164. token: token,
  165. );
  166. factory RemoveResidenceRequest.fromJson(Map<String, dynamic> map) {
  167. return RemoveResidenceRequest(
  168. code: map['Code'],
  169. token: map['Token'],
  170. );
  171. }
  172. Map<String, dynamic> toJson() {
  173. final map = super.toJson();
  174. if (code != null)
  175. map['Code'] = code;
  176. return map;
  177. }
  178. }
  179. class GetResidenceListRequest extends TokenRequest{
  180. List<String>? codes;
  181. GetResidenceListRequest({
  182. this.codes,
  183. String? token,
  184. }) : super(
  185. token: token,
  186. );
  187. factory GetResidenceListRequest.fromJson(Map<String, dynamic> map) {
  188. return GetResidenceListRequest(
  189. codes: map['Codes']?.cast<String>().toList(),
  190. token: map['Token'],
  191. );
  192. }
  193. Map<String, dynamic> toJson() {
  194. final map = super.toJson();
  195. if (codes != null)
  196. map['Codes'] = codes;
  197. return map;
  198. }
  199. }
  200. class UpdateResidenceRequest extends TokenRequest{
  201. String? code;
  202. String? townCode;
  203. String? name;
  204. UpdateResidenceRequest({
  205. this.code,
  206. this.townCode,
  207. this.name,
  208. String? token,
  209. }) : super(
  210. token: token,
  211. );
  212. factory UpdateResidenceRequest.fromJson(Map<String, dynamic> map) {
  213. return UpdateResidenceRequest(
  214. code: map['Code'],
  215. townCode: map['TownCode'],
  216. name: map['Name'],
  217. token: map['Token'],
  218. );
  219. }
  220. Map<String, dynamic> toJson() {
  221. final map = super.toJson();
  222. if (code != null)
  223. map['Code'] = code;
  224. if (townCode != null)
  225. map['TownCode'] = townCode;
  226. if (name != null)
  227. map['Name'] = name;
  228. return map;
  229. }
  230. }
  231. class GetResidencePageByTownRequest extends PageRequest{
  232. String? townCode;
  233. GetResidencePageByTownRequest({
  234. this.townCode,
  235. int pageIndex = 0,
  236. int pageSize = 0,
  237. String? token,
  238. }) : super(
  239. pageIndex: pageIndex,
  240. pageSize: pageSize,
  241. token: token,
  242. );
  243. factory GetResidencePageByTownRequest.fromJson(Map<String, dynamic> map) {
  244. return GetResidencePageByTownRequest(
  245. townCode: map['TownCode'],
  246. pageIndex: map['PageIndex'],
  247. pageSize: map['PageSize'],
  248. token: map['Token'],
  249. );
  250. }
  251. Map<String, dynamic> toJson() {
  252. final map = super.toJson();
  253. if (townCode != null)
  254. map['TownCode'] = townCode;
  255. return map;
  256. }
  257. }