vitalDictionary.m.dart 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. import 'liveConsultation.m.dart';
  2. import 'notification.m.dart';
  3. import 'device.m.dart';
  4. enum DictionaryTypeEnum2 {
  5. Default,
  6. Label,
  7. Menu,
  8. DynamicType,
  9. }
  10. class CreateDictionaryRequest extends TokenRequest{
  11. String? code;
  12. String? key;
  13. String? name;
  14. DictionaryTypeEnum2 type;
  15. String? description;
  16. CreateDictionaryRequest({
  17. this.code,
  18. this.key,
  19. this.name,
  20. this.type = DictionaryTypeEnum2.Default,
  21. this.description,
  22. String? token,
  23. }) : super(
  24. token: token,
  25. );
  26. factory CreateDictionaryRequest.fromJson(Map<String, dynamic> map) {
  27. return CreateDictionaryRequest(
  28. code: map['Code'],
  29. key: map['Key'],
  30. name: map['Name'],
  31. type: DictionaryTypeEnum2.values.firstWhere((e) => e.index == map['Type']),
  32. description: map['Description'],
  33. token: map['Token'],
  34. );
  35. }
  36. Map<String, dynamic> toJson() {
  37. final map = super.toJson();
  38. if (code != null)
  39. map['Code'] = code;
  40. if (key != null)
  41. map['Key'] = key;
  42. if (name != null)
  43. map['Name'] = name;
  44. map['Type'] = type.index;
  45. if (description != null)
  46. map['Description'] = description;
  47. return map;
  48. }
  49. }
  50. class DictionaryDTO2 extends BaseDTO{
  51. String? code;
  52. String? key;
  53. String? name;
  54. DictionaryTypeEnum2 type;
  55. String? description;
  56. DictionaryDTO2({
  57. this.code,
  58. this.key,
  59. this.name,
  60. this.type = DictionaryTypeEnum2.Default,
  61. this.description,
  62. DateTime? createTime,
  63. DateTime? updateTime,
  64. }) : super(
  65. createTime: createTime,
  66. updateTime: updateTime,
  67. );
  68. factory DictionaryDTO2.fromJson(Map<String, dynamic> map) {
  69. return DictionaryDTO2(
  70. code: map['Code'],
  71. key: map['Key'],
  72. name: map['Name'],
  73. type: DictionaryTypeEnum2.values.firstWhere((e) => e.index == map['Type']),
  74. description: map['Description'],
  75. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  76. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  77. );
  78. }
  79. Map<String, dynamic> toJson() {
  80. final map = super.toJson();
  81. if (code != null)
  82. map['Code'] = code;
  83. if (key != null)
  84. map['Key'] = key;
  85. if (name != null)
  86. map['Name'] = name;
  87. map['Type'] = type.index;
  88. if (description != null)
  89. map['Description'] = description;
  90. return map;
  91. }
  92. }
  93. class GetDictionaryRequest extends TokenRequest{
  94. String? code;
  95. GetDictionaryRequest({
  96. this.code,
  97. String? token,
  98. }) : super(
  99. token: token,
  100. );
  101. factory GetDictionaryRequest.fromJson(Map<String, dynamic> map) {
  102. return GetDictionaryRequest(
  103. code: map['Code'],
  104. token: map['Token'],
  105. );
  106. }
  107. Map<String, dynamic> toJson() {
  108. final map = super.toJson();
  109. if (code != null)
  110. map['Code'] = code;
  111. return map;
  112. }
  113. }
  114. class GetDictionaryByKeyRequest extends TokenRequest{
  115. String? key;
  116. String? value;
  117. GetDictionaryByKeyRequest({
  118. this.key,
  119. this.value,
  120. String? token,
  121. }) : super(
  122. token: token,
  123. );
  124. factory GetDictionaryByKeyRequest.fromJson(Map<String, dynamic> map) {
  125. return GetDictionaryByKeyRequest(
  126. key: map['Key'],
  127. value: map['Value'],
  128. token: map['Token'],
  129. );
  130. }
  131. Map<String, dynamic> toJson() {
  132. final map = super.toJson();
  133. if (key != null)
  134. map['Key'] = key;
  135. if (value != null)
  136. map['Value'] = value;
  137. return map;
  138. }
  139. }
  140. class DictionaryPageRequest extends PageRequest{
  141. DictionaryPageRequest({
  142. int pageIndex = 0,
  143. int pageSize = 0,
  144. String? token,
  145. }) : super(
  146. pageIndex: pageIndex,
  147. pageSize: pageSize,
  148. token: token,
  149. );
  150. factory DictionaryPageRequest.fromJson(Map<String, dynamic> map) {
  151. return DictionaryPageRequest(
  152. pageIndex: map['PageIndex'],
  153. pageSize: map['PageSize'],
  154. token: map['Token'],
  155. );
  156. }
  157. Map<String, dynamic> toJson() {
  158. final map = super.toJson();
  159. return map;
  160. }
  161. }
  162. class RemoveDictionaryRequest extends TokenRequest{
  163. String? code;
  164. RemoveDictionaryRequest({
  165. this.code,
  166. String? token,
  167. }) : super(
  168. token: token,
  169. );
  170. factory RemoveDictionaryRequest.fromJson(Map<String, dynamic> map) {
  171. return RemoveDictionaryRequest(
  172. code: map['Code'],
  173. token: map['Token'],
  174. );
  175. }
  176. Map<String, dynamic> toJson() {
  177. final map = super.toJson();
  178. if (code != null)
  179. map['Code'] = code;
  180. return map;
  181. }
  182. }
  183. class GetDictionaryListRequest extends TokenRequest{
  184. List<String>? codes;
  185. GetDictionaryListRequest({
  186. this.codes,
  187. String? token,
  188. }) : super(
  189. token: token,
  190. );
  191. factory GetDictionaryListRequest.fromJson(Map<String, dynamic> map) {
  192. return GetDictionaryListRequest(
  193. codes: map['Codes']?.cast<String>().toList(),
  194. token: map['Token'],
  195. );
  196. }
  197. Map<String, dynamic> toJson() {
  198. final map = super.toJson();
  199. if (codes != null)
  200. map['Codes'] = codes;
  201. return map;
  202. }
  203. }
  204. class UpdateDictionaryRequest extends TokenRequest{
  205. String? code;
  206. String? key;
  207. String? name;
  208. DictionaryTypeEnum2 type;
  209. String? description;
  210. UpdateDictionaryRequest({
  211. this.code,
  212. this.key,
  213. this.name,
  214. this.type = DictionaryTypeEnum2.Default,
  215. this.description,
  216. String? token,
  217. }) : super(
  218. token: token,
  219. );
  220. factory UpdateDictionaryRequest.fromJson(Map<String, dynamic> map) {
  221. return UpdateDictionaryRequest(
  222. code: map['Code'],
  223. key: map['Key'],
  224. name: map['Name'],
  225. type: DictionaryTypeEnum2.values.firstWhere((e) => e.index == map['Type']),
  226. description: map['Description'],
  227. token: map['Token'],
  228. );
  229. }
  230. Map<String, dynamic> toJson() {
  231. final map = super.toJson();
  232. if (code != null)
  233. map['Code'] = code;
  234. if (key != null)
  235. map['Key'] = key;
  236. if (name != null)
  237. map['Name'] = name;
  238. map['Type'] = type.index;
  239. if (description != null)
  240. map['Description'] = description;
  241. return map;
  242. }
  243. }
  244. class DictionaryWithUnitDTO extends DictionaryDTO2{
  245. String? unit;
  246. DictionaryWithUnitDTO({
  247. this.unit,
  248. String? code,
  249. String? key,
  250. String? name,
  251. DictionaryTypeEnum2 type = DictionaryTypeEnum2.Default,
  252. String? description,
  253. DateTime? createTime,
  254. DateTime? updateTime,
  255. }) : super(
  256. code: code,
  257. key: key,
  258. name: name,
  259. type: type,
  260. description: description,
  261. createTime: createTime,
  262. updateTime: updateTime,
  263. );
  264. factory DictionaryWithUnitDTO.fromJson(Map<String, dynamic> map) {
  265. return DictionaryWithUnitDTO(
  266. unit: map['Unit'],
  267. code: map['Code'],
  268. key: map['Key'],
  269. name: map['Name'],
  270. type: DictionaryTypeEnum2.values.firstWhere((e) => e.index == map['Type']),
  271. description: map['Description'],
  272. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  273. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  274. );
  275. }
  276. Map<String, dynamic> toJson() {
  277. final map = super.toJson();
  278. if (unit != null)
  279. map['Unit'] = unit;
  280. return map;
  281. }
  282. }
  283. class GetDictionaryNameAndUnitByKeysRequest extends TokenRequest{
  284. List<String>? keys;
  285. GetDictionaryNameAndUnitByKeysRequest({
  286. this.keys,
  287. String? token,
  288. }) : super(
  289. token: token,
  290. );
  291. factory GetDictionaryNameAndUnitByKeysRequest.fromJson(Map<String, dynamic> map) {
  292. return GetDictionaryNameAndUnitByKeysRequest(
  293. keys: map['Keys']?.cast<String>().toList(),
  294. token: map['Token'],
  295. );
  296. }
  297. Map<String, dynamic> toJson() {
  298. final map = super.toJson();
  299. if (keys != null)
  300. map['Keys'] = keys;
  301. return map;
  302. }
  303. }