import 'package:floor/floor.dart'; import 'package:json_annotation/json_annotation.dart'; part 'setting_entity.g.dart'; @JsonSerializable() @Entity(tableName: "setting") class SettingEntity { /// 自增ID @PrimaryKey(autoGenerate: true) int? id; /// 用户信息 String userJson; /// 设备信息 String sysJson; /// 食堂额外金额信息 String? canteenExtraPriceConfigJson; SettingEntity({ this.id, required this.userJson, required this.sysJson, this.canteenExtraPriceConfigJson, }); factory SettingEntity.fromJson(Map json) => _$SettingEntityFromJson(json); Map toJson() => _$SettingEntityToJson(this); }