feat:增加网络请求
This commit is contained in:
80
lib/models/session.dart
Normal file
80
lib/models/session.dart
Normal file
@@ -0,0 +1,80 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'session.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class SaTokenInfo {
|
||||
String? tokenName;
|
||||
String? tokenValue;
|
||||
bool? isLogin;
|
||||
dynamic loginId;
|
||||
String? loginType;
|
||||
int? tokenTimeout;
|
||||
int? sessionTimeout;
|
||||
int? tokenSessionTimeout;
|
||||
int? tokenActiveTimeout;
|
||||
String? loginDeviceType;
|
||||
String? tag;
|
||||
|
||||
SaTokenInfo({
|
||||
this.tokenName,
|
||||
this.tokenValue,
|
||||
this.isLogin,
|
||||
this.loginId,
|
||||
this.loginType,
|
||||
this.tokenTimeout,
|
||||
this.sessionTimeout,
|
||||
this.tokenSessionTimeout,
|
||||
this.tokenActiveTimeout,
|
||||
this.loginDeviceType,
|
||||
this.tag,
|
||||
});
|
||||
|
||||
factory SaTokenInfo.fromJson(Map<String, dynamic> json) => _$SaTokenInfoFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$SaTokenInfoToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class User {
|
||||
String? username;
|
||||
int? gender;
|
||||
String? phoneNumber;
|
||||
String? email;
|
||||
DateTime? birthDate;
|
||||
String? avatar;
|
||||
List<String>? area;
|
||||
String? address;
|
||||
String? job;
|
||||
List<String>? tags;
|
||||
String? description;
|
||||
String? id;
|
||||
|
||||
User({
|
||||
this.id,
|
||||
this.username,
|
||||
this.gender,
|
||||
this.phoneNumber,
|
||||
this.email,
|
||||
this.birthDate,
|
||||
this.avatar,
|
||||
this.area,
|
||||
this.address,
|
||||
this.job,
|
||||
this.tags,
|
||||
this.description,
|
||||
});
|
||||
|
||||
factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$UserToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class Session {
|
||||
SaTokenInfo? saToken;
|
||||
User? userInfo;
|
||||
|
||||
Session({this.saToken, this.userInfo});
|
||||
|
||||
factory Session.fromJson(Map<String, dynamic> json) => _$SessionFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$SessionToJson(this);
|
||||
}
|
||||
Reference in New Issue
Block a user