123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- enum LoginType {
- UserNameAndPwd,
- MobileNumber,
- }
- enum RegisterType {
- MobileNumber,
- Email,
- }
- class LoginRequest {
- final LoginType loginType;
- final ProcessorInfo processorInfo;
- final ClientInfo? clientInfo;
- LoginRequest({
- required this.loginType,
- required this.processorInfo,
- this.clientInfo,
- });
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['LoginType'] = loginType.index;
- map['ProcessorInfo'] = processorInfo;
- if (clientInfo != null) map['ClientInfo'] = clientInfo;
- return map;
- }
- }
- class ProcessorInfo {
- final String? userName;
- final String? password;
- ProcessorInfo({
- this.userName,
- this.password,
- });
- factory ProcessorInfo.fromJson(Map<String, dynamic> map) {
- return ProcessorInfo(
- userName: map['UserName'],
- password: map['Password'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if (userName != null && userName!.isNotEmpty) map['UserName'] = userName;
- if (password != null && password!.isNotEmpty) map['Password'] = password;
- return map;
- }
- }
- class ClientInfo {
- final String? clientSource;
- ClientInfo({
- this.clientSource,
- });
- factory ClientInfo.fromJson(Map<String, dynamic> map) {
- return ClientInfo(
- clientSource: map['ClientSource'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if (clientSource != null && clientSource!.isNotEmpty)
- map['ClientSource'] = clientSource;
- return map;
- }
- }
- class LoginResult {
- final String userCode;
- final String sessionId;
- final String? deviceId;
- LoginResult({
- required this.userCode,
- required this.sessionId,
- this.deviceId,
- });
- factory LoginResult.fromJson(Map<String, dynamic> map) {
- return LoginResult(
- userCode: map['UserCode'],
- sessionId: map['SessionId'],
- deviceId: map['DeviceId'],
- );
- }
- }
- class SignInRequest {
- final String userName;
- final String secretPassword;
- final String? phone;
- final String? email;
- final String? nickName;
- final String? fullName;
- final String? headImageToken;
- final String? lastIp;
- SignInRequest({
- required this.userName,
- required this.secretPassword,
- this.phone,
- this.email,
- this.nickName,
- this.fullName,
- this.headImageToken,
- this.lastIp,
- });
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['UserName'] = userName;
- map['SecretPassword'] = secretPassword;
- if (phone != null && phone!.isNotEmpty) map['Phone'] = phone;
- if (email != null && email!.isNotEmpty) map['Email'] = email;
- if (nickName != null && nickName!.isNotEmpty) map['NickName'] = nickName;
- if (fullName != null && fullName!.isNotEmpty) map['FullName'] = fullName;
- if (headImageToken != null && headImageToken!.isNotEmpty)
- map['HeadImageToken'] = headImageToken;
- if (lastIp != null && lastIp!.isNotEmpty) map['LastIp'] = lastIp;
- return map;
- }
- }
|