123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233 |
- class UserSessionInfo {
- String? userCode;
- String? deviceId;
- String? sessionId;
- UserSessionInfo({
- this.userCode,
- this.deviceId,
- this.sessionId,
- });
- factory UserSessionInfo.fromJson(Map<String, dynamic> map) {
- return UserSessionInfo(
- userCode: map['UserCode'],
- deviceId: map['DeviceId'],
- sessionId: map['SessionId'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(userCode != null)
- map['UserCode'] = userCode;
- if(deviceId != null)
- map['DeviceId'] = deviceId;
- if(sessionId != null)
- map['SessionId'] = sessionId;
- return map;
- }
- }
- enum EnumLoginProcessorType {
- Official,
- Wechat,
- }
- class LoginProcessorInfo {
- String? userName;
- String? password;
- String? wechatToken;
- LoginProcessorInfo({
- this.userName,
- this.password,
- this.wechatToken,
- });
- factory LoginProcessorInfo.fromJson(Map<String, dynamic> map) {
- return LoginProcessorInfo(
- userName: map['UserName'],
- password: map['Password'],
- wechatToken: map['WechatToken'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(userName != null)
- map['UserName'] = userName;
- if(password != null)
- map['Password'] = password;
- if(wechatToken != null)
- map['WechatToken'] = wechatToken;
- return map;
- }
- }
- class ClientInfo {
- String? clientIpAndPort;
- String? clientDeviceId;
- String? clientSource;
- String? clientExtensionInfo;
- ClientInfo({
- this.clientIpAndPort,
- this.clientDeviceId,
- this.clientSource,
- this.clientExtensionInfo,
- });
- factory ClientInfo.fromJson(Map<String, dynamic> map) {
- return ClientInfo(
- clientIpAndPort: map['ClientIpAndPort'],
- clientDeviceId: map['ClientDeviceId'],
- clientSource: map['ClientSource'],
- clientExtensionInfo: map['ClientExtensionInfo'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(clientIpAndPort != null)
- map['ClientIpAndPort'] = clientIpAndPort;
- if(clientDeviceId != null)
- map['ClientDeviceId'] = clientDeviceId;
- if(clientSource != null)
- map['ClientSource'] = clientSource;
- if(clientExtensionInfo != null)
- map['ClientExtensionInfo'] = clientExtensionInfo;
- return map;
- }
- }
- class UserLoginInfo {
- EnumLoginProcessorType loginType;
- LoginProcessorInfo? processorInfo;
- ClientInfo? clientInfo;
- UserLoginInfo({
- this.loginType=EnumLoginProcessorType.Official,
- this.processorInfo,
- this.clientInfo,
- });
- factory UserLoginInfo.fromJson(Map<String, dynamic> map) {
- return UserLoginInfo(
- loginType: EnumLoginProcessorType.values.firstWhere((e) => e.index == map['LoginType']),
- processorInfo: map['ProcessorInfo'],
- clientInfo: map['ClientInfo'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['LoginType'] = loginType.index;
- if(processorInfo != null)
- map['ProcessorInfo'] = processorInfo;
- if(clientInfo != null)
- map['ClientInfo'] = clientInfo;
- return map;
- }
- }
- class UserInfo {
- String? userCode;
- String? userName;
- String? secretPassword;
- String? phone;
- String? email;
- String? nickName;
- String? fullName;
- String? headImageToken;
- String? organizationCode;
- List<String>? authorityGroups;
- List<String>? bindDevices;
- int score;
- String? lastIP;
- String? id;
- DateTime? createTime;
- DateTime? updateTime;
- bool isDelete;
- UserInfo({
- this.userCode,
- this.userName,
- this.secretPassword,
- this.phone,
- this.email,
- this.nickName,
- this.fullName,
- this.headImageToken,
- this.organizationCode,
- this.authorityGroups,
- this.bindDevices,
- this.score=0,
- this.lastIP,
- this.id,
- this.createTime,
- this.updateTime,
- this.isDelete=false,
- });
- factory UserInfo.fromJson(Map<String, dynamic> map) {
- return UserInfo(
- userCode: map['UserCode'],
- userName: map['UserName'],
- secretPassword: map['SecretPassword'],
- phone: map['Phone'],
- email: map['Email'],
- nickName: map['NickName'],
- fullName: map['FullName'],
- headImageToken: map['HeadImageToken'],
- organizationCode: map['OrganizationCode'],
- authorityGroups: map['AuthorityGroups'].cast<String>().toList(),
- bindDevices: map['BindDevices'].cast<String>().toList(),
- score: map['Score'],
- lastIP: map['LastIP'],
- id: map['Id'],
- createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
- updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
- isDelete: map['IsDelete'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(userCode != null)
- map['UserCode'] = userCode;
- if(userName != null)
- map['UserName'] = userName;
- if(secretPassword != null)
- map['SecretPassword'] = secretPassword;
- if(phone != null)
- map['Phone'] = phone;
- if(email != null)
- map['Email'] = email;
- if(nickName != null)
- map['NickName'] = nickName;
- if(fullName != null)
- map['FullName'] = fullName;
- if(headImageToken != null)
- map['HeadImageToken'] = headImageToken;
- if(organizationCode != null)
- map['OrganizationCode'] = organizationCode;
- if(authorityGroups != null)
- map['AuthorityGroups'] = authorityGroups;
- if(bindDevices != null)
- map['BindDevices'] = bindDevices;
- map['Score'] = score;
- if(lastIP != null)
- map['LastIP'] = lastIP;
- if(id != null)
- map['Id'] = id;
- if(createTime != null)
- map['CreateTime'] = createTime;
- if(updateTime != null)
- map['UpdateTime'] = updateTime;
- map['IsDelete'] = isDelete;
- return map;
- }
- }
|