123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239 |
- import 'package:json_annotation/json_annotation.dart';
- import 'package:lszlgl/model/num_converter.dart';
- import 'package:lszlgl/model/string_converter.dart';
- part 'user_rsp.g.dart';
- @JsonSerializable(converters: [NumConverter(), StringConverter()])
- class UserRsp {
- /*
- {
- "id": 1,
- "username": "admin",
- "nickname": "超级管理员",
- "email": "aoteman@126.com",
- "mobile": "15612345678",
- "sex": 1,
- "avatar": "http://127.0.0.1:48080/admin-api/infra/file/4/get/37e56010ecbee472cdd821ac4b608e151e62a74d9633f15d085aee026eedeb60.png",
- "loginIp": "210.12.51.197",
- "loginDate": 1708417207000,
- "createTime": 1609837427000,
- "roles": [
- {
- "id": 1,
- "name": "超级管理员"
- }
- ],
- "dept": {
- "id": 3010,
- "name": "国家局",
- "parentId": 0,
- "tyshxydm": null,
- "isRoot": null
- },
- "posts": [
- {
- "id": 1,
- "name": "董事长"
- }
- ],
- "socialUsers": []
- }
- */
- final num? id;
- final String? username;
- final String? nickname;
- final String? email;
- final String? mobile;
- final num? sex;
- final String? avatar;
- final String? loginIp;
- final num? loginDate;
- final num? createTime;
- final List<EnumRsp>? roles;
- final DepartmentRsp? dept;
- final List<EnumRsp>? posts;
- const UserRsp({
- this.id,
- this.username,
- this.nickname,
- this.email,
- this.mobile,
- this.sex,
- this.avatar,
- this.loginIp,
- this.loginDate,
- this.createTime,
- this.roles,
- this.dept,
- this.posts,
- });
- factory UserRsp.fromJson(Map<String, dynamic> json) => _$UserRspFromJson(json);
- Map<String, dynamic> toJson() => _$UserRspToJson(this);
- String? getMobile() {
- if (mobile == null) return null;
- var start = mobile!.substring(0, 3);
- var end = mobile!.substring(mobile!.length - 3);
- return '$start*****$end';
- }
- }
- @JsonSerializable(converters: [NumConverter(), StringConverter()])
- class DepartmentRsp {
- final num? id;
- final String? name;
- final num? parentId;
- const DepartmentRsp({
- this.id,
- this.name,
- this.parentId,
- });
- factory DepartmentRsp.fromJson(Map<String, dynamic> json) => _$DepartmentRspFromJson(json);
- Map<String, dynamic> toJson() => _$DepartmentRspToJson(this);
- }
- @JsonSerializable(converters: [NumConverter(), StringConverter()])
- class EnumRsp {
- final num? id;
- final String? name;
- const EnumRsp({
- this.id,
- this.name,
- });
- factory EnumRsp.fromJson(Map<String, dynamic> json) => _$EnumRspFromJson(json);
- Map<String, dynamic> toJson() => _$EnumRspToJson(this);
- }
- @JsonSerializable(converters: [StringConverter(), NumConverter()])
- class PersonRsp {
- /// ID
- num? id;
- /// 出生年月
- String? csny;
- /// 年龄
- num? age;
- /// 获得荣誉
- String? hdry;
- /// 民族
- num? minzu;
- /// 姓名
- String? name;
- /// 牵头或参与科研项目
- String? qthcykyxm;
- /// 企业编码
- String? qybm;
- /// 账号角色
- num? role;
- /// 是否从事行政管理
- num? sfcsxzgl;
- /// 是否在编
- num? sfzb;
- /// 学历
- num? xueli;
- /// 账号
- String? zhanghao;
- /// 职称
- num? zhicheng;
- /// 职务
- String? zhiwu;
- /// 专业
- String? zhuanye;
- /// 政治面貌 党员/共青团员/群众/民主党派成员/无党派人士
- num? zzmm;
- /// 在职学历
- String? zzxl;
- /// 在职专业
- String? zzzy;
- /// 企业基本信息主键ID
- num? zjBaseEnterpriseId;
- /// 机构名称
- String? enterpriseName;
- /// 性别
- num? sex;
- /// 系统用户id
- num? userId;
- /// 创建时间
- String? createTime;
- /// 奖励情况
- String? jlqk;
- /// 人员照片URL
- String? userPictureUrl;
- /// 用户详细信息
- String? userName;
- /// 机构审批状态
- num? flowStatus;
- PersonRsp({
- this.id,
- this.csny,
- this.age,
- this.hdry,
- this.minzu,
- this.name,
- this.qthcykyxm,
- this.qybm,
- this.role,
- this.sfcsxzgl,
- this.sfzb,
- this.xueli,
- this.zhanghao,
- this.zhicheng,
- this.zhiwu,
- this.zhuanye,
- this.zzmm,
- this.zzxl,
- this.zzzy,
- this.zjBaseEnterpriseId,
- this.enterpriseName,
- this.sex,
- this.userId,
- this.createTime,
- this.jlqk,
- this.userPictureUrl,
- this.userName,
- this.flowStatus,
- });
- factory PersonRsp.fromJson(Map<String, dynamic> json) => _$PersonRspFromJson(json);
- Map<String, dynamic> toJson() => _$PersonRspToJson(this);
- }
|