step 22 : no_login -> login dan list riwayat pake JWT done, masih belum done di refreshToken karena check waktu expired salah
This commit is contained in:
90
lib/model/no-login/no_login_auth_model.dart
Normal file
90
lib/model/no-login/no_login_auth_model.dart
Normal file
@@ -0,0 +1,90 @@
|
||||
class NoLoginAuthModel {
|
||||
final String token;
|
||||
final String host;
|
||||
final String client_id;
|
||||
final String expire_date;
|
||||
final bool isLogin;
|
||||
|
||||
NoLoginAuthModel({
|
||||
required this.host,
|
||||
required this.token,
|
||||
required this.client_id,
|
||||
required this.expire_date,
|
||||
required this.isLogin,
|
||||
});
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'host':host,
|
||||
'token': token,
|
||||
'client_id' :client_id,
|
||||
'expire_date':expire_date,
|
||||
'isLogin':isLogin,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// old
|
||||
class UserModel {
|
||||
final String userId;
|
||||
final String username;
|
||||
final String groupDashboard;
|
||||
final String defaultSampleStationId;
|
||||
final String staffName;
|
||||
final String isCourier;
|
||||
final String timeAutoLogout;
|
||||
final String ip;
|
||||
final String agent;
|
||||
final String version;
|
||||
final String lastLogin;
|
||||
final int satelliteId;
|
||||
|
||||
UserModel({
|
||||
required this.userId,
|
||||
required this.username,
|
||||
required this.groupDashboard,
|
||||
required this.defaultSampleStationId,
|
||||
required this.staffName,
|
||||
required this.isCourier,
|
||||
required this.timeAutoLogout,
|
||||
required this.ip,
|
||||
required this.agent,
|
||||
required this.version,
|
||||
required this.lastLogin,
|
||||
required this.satelliteId,
|
||||
});
|
||||
|
||||
factory UserModel.fromJson(Map<String, dynamic> json) {
|
||||
return UserModel(
|
||||
userId: json['M_UserID'] ?? '',
|
||||
username: json['M_UserUsername'] ?? '',
|
||||
groupDashboard: json['M_UserGroupDashboard'] ?? '',
|
||||
defaultSampleStationId: json['M_UserDefaultT_SampleStationID'] ?? '',
|
||||
staffName: json['M_StaffName'] ?? '',
|
||||
isCourier: json['is_courier'] ?? '',
|
||||
timeAutoLogout: json['time_autologout'] ?? '',
|
||||
ip: json['ip'] ?? '',
|
||||
agent: json['agent'] ?? '',
|
||||
version: json['version'] ?? '',
|
||||
lastLogin: json['last-login'] ?? '',
|
||||
satelliteId: json['M_SatelliteID'] ?? 0,
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'M_UserID': userId,
|
||||
'M_UserUsername': username,
|
||||
'M_UserGroupDashboard': groupDashboard,
|
||||
'M_UserDefaultT_SampleStationID': defaultSampleStationId,
|
||||
'M_StaffName': staffName,
|
||||
'is_courier': isCourier,
|
||||
'time_autologout': timeAutoLogout,
|
||||
'ip': ip,
|
||||
'agent': agent,
|
||||
'version': version,
|
||||
'last-login': lastLogin,
|
||||
'M_SatelliteID': satelliteId,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user