Implement local HTTP Api usage
This commit is contained in:
@ -0,0 +1,91 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:marianum_mobile/api/webuntis/apiParams.dart';
|
||||
|
||||
part 'getTimetableParams.g.dart';
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GetTimetableParams extends ApiParams {
|
||||
GetTimetableParamsOptions options;
|
||||
|
||||
GetTimetableParams({required this.options});
|
||||
|
||||
factory GetTimetableParams.fromJson(Map<String, dynamic> json) => _$GetTimetableParamsFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$GetTimetableParamsToJson(this);
|
||||
}
|
||||
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GetTimetableParamsOptions {
|
||||
GetTimetableParamsOptionsElement element;
|
||||
@JsonKey(includeIfNull: false)
|
||||
int? startDate;
|
||||
@JsonKey(includeIfNull: false)
|
||||
int? endDate;
|
||||
@JsonKey(includeIfNull: false)
|
||||
bool? onlyBaseTimetable;
|
||||
@JsonKey(includeIfNull: false)
|
||||
bool? showBooking;
|
||||
@JsonKey(includeIfNull: false)
|
||||
bool? showInfo;
|
||||
@JsonKey(includeIfNull: false)
|
||||
bool? showSubstText;
|
||||
@JsonKey(includeIfNull: false)
|
||||
bool? showLsText;
|
||||
@JsonKey(includeIfNull: false)
|
||||
bool? showLsNumber;
|
||||
@JsonKey(includeIfNull: false)
|
||||
bool? showStudentgroup;
|
||||
@JsonKey(includeIfNull: false)
|
||||
GetTimetableParamsOptionsFields? klasseFields;
|
||||
@JsonKey(includeIfNull: false)
|
||||
GetTimetableParamsOptionsFields? roomFields;
|
||||
@JsonKey(includeIfNull: false)
|
||||
GetTimetableParamsOptionsFields? subjectFields;
|
||||
@JsonKey(includeIfNull: false)
|
||||
GetTimetableParamsOptionsFields? teacherFields;
|
||||
|
||||
GetTimetableParamsOptions({
|
||||
required this.element,
|
||||
this.startDate,
|
||||
this.endDate,
|
||||
this.onlyBaseTimetable,
|
||||
this.showBooking,
|
||||
this.showInfo,
|
||||
this.showSubstText,
|
||||
this.showLsText,
|
||||
this.showLsNumber,
|
||||
this.showStudentgroup,
|
||||
this.klasseFields,
|
||||
this.roomFields,
|
||||
this.subjectFields,
|
||||
this.teacherFields
|
||||
});
|
||||
|
||||
factory GetTimetableParamsOptions.fromJson(Map<String, dynamic> json) => _$GetTimetableParamsOptionsFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$GetTimetableParamsOptionsToJson(this);
|
||||
}
|
||||
|
||||
enum GetTimetableParamsOptionsFields {
|
||||
@JsonValue("id") id,
|
||||
@JsonValue("name") name,
|
||||
@JsonValue("longname") longname,
|
||||
@JsonValue("externalkey") externalkey,
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class GetTimetableParamsOptionsElement {
|
||||
int id;
|
||||
int type;
|
||||
@JsonKey(includeIfNull: false)
|
||||
GetTimetableParamsOptionsElementKeyType? keyType;
|
||||
|
||||
GetTimetableParamsOptionsElement({required this.id, required this.type, this.keyType});
|
||||
factory GetTimetableParamsOptionsElement.fromJson(Map<String, dynamic> json) => _$GetTimetableParamsOptionsElementFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$GetTimetableParamsOptionsElementToJson(this);
|
||||
}
|
||||
|
||||
enum GetTimetableParamsOptionsElementKeyType {
|
||||
@JsonValue("id") id,
|
||||
@JsonValue("name") name,
|
||||
@JsonValue("externalkey") externalkey
|
||||
}
|
Reference in New Issue
Block a user