user_response_entity_helper.dart 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. import 'package:deus_app/model/user_response_entity.dart';
  2. userResponseEntityFromJson(UserResponseEntity data, Map<String, dynamic> json) {
  3. if (json['code'] != null) {
  4. data.code = json['code'] is String
  5. ? int.tryParse(json['code'])
  6. : json['code'].toInt();
  7. }
  8. if (json['data'] != null) {
  9. data.data = UserResponseData().fromJson(json['data']);
  10. }
  11. if (json['msg'] != null) {
  12. data.msg = json['msg'].toString();
  13. }
  14. return data;
  15. }
  16. Map<String, dynamic> userResponseEntityToJson(UserResponseEntity entity) {
  17. final Map<String, dynamic> data = new Map<String, dynamic>();
  18. data['code'] = entity.code;
  19. data['data'] = entity.data.toJson();
  20. data['msg'] = entity.msg;
  21. return data;
  22. }
  23. userResponseDataFromJson(UserResponseData data, Map<String, dynamic> json) {
  24. if (json['id'] != null) {
  25. data.id = json['id'] is String
  26. ? int.tryParse(json['id'])
  27. : json['id'].toInt();
  28. }
  29. if (json['accId'] != null) {
  30. data.accId = json['accId'] is String
  31. ? int.tryParse(json['accId'])
  32. : json['accId'].toInt();
  33. }
  34. if (json['name'] != null) {
  35. data.name = json['name'].toString();
  36. }
  37. if (json['phone'] != null) {
  38. data.phone = json['phone'].toString();
  39. }
  40. if (json['password'] != null) {
  41. data.password = json['password'];
  42. }
  43. if (json['enable'] != null) {
  44. data.enable = json['enable'] is String
  45. ? int.tryParse(json['enable'])
  46. : json['enable'].toInt();
  47. }
  48. if (json['isDelete'] != null) {
  49. data.isDelete = json['isDelete'] is String
  50. ? int.tryParse(json['isDelete'])
  51. : json['isDelete'].toInt();
  52. }
  53. if (json['orgType'] != null) {
  54. data.orgType = json['orgType'] is String
  55. ? int.tryParse(json['orgType'])
  56. : json['orgType'].toInt();
  57. }
  58. if (json['orgName'] != null) {
  59. data.orgName = json['orgName'].toString();
  60. }
  61. if (json['orgId'] != null) {
  62. data.orgId = json['orgId'] is String
  63. ? int.tryParse(json['orgId'])
  64. : json['orgId'].toInt();
  65. }
  66. if (json['userMenuList'] != null) {
  67. data.userMenuList = (json['userMenuList'] as List).map((v) => UserResponseDataUserMenuList().fromJson(v)).toList();
  68. }
  69. if (json['menu4AppList'] != null) {
  70. data.menu4AppList = (json['menu4AppList'] as List).map((v) => UserAppResponseDataUserMenuList().fromJson(v)).toList();
  71. }
  72. if (json['roleIdList'] != null) {
  73. data.roleIdList = json['roleIdList'];
  74. }
  75. if (json['roleList'] != null) {
  76. data.roleList = (json['roleList'] as List).map((v) => UserResponseDataRoleList().fromJson(v)).toList();
  77. }
  78. return data;
  79. }
  80. Map<String, dynamic> userResponseDataToJson(UserResponseData entity) {
  81. final Map<String, dynamic> data = new Map<String, dynamic>();
  82. data['id'] = entity.id;
  83. data['accId'] = entity.accId;
  84. data['name'] = entity.name;
  85. data['phone'] = entity.phone;
  86. data['password'] = entity.password;
  87. data['enable'] = entity.enable;
  88. data['isDelete'] = entity.isDelete;
  89. data['orgType'] = entity.orgType;
  90. data['orgName'] = entity.orgName;
  91. data['orgId'] = entity.orgId;
  92. data['userMenuList'] = entity.userMenuList.map((v) => v.toJson()).toList();
  93. data['menu4AppList'] = entity.menu4AppList.map((v) => v.toJson()).toList();
  94. data['roleIdList'] = entity.roleIdList;
  95. data['roleList'] = entity.roleList.map((v) => v.toJson()).toList();
  96. return data;
  97. }
  98. userResponseDataUserMenuListFromJson(UserResponseDataUserMenuList data, Map<String, dynamic> json) {
  99. if (json['id'] != null) {
  100. data.id = json['id'] is String
  101. ? int.tryParse(json['id'])
  102. : json['id'].toInt();
  103. }
  104. if (json['pid'] != null) {
  105. data.pid = json['pid'] is String
  106. ? int.tryParse(json['pid'])
  107. : json['pid'].toInt();
  108. }
  109. if (json['subCount'] != null) {
  110. data.subCount = json['subCount'] is String
  111. ? int.tryParse(json['subCount'])
  112. : json['subCount'].toInt();
  113. }
  114. if (json['type'] != null) {
  115. data.type = json['type'] is String
  116. ? int.tryParse(json['type'])
  117. : json['type'].toInt();
  118. }
  119. if (json['title'] != null) {
  120. data.title = json['title'].toString();
  121. }
  122. if (json['name'] != null) {
  123. data.name = json['name'].toString();
  124. }
  125. if (json['component'] != null) {
  126. data.component = json['component'].toString();
  127. }
  128. if (json['sort'] != null) {
  129. data.sort = json['sort'] is String
  130. ? int.tryParse(json['sort'])
  131. : json['sort'].toInt();
  132. }
  133. if (json['icon'] != null) {
  134. data.icon = json['icon'].toString();
  135. }
  136. if (json['iconActive'] != null) {
  137. data.iconActive = json['iconActive'].toString();
  138. }
  139. if (json['path'] != null) {
  140. data.path = json['path'].toString();
  141. }
  142. if (json['isEl'] != null) {
  143. data.isEl = json['isEl'];
  144. }
  145. if (json['isCache'] != null) {
  146. data.isCache = json['isCache'];
  147. }
  148. if (json['isHidden'] != null) {
  149. data.isHidden = json['isHidden'];
  150. }
  151. if (json['isDelete'] != null) {
  152. data.isDelete = json['isDelete'];
  153. }
  154. if (json['permission'] != null) {
  155. data.permission = json['permission'].toString();
  156. }
  157. if (json['creator'] != null) {
  158. data.creator = json['creator'].toString();
  159. }
  160. if (json['createTime'] != null) {
  161. data.createTime = json['createTime'].toString();
  162. }
  163. if (json['subMenu'] != null) {
  164. data.subMenu = json['subMenu'];
  165. }
  166. if (json['pname'] != null) {
  167. data.pname = json['pname'];
  168. }
  169. return data;
  170. }
  171. userAppResponseDataUserMenuListFromJson(UserAppResponseDataUserMenuList data, Map<String, dynamic> json) {
  172. if (json['id'] != null) {
  173. data.id = json['id'] is String
  174. ? int.tryParse(json['id'])
  175. : json['id'].toInt();
  176. }
  177. if (json['pid'] != null) {
  178. data.pid = json['pid'] is String
  179. ? int.tryParse(json['pid'])
  180. : json['pid'].toInt();
  181. }
  182. if (json['subCount'] != null) {
  183. data.subCount = json['subCount'] is String
  184. ? int.tryParse(json['subCount'])
  185. : json['subCount'].toInt();
  186. }
  187. if (json['type'] != null) {
  188. data.type = json['type'] is String
  189. ? int.tryParse(json['type'])
  190. : json['type'].toInt();
  191. }
  192. if (json['title'] != null) {
  193. data.title = json['title'].toString();
  194. }
  195. if (json['name'] != null) {
  196. data.name = json['name'].toString();
  197. }
  198. if (json['component'] != null) {
  199. data.component = json['component'].toString();
  200. }
  201. if (json['sort'] != null) {
  202. data.sort = json['sort'] is String
  203. ? int.tryParse(json['sort'])
  204. : json['sort'].toInt();
  205. }
  206. if (json['icon'] != null) {
  207. data.icon = json['icon'].toString();
  208. }
  209. if (json['iconActive'] != null) {
  210. data.iconActive = json['iconActive'].toString();
  211. }
  212. if (json['path'] != null) {
  213. data.path = json['path'].toString();
  214. }
  215. if (json['isEl'] != null) {
  216. data.isEl = json['isEl'];
  217. }
  218. if (json['isCache'] != null) {
  219. data.isCache = json['isCache'];
  220. }
  221. if (json['isHidden'] != null) {
  222. data.isHidden = json['isHidden'];
  223. }
  224. if (json['isDelete'] != null) {
  225. data.isDelete = json['isDelete'];
  226. }
  227. if (json['permission'] != null) {
  228. data.permission = json['permission'].toString();
  229. }
  230. if (json['creator'] != null) {
  231. data.creator = json['creator'].toString();
  232. }
  233. if (json['createTime'] != null) {
  234. data.createTime = json['createTime'].toString();
  235. }
  236. if (json['subMenu'] != null) {
  237. data.subMenu = json['subMenu'];
  238. }
  239. if (json['pname'] != null) {
  240. data.pname = json['pname'];
  241. }
  242. return data;
  243. }
  244. Map<String, dynamic> userResponseDataUserMenuListToJson(UserResponseDataUserMenuList entity) {
  245. final Map<String, dynamic> data = new Map<String, dynamic>();
  246. data['id'] = entity.id;
  247. data['pid'] = entity.pid;
  248. data['subCount'] = entity.subCount;
  249. data['type'] = entity.type;
  250. data['title'] = entity.title;
  251. data['name'] = entity.name;
  252. data['component'] = entity.component;
  253. data['sort'] = entity.sort;
  254. data['icon'] = entity.icon;
  255. data['iconActive'] = entity.iconActive;
  256. data['path'] = entity.path;
  257. data['isEl'] = entity.isEl;
  258. data['isCache'] = entity.isCache;
  259. data['isHidden'] = entity.isHidden;
  260. data['isDelete'] = entity.isDelete;
  261. data['permission'] = entity.permission;
  262. data['creator'] = entity.creator;
  263. data['createTime'] = entity.createTime;
  264. data['subMenu'] = entity.subMenu;
  265. data['pname'] = entity.pname;
  266. return data;
  267. }
  268. Map<String, dynamic> userAppResponseDataUserMenuListToJson(UserAppResponseDataUserMenuList entity) {
  269. final Map<String, dynamic> data = new Map<String, dynamic>();
  270. data['id'] = entity.id;
  271. data['pid'] = entity.pid;
  272. data['subCount'] = entity.subCount;
  273. data['type'] = entity.type;
  274. data['title'] = entity.title;
  275. data['name'] = entity.name;
  276. data['component'] = entity.component;
  277. data['sort'] = entity.sort;
  278. data['icon'] = entity.icon;
  279. data['iconActive'] = entity.iconActive;
  280. data['path'] = entity.path;
  281. data['isEl'] = entity.isEl;
  282. data['isCache'] = entity.isCache;
  283. data['isHidden'] = entity.isHidden;
  284. data['isDelete'] = entity.isDelete;
  285. data['permission'] = entity.permission;
  286. data['creator'] = entity.creator;
  287. data['createTime'] = entity.createTime;
  288. data['subMenu'] = entity.subMenu;
  289. data['pname'] = entity.pname;
  290. return data;
  291. }
  292. userResponseDataRoleListFromJson(UserResponseDataRoleList data, Map<String, dynamic> json) {
  293. if (json['id'] != null) {
  294. data.id = json['id'] is String
  295. ? int.tryParse(json['id'])
  296. : json['id'].toInt();
  297. }
  298. if (json['name'] != null) {
  299. data.name = json['name'].toString();
  300. }
  301. if (json['type'] != null) {
  302. data.type = json['type'];
  303. }
  304. if (json['level'] != null) {
  305. data.level = json['level'] is String
  306. ? int.tryParse(json['level'])
  307. : json['level'].toInt();
  308. }
  309. if (json['description'] != null) {
  310. data.description = json['description'].toString();
  311. }
  312. if (json['dataScope'] != null) {
  313. data.dataScope = json['dataScope'];
  314. }
  315. if (json['enable'] != null) {
  316. data.enable = json['enable'] is String
  317. ? int.tryParse(json['enable'])
  318. : json['enable'].toInt();
  319. }
  320. if (json['creator'] != null) {
  321. data.creator = json['creator'].toString();
  322. }
  323. if (json['createTime'] != null) {
  324. data.createTime = json['createTime'].toString();
  325. }
  326. if (json['menuList'] != null) {
  327. data.menuList = json['menuList'];
  328. }
  329. return data;
  330. }
  331. Map<String, dynamic> userResponseDataRoleListToJson(UserResponseDataRoleList entity) {
  332. final Map<String, dynamic> data = new Map<String, dynamic>();
  333. data['id'] = entity.id;
  334. data['name'] = entity.name;
  335. data['type'] = entity.type;
  336. data['level'] = entity.level;
  337. data['description'] = entity.description;
  338. data['dataScope'] = entity.dataScope;
  339. data['enable'] = entity.enable;
  340. data['creator'] = entity.creator;
  341. data['createTime'] = entity.createTime;
  342. data['menuList'] = entity.menuList;
  343. return data;
  344. }