user_rsp.dart 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. import 'package:json_annotation/json_annotation.dart';
  2. import 'package:lszlgl/model/num_converter.dart';
  3. import 'package:lszlgl/model/string_converter.dart';
  4. part 'user_rsp.g.dart';
  5. @JsonSerializable(converters: [NumConverter(), StringConverter()])
  6. class UserRsp {
  7. /*
  8. {
  9. "id": 1,
  10. "username": "admin",
  11. "nickname": "超级管理员",
  12. "email": "aoteman@126.com",
  13. "mobile": "15612345678",
  14. "sex": 1,
  15. "avatar": "http://127.0.0.1:48080/admin-api/infra/file/4/get/37e56010ecbee472cdd821ac4b608e151e62a74d9633f15d085aee026eedeb60.png",
  16. "loginIp": "210.12.51.197",
  17. "loginDate": 1708417207000,
  18. "createTime": 1609837427000,
  19. "roles": [
  20. {
  21. "id": 1,
  22. "name": "超级管理员"
  23. }
  24. ],
  25. "dept": {
  26. "id": 3010,
  27. "name": "国家局",
  28. "parentId": 0,
  29. "tyshxydm": null,
  30. "isRoot": null
  31. },
  32. "posts": [
  33. {
  34. "id": 1,
  35. "name": "董事长"
  36. }
  37. ],
  38. "socialUsers": []
  39. }
  40. */
  41. final num? id;
  42. final String? username;
  43. final String? nickname;
  44. final String? email;
  45. final String? mobile;
  46. final num? sex;
  47. final String? avatar;
  48. final String? loginIp;
  49. final num? loginDate;
  50. final num? createTime;
  51. final List<EnumRsp>? roles;
  52. final DepartmentRsp? dept;
  53. final List<EnumRsp>? posts;
  54. const UserRsp({
  55. this.id,
  56. this.username,
  57. this.nickname,
  58. this.email,
  59. this.mobile,
  60. this.sex,
  61. this.avatar,
  62. this.loginIp,
  63. this.loginDate,
  64. this.createTime,
  65. this.roles,
  66. this.dept,
  67. this.posts,
  68. });
  69. factory UserRsp.fromJson(Map<String, dynamic> json) => _$UserRspFromJson(json);
  70. Map<String, dynamic> toJson() => _$UserRspToJson(this);
  71. String? getMobile() {
  72. if (mobile == null) return null;
  73. var start = mobile!.substring(0, 3);
  74. var end = mobile!.substring(mobile!.length - 3);
  75. return '$start*****$end';
  76. }
  77. }
  78. @JsonSerializable(converters: [NumConverter(), StringConverter()])
  79. class DepartmentRsp {
  80. final num? id;
  81. final String? name;
  82. final num? parentId;
  83. const DepartmentRsp({
  84. this.id,
  85. this.name,
  86. this.parentId,
  87. });
  88. factory DepartmentRsp.fromJson(Map<String, dynamic> json) => _$DepartmentRspFromJson(json);
  89. Map<String, dynamic> toJson() => _$DepartmentRspToJson(this);
  90. }
  91. @JsonSerializable(converters: [NumConverter(), StringConverter()])
  92. class EnumRsp {
  93. final num? id;
  94. final String? name;
  95. const EnumRsp({
  96. this.id,
  97. this.name,
  98. });
  99. factory EnumRsp.fromJson(Map<String, dynamic> json) => _$EnumRspFromJson(json);
  100. Map<String, dynamic> toJson() => _$EnumRspToJson(this);
  101. }
  102. @JsonSerializable(converters: [StringConverter(), NumConverter()])
  103. class PersonRsp {
  104. /// ID
  105. num? id;
  106. /// 出生年月
  107. String? csny;
  108. /// 年龄
  109. num? age;
  110. /// 获得荣誉
  111. String? hdry;
  112. /// 民族
  113. num? minzu;
  114. /// 姓名
  115. String? name;
  116. /// 牵头或参与科研项目
  117. String? qthcykyxm;
  118. /// 企业编码
  119. String? qybm;
  120. /// 账号角色
  121. num? role;
  122. /// 是否从事行政管理
  123. num? sfcsxzgl;
  124. /// 是否在编
  125. num? sfzb;
  126. /// 学历
  127. num? xueli;
  128. /// 账号
  129. String? zhanghao;
  130. /// 职称
  131. num? zhicheng;
  132. /// 职务
  133. String? zhiwu;
  134. /// 专业
  135. String? zhuanye;
  136. /// 政治面貌 党员/共青团员/群众/民主党派成员/无党派人士
  137. num? zzmm;
  138. /// 在职学历
  139. String? zzxl;
  140. /// 在职专业
  141. String? zzzy;
  142. /// 企业基本信息主键ID
  143. num? zjBaseEnterpriseId;
  144. /// 机构名称
  145. String? enterpriseName;
  146. /// 性别
  147. num? sex;
  148. /// 系统用户id
  149. num? userId;
  150. /// 创建时间
  151. String? createTime;
  152. /// 奖励情况
  153. String? jlqk;
  154. /// 人员照片URL
  155. String? userPictureUrl;
  156. /// 用户详细信息
  157. String? userName;
  158. /// 机构审批状态
  159. num? flowStatus;
  160. PersonRsp({
  161. this.id,
  162. this.csny,
  163. this.age,
  164. this.hdry,
  165. this.minzu,
  166. this.name,
  167. this.qthcykyxm,
  168. this.qybm,
  169. this.role,
  170. this.sfcsxzgl,
  171. this.sfzb,
  172. this.xueli,
  173. this.zhanghao,
  174. this.zhicheng,
  175. this.zhiwu,
  176. this.zhuanye,
  177. this.zzmm,
  178. this.zzxl,
  179. this.zzzy,
  180. this.zjBaseEnterpriseId,
  181. this.enterpriseName,
  182. this.sex,
  183. this.userId,
  184. this.createTime,
  185. this.jlqk,
  186. this.userPictureUrl,
  187. this.userName,
  188. this.flowStatus,
  189. });
  190. factory PersonRsp.fromJson(Map<String, dynamic> json) => _$PersonRspFromJson(json);
  191. Map<String, dynamic> toJson() => _$PersonRspToJson(this);
  192. }