2023-08-28 13:15:57 +03:30
|
|
|
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
|
|
|
|
|
|
|
|
part 'core_status.freezed.dart';
|
|
|
|
|
part 'core_status.g.dart';
|
|
|
|
|
|
|
|
|
|
@freezed
|
|
|
|
|
class CoreStatus with _$CoreStatus {
|
2023-08-30 16:18:38 +03:30
|
|
|
const CoreStatus._();
|
|
|
|
|
|
2023-08-28 13:15:57 +03:30
|
|
|
@JsonSerializable(fieldRename: FieldRename.kebab)
|
|
|
|
|
const factory CoreStatus({
|
|
|
|
|
required int connectionsIn,
|
|
|
|
|
required int connectionsOut,
|
|
|
|
|
required int uplink,
|
|
|
|
|
required int downlink,
|
|
|
|
|
required int uplinkTotal,
|
|
|
|
|
required int downlinkTotal,
|
|
|
|
|
}) = _CoreStatus;
|
|
|
|
|
|
2023-08-30 16:18:38 +03:30
|
|
|
factory CoreStatus.empty() => const CoreStatus(
|
|
|
|
|
connectionsIn: 0,
|
|
|
|
|
connectionsOut: 0,
|
|
|
|
|
uplink: 0,
|
|
|
|
|
downlink: 0,
|
|
|
|
|
uplinkTotal: 0,
|
|
|
|
|
downlinkTotal: 0,
|
|
|
|
|
);
|
|
|
|
|
|
2023-08-28 13:15:57 +03:30
|
|
|
factory CoreStatus.fromJson(Map<String, dynamic> json) =>
|
|
|
|
|
_$CoreStatusFromJson(json);
|
|
|
|
|
}
|