Solian/lib/models/daily_sign.dart

50 lines
1.2 KiB
Dart
Raw Normal View History

2024-09-02 15:11:40 +00:00
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:get/get.dart';
2024-09-02 15:11:40 +00:00
import 'package:solian/models/account.dart';
part 'daily_sign.g.dart';
@JsonSerializable()
class DailySignRecord {
int id;
DateTime createdAt;
DateTime updatedAt;
DateTime? deletedAt;
Account account;
int resultTier;
int resultExperience;
int accountId;
DailySignRecord({
required this.id,
required this.createdAt,
required this.updatedAt,
required this.deletedAt,
required this.resultTier,
required this.resultExperience,
required this.account,
required this.accountId,
});
factory DailySignRecord.fromJson(Map<String, dynamic> json) =>
_$DailySignRecordFromJson(json);
Map<String, dynamic> toJson() => _$DailySignRecordToJson(this);
String get symbol => switch (resultTier) {
0 => '\n',
1 => '',
2 => '\n',
3 => '',
_ => '\n',
};
String get overviewSuggestion => switch (resultTier) {
0 => 'dailySignTier0'.tr,
1 => 'dailySignTier1'.tr,
2 => 'dailySignTier2'.tr,
3 => 'dailySignTier3'.tr,
_ => 'dailySignTier4'.tr,
2024-09-02 15:11:40 +00:00
};
}