Files
biz_xfj_cloud/lib/common/models/api/user_api_models.dart
T

167 lines
3.0 KiB
Dart

import 'package:json_annotation/json_annotation.dart';
import 'package:pj_supermarket_cloud/common/index.dart';
part 'user_api_models.g.dart';
@JsonSerializable()
class ServiceUser {
/// 用户ID
String? userId;
/// 用户昵称
String? username;
/// 部门ID
String? deptId;
/// 手机号码
String? userMobile;
/// 用户头像
String? userAvatar;
/// 钱包id
String? walletId;
/// 钱包类型id
String? walletTypeId;
/// 钱包余额
int? walletBalance;
/// 是否冻结饭卡
@JsonKey(fromJson: JsonTool.stringToBoolean, toJson: JsonTool.booleanToString)
bool? walletIsFreeze;
/// 卡号
String? walletCardNumber;
/// 查询用户食堂信息
String? canteenId;
/// 构造函数
ServiceUser({
this.userId,
this.username,
this.deptId,
this.userMobile,
this.userAvatar,
this.walletId,
this.walletTypeId,
this.walletBalance,
this.walletIsFreeze,
this.walletCardNumber,
this.canteenId,
});
factory ServiceUser.fromJson(Map<String, dynamic> json) =>
_$ServiceUserFromJson(json);
Map<String, dynamic> toJson() => _$ServiceUserToJson(this);
}
@JsonSerializable()
class ServiceAuth {
/// 用户编号
final int? userId;
/// 访问令牌
final String? accessToken;
/// 刷新令牌
final String? refreshToken;
/// 过期时间
final int? expiresTime;
ServiceAuth({
required this.userId,
required this.accessToken,
required this.refreshToken,
required this.expiresTime,
});
factory ServiceAuth.fromJson(Map<String, dynamic> json) =>
_$ServiceAuthFromJson(json);
Map<String, dynamic> toJson() => _$ServiceAuthToJson(this);
}
@JsonSerializable()
class ServiceAsyncFace {
/// 编号
final String? id;
/// 人脸编号
final String? autoCode;
/// 人脸图片
final String? faceImg;
/// 用户id
final String? userId;
/// 用户名
final String? username;
/// 用户头像
final String? userAvatar;
/// 部门id
final String? deptId;
/// 部门名
final String? deptName;
/// 删除标志
@JsonKey(fromJson: JsonTool.stringToBoolean, toJson: JsonTool.booleanToString)
final bool? delFlag;
ServiceAsyncFace({
this.id,
this.autoCode,
this.faceImg,
this.userId,
this.username,
this.userAvatar,
this.deptId,
this.deptName,
this.delFlag,
});
factory ServiceAsyncFace.fromJson(Map<String, dynamic> json) =>
_$ServiceAsyncFaceFromJson(json);
Map<String, dynamic> toJson() => _$ServiceAsyncFaceToJson(this);
}
@JsonSerializable()
class ServiceTenant {
/// id
final String? id;
/// 编号
final String? code;
/// 编号
final String? name;
final String? menuId;
final String? miniQr;
ServiceTenant({
this.id,
this.code,
this.name,
this.menuId,
this.miniQr,
});
factory ServiceTenant.fromJson(Map<String, dynamic> json) =>
_$ServiceTenantFromJson(json);
Map<String, dynamic> toJson() => _$ServiceTenantToJson(this);
}