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({ required this.tokenName, required this.tokenValue, required this.isLogin, required this.loginId, required this.loginType, required this.tokenTimeout, required this.sessionTimeout, required this.tokenSessionTimeout, required this.tokenActiveTimeout, required this.loginDeviceType, this.tag, }); factory SaTokenInfo.fromJson(Map json) => _$SaTokenInfoFromJson(json); Map toJson() => _$SaTokenInfoToJson(this); } @JsonSerializable() class User { int? id; String? username; int? gender; String? phoneNumber; String? email; DateTime? birthDate; String? avatar; List? area; String? address; String? job; List? tags; String? description; 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 json) => _$UserFromJson(json); Map toJson() => _$UserToJson(this); } @JsonSerializable() class Session { SaTokenInfo saToken; User userInfo; Session({required this.saToken, required this.userInfo}); factory Session.fromJson(Map json) => _$SessionFromJson(json); Map toJson() => _$SessionToJson(this); }