diff --git a/lib/Components/pdf_file_input_container.dart b/lib/Components/pdf_file_input_container.dart new file mode 100644 index 0000000..fc913d4 --- /dev/null +++ b/lib/Components/pdf_file_input_container.dart @@ -0,0 +1,147 @@ +import 'package:auto_size_text/auto_size_text.dart'; +import 'package:flutter/material.dart'; +import 'package:manager_api_new/api.dart'; +import 'package:manager_app/Components/rounded_button.dart'; +import 'package:manager_app/Screens/Configurations/Section/SubSection/Map/category_list.dart'; +import 'package:manager_app/Screens/Configurations/Section/SubSection/PDF/pdf_list.dart'; +import 'package:manager_app/constants.dart'; + +class PDFFileInputContainer extends StatefulWidget { + final Color color; + final String label; + List initialValue; + final ValueChanged> onChanged; + PDFFileInputContainer({ + Key? key, + this.color = kSecond, + required this.label, + required this.initialValue, + required this.onChanged, + }) : super(key: key); + + @override + _PDFFileInputContainerState createState() => _PDFFileInputContainerState(); +} + +class _PDFFileInputContainerState extends State { + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + Size size = MediaQuery.of(context).size; + + return Container( + child: Row( + children: [ + Align( + alignment: AlignmentDirectional.centerStart, + child: Text(widget.label, style: TextStyle(fontSize: 25, fontWeight: FontWeight.w300)) + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + width: size.width *0.15, + child: InkWell( + onTap: () { + List newValues = []; + List initials = widget.initialValue; + showCreateOrUpdatePdfFiles("Fichiers PDF", initials, newValues, (value) { + widget.onChanged(value); + widget.initialValue = value; + }, context); + }, + child: Container( + decoration: BoxDecoration( + color: kPrimaryColor, + borderRadius: BorderRadius.circular(50), + ), + child: Padding( + padding: const EdgeInsets.only(left: 5, right: 5, top: 15, bottom: 15), + child: Center( + child: AutoSizeText( + "Changer", + style: TextStyle(color: kWhite), + maxLines: 2, + ) + ), + ) + ), + ), + ), + ), + ], + ), + ); + } +} + +showCreateOrUpdatePdfFiles(String modalLabel, List values, List newValues, Function onGetResult, BuildContext context) { + showDialog( + builder: (BuildContext context) { + Size size = MediaQuery.of(context).size; + return AlertDialog( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.all(Radius.circular(20.0)) + ), + title: Center(child: Text(modalLabel)), + content: SingleChildScrollView( + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20), + border: Border.all(width: 0.75, color: kSecond) + ), + height: size.height * 0.7, + width: size.width * 0.65, + child: PDFList(pdfs: values, onChanged: (result) { + newValues = result; + onGetResult(result); + }), + ) + ), + actions: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Container( + width: 180, + height: 70, + child: RoundedButton( + text: "Annuler", + icon: Icons.undo, + color: kSecond, + press: () { + onGetResult(values); + Navigator.of(context).pop(); + }, + fontSize: 20, + ), + ), + Container( + width: 180, + height: 70, + child: RoundedButton( + text: "Valider", + icon: Icons.check, + color: kPrimaryColor, + textColor: kWhite, + press: () { + /*Function deepEq = const DeepCollectionEquality().equals; + if (!deepEq(values, newValues)) { + onGetResult(newValues); + }*/ + Navigator.of(context).pop(); + }, + fontSize: 20, + ), + ), + ], + ), + ], + ); + }, context: context + ); +} \ No newline at end of file diff --git a/lib/Components/single_select_container.dart b/lib/Components/single_select_container.dart new file mode 100644 index 0000000..4b2f534 --- /dev/null +++ b/lib/Components/single_select_container.dart @@ -0,0 +1,89 @@ +import 'package:auto_size_text/auto_size_text.dart'; +import 'package:flutter/material.dart'; +import 'package:manager_app/constants.dart'; + +class SingleSelectContainer extends StatefulWidget { + final Color? color; + final String label; + final String? initialValue; + final List inputValues; + final ValueChanged? onChanged; + final double fontSize; + final double fontSizeText; + const SingleSelectContainer({ + Key? key, + this.color = kSecond, + required this.label, + this.initialValue = "", + required this.inputValues, + this.onChanged, + this.fontSize = 25, + this.fontSizeText = 20, + }) : super(key: key); + + @override + _SingleSelectContainerState createState() => _SingleSelectContainerState(); +} + +class _SingleSelectContainerState extends State { + String? selectedValue; + + @override + void initState() { + selectedValue = widget.initialValue; + super.initState(); + } + + @override + Widget build(BuildContext context) { + Size size = MediaQuery.of(context).size; + + return Container( + child: Row( + children: [ + Align( + alignment: AlignmentDirectional.centerStart, + child: AutoSizeText( + widget.label, + style: TextStyle(fontSize: widget.fontSize, fontWeight: FontWeight.w300), + maxLines: 2, + maxFontSize: widget.fontSize, + textAlign: TextAlign.center, + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + width: size.width *0.15, + constraints: BoxConstraints(maxWidth: 175), + child: DropdownButton( + value: selectedValue, + icon: const Icon(Icons.arrow_downward), + iconSize: 24, + elevation: 16, + style: TextStyle(color: widget.color!), + underline: Container( + height: 2, + color: kPrimaryColor, + ), + onChanged: (String? newValue) { + setState(() { + selectedValue = newValue!; + widget.onChanged!(selectedValue!); + }); + }, + items: widget.inputValues.map>((String value) { + return DropdownMenuItem( + value: value, + child: Text(value, style: TextStyle(fontSize: 20, fontWeight: FontWeight.w400, color: widget.color)), + ); + }).toList(), + ), + ), + ), + ], + ), + ); + } + +} \ No newline at end of file diff --git a/lib/Components/translation_input_and_resource_container.dart b/lib/Components/translation_input_and_resource_container.dart index 415828b..0ea48c1 100644 --- a/lib/Components/translation_input_and_resource_container.dart +++ b/lib/Components/translation_input_and_resource_container.dart @@ -37,12 +37,12 @@ class _TranslationInputAndResourceContainerState extends State 110) { + if(plainText.length > kTitleMaxLength) { print("to much text au dessus"); controllerQuill.undo(); } } else { - if(plainText.length > 2500) { + if(plainText.length > kDescriptionMaxLength) { print("to much text description au dessus"); controllerQuill.undo(); } @@ -53,12 +53,12 @@ class _TranslationInputAndResourceContainerState extends State element.language! == value).first.resourceId, color: kPrimaryColor, - inResourceTypes: [ResourceType.Image, ResourceType.ImageUrl, ResourceType.Video, ResourceType.VideoUrl, ResourceType.Audio], + inResourceTypes: resourceTypes, isLanguageTab: true, onChanged: (ResourceDTO resource) { setState(() { diff --git a/lib/Components/translation_input_container.dart b/lib/Components/translation_input_container.dart index fdde3a1..9b30324 100644 --- a/lib/Components/translation_input_container.dart +++ b/lib/Components/translation_input_container.dart @@ -36,12 +36,12 @@ class _TranslationInputContainerState extends State w controllerQuill.onTextChanged((p0) async { var plainText = await controllerQuill.getPlainText(); if(widget.isTitle) { - if(plainText.length > 110) { + if(plainText.length > kTitleMaxLength) { print("to much text au dessus"); controllerQuill.undo(); } } else { - if(plainText.length > 2500) { + if(plainText.length > kDescriptionMaxLength) { print("to much text description au dessus"); controllerQuill.undo(); } @@ -223,16 +223,6 @@ class _TranslationInputContainerState extends State w ), ), getTranslation(context, Provider.of(context), controllerQuill, customToolBarList, widget.isTitle, widget.resourceTypes, widget.newValues, currentLanguage!) - /*TabContainer( - radius: 0, - tabs: values.map((v) => v.language!.toUpperCase()).toList(), - children: getTranslations(context, Provider.of(context), controllerQuill, customToolBarList, label, isTitle, isAudio, newValues), - - /*child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: getTranslations(context, Provider.of(context), controllerQuill, label, isTitle, isAudio, newValues), - ),*/ - ),*/ ], ), ), diff --git a/lib/Screens/Configurations/Section/SubSection/Agenda/agenda_config.dart b/lib/Screens/Configurations/Section/SubSection/Agenda/agenda_config.dart index 3e65b94..d44eb20 100644 --- a/lib/Screens/Configurations/Section/SubSection/Agenda/agenda_config.dart +++ b/lib/Screens/Configurations/Section/SubSection/Agenda/agenda_config.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import 'package:manager_app/Components/multi_string_input_container.dart'; import 'package:manager_app/Components/resource_input_container.dart'; import 'package:manager_api_new/api.dart'; +import 'package:manager_app/Components/single_select_container.dart'; import 'dart:convert'; import 'package:manager_app/constants.dart'; @@ -36,23 +37,68 @@ class _AgendaConfigState extends State { @override Widget build(BuildContext context) { - return MultiStringInputContainer( - label: "Fichiers json :", - resourceTypes: [ResourceType.Json, ResourceType.JsonUrl], - modalLabel: "JSON", - color: kPrimaryColor, - initialValue: agendaDTO.resourceIds!, - isTitle: false, - onGetResult: (value) { - setState(() { - if (agendaDTO.resourceIds != value) { - agendaDTO.resourceIds = value; - //save(true, articleDTO, appContext); - widget.onChanged(jsonEncode(agendaDTO).toString()); - } - }); - }, - maxLines: 1, + Size size = MediaQuery.of(context).size; + + var mapProviderIn = ""; + switch(agendaDTO.mapProvider) { + case MapProvider.Google : + mapProviderIn = "Google"; + break; + case MapProvider.MapBox : + mapProviderIn = "MapBox"; + break; + default: + mapProviderIn = "Google"; + break; + } + + return SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + height: size.height * 0.3, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + SingleSelectContainer( + label: "Service carte :", + color: Colors.black, + initialValue: mapProviderIn, + inputValues: map_providers, + onChanged: (String value) { + switch(value) { + case "Google": + agendaDTO.mapProvider = MapProvider.Google; + break; + case "MapBox": + agendaDTO.mapProvider = MapProvider.MapBox; + break; + } + widget.onChanged(jsonEncode(agendaDTO).toString()); + } + ), + MultiStringInputContainer( + label: "Fichiers json :", + resourceTypes: [ResourceType.Json, ResourceType.JsonUrl], + modalLabel: "JSON", + color: kPrimaryColor, + initialValue: agendaDTO.resourceIds!, + isTitle: false, + onGetResult: (value) { + setState(() { + if (agendaDTO.resourceIds != value) { + agendaDTO.resourceIds = value; + //save(true, articleDTO, appContext); + widget.onChanged(jsonEncode(agendaDTO).toString()); + } + }); + }, + maxLines: 1, + ), + ], + ), + ), + ), ); /*return ResourceInputContainer( label: "Fichier JSON :", diff --git a/lib/Screens/Configurations/Section/SubSection/Map/map_config.dart b/lib/Screens/Configurations/Section/SubSection/Map/map_config.dart index 6495d27..c333a35 100644 --- a/lib/Screens/Configurations/Section/SubSection/Map/map_config.dart +++ b/lib/Screens/Configurations/Section/SubSection/Map/map_config.dart @@ -4,6 +4,7 @@ import 'package:manager_app/Components/category_input_container.dart'; import 'package:manager_app/Components/fetch_section_icon.dart'; import 'package:manager_app/Components/resource_input_container.dart'; import 'package:manager_app/Components/multi_select_container.dart'; +import 'package:manager_app/Components/single_select_container.dart'; import 'package:manager_app/Components/slider_input_container.dart'; import 'package:manager_app/Screens/Configurations/Section/SubSection/Map/showNewOrUpdateGeoPoint.dart'; import 'package:manager_app/app_context.dart'; @@ -34,6 +35,7 @@ class _MapConfigState extends State { late MapDTO mapDTO; String mapType= "hybrid"; + String mapTypeMapBox= "standard"; @override void initState() { @@ -62,6 +64,32 @@ class _MapConfigState extends State { } } + if(mapDTO.mapTypeMapbox != null) { + switch(mapDTO.mapTypeMapbox!.value) { + case 0: + mapTypeMapBox = "standard"; + break; + case 1: + mapTypeMapBox = "streets"; + break; + case 2: + mapTypeMapBox = "outdoors"; + break; + case 3: + mapTypeMapBox = "light"; + break; + case 4: + mapTypeMapBox = "dark"; + break; + case 5: + mapTypeMapBox = "satellite"; + break; + case 6: + mapTypeMapBox = "satellite_streets"; + break; + } + } + /*print("MAPDTO"); print(mapDTO); print(mapDTO.mapType.toString()); @@ -75,74 +103,127 @@ class _MapConfigState extends State { final appContext = Provider.of(context); Size size = MediaQuery.of(context).size; + var mapProviderIn = ""; + switch(mapDTO.mapProvider) { + case MapProvider.Google : + mapProviderIn = "Google"; + break; + case MapProvider.MapBox : + mapProviderIn = "MapBox"; + break; + default: + mapProviderIn = "Google"; + break; + } + return SingleChildScrollView( child: Column( children: [ Container( - height: size.height * 0.15, + height: size.height * 0.3, width: double.infinity, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, + child: Column( children: [ - // Icon - ResourceInputContainer( - label: "Icône:", - initialValue: mapDTO.iconResourceId, - color: kPrimaryColor, - imageFit: BoxFit.contain, - onChanged: (ResourceDTO resource) { - if(resource.id == null) { - mapDTO.iconSource = null; - mapDTO.iconResourceId = null; - } else { - mapDTO.iconResourceId = resource.id; - mapDTO.iconSource = resource.url; - } - widget.onChanged(jsonEncode(mapDTO).toString()); - }, - isSmall: true - ), - // Map Type - MultiSelectContainer( - label: "Type:", - initialValue: [mapType], //mapDTO.mapType.toString() - isMultiple: false, - values: map_types, - onChanged: (value) { - var tempOutput = new List.from(value); - print("Type MAP"); - print(value); - mapDTO.mapType = MapTypeApp.fromJson(tempOutput[0]); - widget.onChanged(jsonEncode(mapDTO).toString()); - }, - ), - // Zoom - SliderInputContainer( - label: "Zoom:", - initialValue: mapDTO.zoom != null ? mapDTO.zoom!.toDouble() : 18, - color: kPrimaryColor, - min: 0, - max: 30, - onChanged: (double value) { - mapDTO.zoom = value.toInt(); - widget.onChanged(jsonEncode(mapDTO).toString()); - }, - ), - Container( - height: 70, - child: CategoryInputContainer( - label: "Catégories :", - initialValue: mapDTO.categories != null ? mapDTO.categories! : [], - color: kPrimaryColor, - onChanged: (List? value) { - if(value != null) { - mapDTO.categories = value; + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + SingleSelectContainer( + label: "Service :", + color: Colors.black, + initialValue: mapProviderIn, + inputValues: map_providers, + onChanged: (String value) { + switch(value) { + case "Google": + mapDTO.mapProvider = MapProvider.Google; + break; + case "MapBox": + mapDTO.mapProvider = MapProvider.MapBox; + break; + } widget.onChanged(jsonEncode(mapDTO).toString()); } - }, - ), - ) + ), + // Icon + ResourceInputContainer( + label: "Icône:", + initialValue: mapDTO.iconResourceId, + color: kPrimaryColor, + imageFit: BoxFit.contain, + onChanged: (ResourceDTO resource) { + if(resource.id == null) { + mapDTO.iconSource = null; + mapDTO.iconResourceId = null; + } else { + mapDTO.iconResourceId = resource.id; + mapDTO.iconSource = resource.url; + } + widget.onChanged(jsonEncode(mapDTO).toString()); + }, + isSmall: true + ), + ] + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + if(mapDTO.mapProvider == MapProvider.Google) + // Map Type + MultiSelectContainer( + label: "Type:", + initialValue: [mapType], //mapDTO.mapType.toString() + isMultiple: false, + values: map_types, + onChanged: (value) { + var tempOutput = new List.from(value); + print("Type MAP"); + print(value); + mapDTO.mapType = MapTypeApp.fromJson(tempOutput[0]); + widget.onChanged(jsonEncode(mapDTO).toString()); + }, + ), + if(mapDTO.mapProvider == MapProvider.MapBox) + MultiSelectContainer( + label: "Type:", + initialValue: [mapTypeMapBox], //mapDTO.mapType.toString() + isMultiple: false, + values: map_types_mapBox, + onChanged: (value) { + var tempOutput = new List.from(value); + print(value); + mapDTO.mapTypeMapbox = MapTypeMapBox.fromJson(tempOutput[0]); + widget.onChanged(jsonEncode(mapDTO).toString()); + }, + ), + // Zoom + SliderInputContainer( + label: "Zoom:", + initialValue: mapDTO.zoom != null ? mapDTO.zoom!.toDouble() : 18, + color: kPrimaryColor, + min: 0, + max: 30, + onChanged: (double value) { + mapDTO.zoom = value.toInt(); + widget.onChanged(jsonEncode(mapDTO).toString()); + }, + ), + Container( + height: 70, + child: CategoryInputContainer( + label: "Catégories :", + initialValue: mapDTO.categories != null ? mapDTO.categories! : [], + color: kPrimaryColor, + onChanged: (List? value) { + if(value != null) { + mapDTO.categories = value; + widget.onChanged(jsonEncode(mapDTO).toString()); + } + }, + ), + ) + ], + ), ], ), ), diff --git a/lib/Screens/Configurations/Section/SubSection/PDF/PDF_config.dart b/lib/Screens/Configurations/Section/SubSection/PDF/PDF_config.dart index 07f183f..2e05033 100644 --- a/lib/Screens/Configurations/Section/SubSection/PDF/PDF_config.dart +++ b/lib/Screens/Configurations/Section/SubSection/PDF/PDF_config.dart @@ -1,9 +1,12 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:manager_app/Components/pdf_file_input_container.dart'; import 'package:manager_app/Components/resource_input_container.dart'; import 'package:manager_api_new/api.dart'; import 'dart:convert'; +import 'package:manager_app/constants.dart'; + class PDFConfig extends StatefulWidget { final String? color; final String? label; @@ -34,15 +37,20 @@ class _PDFConfigState extends State { @override Widget build(BuildContext context) { return Center( - child: ResourceInputContainer( - label: "Fichier PDF :", - inResourceTypes: [ResourceType.Pdf], - initialValue: pdfDTO.resourceId == null ? '': pdfDTO.resourceId, - onChanged: (ResourceDTO resourceDTO) { - pdfDTO.resourceUrl = resourceDTO.url; - pdfDTO.resourceId = resourceDTO.id; - widget.onChanged(jsonEncode(pdfDTO).toString()); - } + child: Container( + height: 70, + width: 425, + child: PDFFileInputContainer( + label: "Fichiers PDF :", + initialValue: pdfDTO.pdfs != null ? pdfDTO.pdfs! : [], + color: kPrimaryColor, + onChanged: (List? value) { + if(value != null) { + pdfDTO.pdfs = value; + widget.onChanged(jsonEncode(pdfDTO).toString()); + } + }, + ), ), ); } diff --git a/lib/Screens/Configurations/Section/SubSection/PDF/new_update_pdfFile.dart b/lib/Screens/Configurations/Section/SubSection/PDF/new_update_pdfFile.dart new file mode 100644 index 0000000..afd4e24 --- /dev/null +++ b/lib/Screens/Configurations/Section/SubSection/PDF/new_update_pdfFile.dart @@ -0,0 +1,155 @@ +import 'dart:convert'; + +import 'package:manager_app/Components/multi_string_input_and_resource_container.dart'; +import 'package:manager_app/Components/resource_input_container.dart'; +import 'package:flutter/material.dart'; +import 'package:manager_app/Components/multi_string_input_container.dart'; +import 'package:manager_app/Components/rounded_button.dart'; +import 'package:manager_app/Models/managerContext.dart'; +import 'package:manager_app/app_context.dart'; +import 'package:manager_app/constants.dart'; +import 'package:manager_api_new/api.dart'; + +Future showNewOrUpdatePDFFile(PDFFileDTO? inputPdfFile, AppContext appContext, BuildContext context, String text) async { + PDFFileDTO pdfFileDTO = new PDFFileDTO(); + + if (inputPdfFile != null) { + pdfFileDTO = inputPdfFile; + } else { + pdfFileDTO.pdfFilesAndTitles = []; + + ManagerAppContext managerAppContext = appContext.getContext(); + managerAppContext.selectedConfiguration!.languages!.forEach((element) { + var translationMessageDTO = new TranslationAndResourceDTO(); + translationMessageDTO.language = element; + translationMessageDTO.value = ""; + translationMessageDTO.resourceId = null; + + pdfFileDTO.pdfFilesAndTitles!.add(translationMessageDTO); + }); + } + + List newValues = []; + + List initials = []; + + languages.forEach((value) { + if(initials.map((iv) => iv.language).contains(value)) { + newValues.add(TranslationDTO.fromJson(jsonDecode(jsonEncode(initials.firstWhere((element) => element.language == value)))!)!); + } else { + // New language + newValues.add(TranslationDTO(language: value, value: "")); + } + }); + + Size size = MediaQuery.of(context).size; + var result = await showDialog( + builder: (BuildContext dialogContext) => AlertDialog( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.all(Radius.circular(20.0)) + ), + content: Container( + width: size.width *0.5, + child: SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text(text, style: new TextStyle(fontSize: 25, fontWeight: FontWeight.w400)), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Container( + height: size.height * 0.2, + constraints: BoxConstraints(minHeight: 50, maxHeight: 80), + child: MultiStringInputAndResourceContainer( + label: "Fichier et titre pdf :", + modalLabel: "Fichier et titre pdf", + fontSize: 20, + color: kPrimaryColor, + initialValue: pdfFileDTO.pdfFilesAndTitles != null ? pdfFileDTO.pdfFilesAndTitles! : [], + resourceTypes: [ResourceType.Pdf], + onGetResult: (value) { + if (pdfFileDTO.pdfFilesAndTitles != value) { + print("get resut hereeee"); + print(value); + pdfFileDTO.pdfFilesAndTitles = value; + } + }, + maxLines: 1, + isTitle: true + ), + ), + /*Container( + height: size.height * 0.2, + constraints: BoxConstraints(minHeight: 50, maxHeight: 80), + child: ResourceInputContainer( + label: "Icône catégorie :", + initialValue: categorieDTO.iconResourceId, + color: kPrimaryColor, + onChanged: (ResourceDTO resource) { + if(resource.id == null) { + categorieDTO.iconResourceId = null; + categorieDTO.iconUrl = null; + } else { + categorieDTO.iconResourceId = resource.id; + categorieDTO.iconUrl = resource.url; + print("Icône catégorieIcône catégorie"); + print(categorieDTO); + } + }, + isSmall: true + ), + ),*/ + ], + ), + ], + ), + ), + ), + actions: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Align( + alignment: AlignmentDirectional.bottomEnd, + child: Container( + width: 175, + height: 70, + child: RoundedButton( + text: "Annuler", + icon: Icons.undo, + color: kSecond, + press: () { + Navigator.pop(dialogContext); + }, + fontSize: 20, + ), + ), + ), + Align( + alignment: AlignmentDirectional.bottomEnd, + child: Container( + width: inputPdfFile != null ? 220: 150, + height: 70, + child: RoundedButton( + text: inputPdfFile != null ? "Sauvegarder" : "Créer", + icon: Icons.check, + color: kPrimaryColor, + textColor: kWhite, + press: () { + if(pdfFileDTO.pdfFilesAndTitles != null && pdfFileDTO.pdfFilesAndTitles!.isNotEmpty) + { + Navigator.pop(dialogContext, pdfFileDTO); + } + }, + fontSize: 20, + ), + ), + ), + ], + ), + ], + ), context: context + ); + return result; +} diff --git a/lib/Screens/Configurations/Section/SubSection/PDF/pdf_list.dart b/lib/Screens/Configurations/Section/SubSection/PDF/pdf_list.dart new file mode 100644 index 0000000..4b817c0 --- /dev/null +++ b/lib/Screens/Configurations/Section/SubSection/PDF/pdf_list.dart @@ -0,0 +1,230 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_widget_from_html/flutter_widget_from_html.dart'; +import 'package:manager_app/Screens/Configurations/Section/SubSection/Map/new_update_categorie.dart'; +import 'package:manager_app/Screens/Configurations/Section/SubSection/PDF/new_update_pdfFile.dart'; +import 'package:manager_app/app_context.dart'; +import 'package:manager_app/constants.dart'; +import 'package:manager_api_new/api.dart'; +import 'package:provider/provider.dart'; + +class PDFList extends StatefulWidget { + final List pdfs; + final ValueChanged> onChanged; + const PDFList({ + Key? key, + required this.pdfs, + required this.onChanged, + }) : super(key: key); + + @override + _PDFListState createState() => _PDFListState(); +} + +class _PDFListState extends State { + late List pdfsMiddle; + + @override + void initState() { + super.initState(); + pdfsMiddle = new List.from(widget.pdfs); + pdfsMiddle.sort((a, b) => a.order!.compareTo(b.order!)); + } + + void _resetOrder() { + setState( + () { + var i = 0; + pdfsMiddle.forEach((pdfMiddle) { + pdfMiddle.order = i; + i++; + }); + widget.onChanged(pdfsMiddle); + }, + ); + } + + void _onReorder(int oldIndex, int newIndex) { + setState( + () { + if (newIndex > oldIndex) { + newIndex -= 1; + } + final PDFFileDTO item = pdfsMiddle.removeAt(oldIndex); + pdfsMiddle.insert(newIndex, item); + + var i = 0; + pdfsMiddle.forEach((category) { + category.order = i; + i++; + }); + widget.onChanged(pdfsMiddle); + }, + ); + } + + @override + Widget build(BuildContext context) { + final appContext = Provider.of(context); + Size size = MediaQuery.of(context).size; + + return Stack( + children: [ + Padding( + padding: const EdgeInsets.only(left: 15.0, right: 15.0, bottom: 15.0, top: 32.5), + child: ReorderableListView.builder( + shrinkWrap: true, + padding: const EdgeInsets.only(right: 125), + itemBuilder: (BuildContext context, int index) { + return Container( + key: ValueKey(index), + decoration: boxDecoration(), + padding: const EdgeInsets.all(2), + margin: EdgeInsets.symmetric(vertical: 3, horizontal: 3), + child: getElement(index, pdfsMiddle[index], size, appContext), + ); + }, + itemCount: pdfsMiddle.length, + onReorder: _onReorder + ), + ), + Positioned( + top: 10, + right: 10, + child: InkWell( + onTap: () async { + PDFFileDTO newPdfFile = PDFFileDTO(order: null); + + var result = await showNewOrUpdatePDFFile(newPdfFile, appContext, context, "Création PDF"); + if (result != null) + { + setState(() { + result.order = pdfsMiddle.length; + pdfsMiddle.add(result); + widget.onChanged(pdfsMiddle); + }); + } + }, + child: Container( + height: MediaQuery.of(context).size.width * 0.04, + width: MediaQuery.of(context).size.width * 0.04, + child: Icon( + Icons.add, + color: kTextLightColor, + size: 30.0, + ), + decoration: BoxDecoration( + color: kSuccess, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(20.0), + boxShadow: [ + BoxShadow( + color: kSecond, + spreadRadius: 0.5, + blurRadius: 5, + offset: Offset(0, 1.5), // changes position of shadow + ), + ], + ), + ), + ), + ) + ], + ); + } + + getElement(int index, PDFFileDTO pdfFileDTO, Size size, AppContext appContext) { + return Stack( + children: [ + Container( + width: size.width *0.8, + height: 50, + child: Row( + children: [ + Center( + child: Padding( + padding: const EdgeInsets.all(2.0), + child: HtmlWidget( + pdfFileDTO.pdfFilesAndTitles == null ? "" : pdfFileDTO.pdfFilesAndTitles![0].value!, + //textAlign: TextAlign.left, + textStyle: TextStyle(fontSize: 15) + ), + ), + ), + ], + ), + ), + Positioned( + right: 35, + bottom: 3, + child: Row( + children: [ + Tooltip( + message: "Modifier", + child: InkWell( + onTap: () async { + var result = await showNewOrUpdatePDFFile(pdfFileDTO, appContext, context, "Modification pdf"); + if (result != null) + { + setState(() { + print("RESUUULT MODIFYY "); + pdfFileDTO = result; + pdfsMiddle[pdfFileDTO.order!] = pdfFileDTO; + widget.onChanged(pdfsMiddle); + }); + } + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Icon( + Icons.edit, + color: kPrimaryColor, + size: 25.0, + ), + ) + ), + ), + Tooltip( + message: "Supprimer", + child: InkWell( + onTap: () { + setState(() { + pdfsMiddle.removeAt(pdfFileDTO.order!); + _resetOrder(); + widget.onChanged(pdfsMiddle); + }); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Icon( + Icons.delete, + color: kError, + size: 25.0, + ), + ) + ), + ), + ], + ) + ), + ], + ); + } +} + +boxDecoration() { + return BoxDecoration( + color: kBackgroundColor, + shape: BoxShape.rectangle, + border: Border.all(width: 1.5, color: kSecond), + borderRadius: BorderRadius.circular(10.0), + boxShadow: [ + BoxShadow( + color: kSecond, + spreadRadius: 0.5, + blurRadius: 5, + offset: Offset(0, 1.5), // changes position of shadow + ), + ], + ); +} \ No newline at end of file diff --git a/lib/Screens/Configurations/Section/section_detail_screen.dart b/lib/Screens/Configurations/Section/section_detail_screen.dart index 7c037b2..295ed1c 100644 --- a/lib/Screens/Configurations/Section/section_detail_screen.dart +++ b/lib/Screens/Configurations/Section/section_detail_screen.dart @@ -454,7 +454,7 @@ class _SectionDetailScreenState extends State { initialValue: sectionDTO.data!, onChanged: (String data) { sectionDTO.data = data; - save(false, sectionDTO, appContext); + //save(false, sectionDTO, appContext); }, ); case SectionType.Puzzle: diff --git a/lib/api/swagger.yaml b/lib/api/swagger.yaml index ffda81a..c6fe041 100644 --- a/lib/api/swagger.yaml +++ b/lib/api/swagger.yaml @@ -2099,7 +2099,17 @@ components: type: integer format: int32 mapType: - $ref: '#/components/schemas/MapTypeApp' + nullable: true + oneOf: + - $ref: '#/components/schemas/MapTypeApp' + mapTypeMapbox: + nullable: true + oneOf: + - $ref: '#/components/schemas/MapTypeMapBox' + mapProvider: + nullable: true + oneOf: + - $ref: '#/components/schemas/MapProvider' points: type: array nullable: true @@ -2136,6 +2146,43 @@ components: - 2 - 3 - 4 + MapTypeMapBox: + type: integer + description: |- + 0 = standard + 1 = streets + 2 = outdoors + 3 = light + 4 = dark + 5 = satellite + 6 = satellite_streets + x-enumNames: + - standard + - streets + - outdoors + - light + - dark + - satellite + - satellite_streets + enum: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + MapProvider: + type: integer + description: |- + 0 = Google + 1 = MapBox + x-enumNames: + - Google + - MapBox + enum: + - 0 + - 1 GeoPointDTO: type: object additionalProperties: false @@ -2143,6 +2190,7 @@ components: id: type: integer format: int32 + nullable: true title: type: array nullable: true @@ -2313,7 +2361,9 @@ components: type: string nullable: true imageBackgroundResourceType: - $ref: '#/components/schemas/ResourceType' + nullable: true + oneOf: + - $ref: '#/components/schemas/ResourceType' imageBackgroundResourceUrl: type: string nullable: true @@ -2390,11 +2440,23 @@ components: type: object additionalProperties: false properties: - resourceId: - type: string + pdfs: + type: array nullable: true - resourceUrl: - type: string + items: + $ref: '#/components/schemas/PDFFileDTO' + PDFFileDTO: + type: object + additionalProperties: false + properties: + pdfFilesAndTitles: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationAndResourceDTO' + order: + type: integer + format: int32 nullable: true PuzzleDTO: type: object @@ -2429,6 +2491,10 @@ components: nullable: true items: $ref: '#/components/schemas/TranslationDTO' + mapProvider: + nullable: true + oneOf: + - $ref: '#/components/schemas/MapProvider' User: type: object additionalProperties: false diff --git a/lib/api/swagger.yaml.bak0 b/lib/api/swagger.yaml.bak0 deleted file mode 100644 index efff24d..0000000 --- a/lib/api/swagger.yaml.bak0 +++ /dev/null @@ -1,1959 +0,0 @@ -x-generator: NSwag v13.10.8.0 (NJsonSchema v10.3.11.0 (Newtonsoft.Json v10.0.0.0)) -openapi: 3.0.0 -info: - title: Manager Service - description: API Manager Service - version: Version Alpha -servers: - - url: http://localhost:5000 -paths: - /api/Configuration: - get: - tags: - - Configuration - operationId: Configuration_Get - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/ConfigurationDTO' - '500': - description: '' - content: - application/json: - schema: - type: string - post: - tags: - - Configuration - operationId: Configuration_Create - requestBody: - x-name: newConfiguration - content: - application/json: - schema: - $ref: '#/components/schemas/ConfigurationDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ConfigurationDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '409': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - put: - tags: - - Configuration - operationId: Configuration_Update - requestBody: - x-name: updatedConfiguration - content: - application/json: - schema: - $ref: '#/components/schemas/ConfigurationDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ConfigurationDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Configuration/{id}: - get: - tags: - - Configuration - operationId: Configuration_GetDetail - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ConfigurationDTO' - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - delete: - tags: - - Configuration - operationId: Configuration_Delete - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '202': - description: '' - content: - application/json: - schema: - type: string - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Configuration/{id}/export: - get: - tags: - - Configuration - operationId: Configuration_Export - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/octet-stream: - schema: - type: string - format: binary - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - /api/Configuration/import: - post: - tags: - - Configuration - operationId: Configuration_Import - requestBody: - x-name: exportConfiguration - content: - application/json: - schema: - $ref: '#/components/schemas/ExportConfigurationDTO' - required: true - x-position: 1 - responses: - '202': - description: '' - content: - application/json: - schema: - type: string - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '409': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Device: - get: - tags: - - Device - operationId: Device_Get - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/DeviceDTO' - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - post: - tags: - - Device - operationId: Device_Create - requestBody: - x-name: newDevice - content: - application/json: - schema: - $ref: '#/components/schemas/DeviceDetailDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/DeviceDetailDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '409': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - put: - tags: - - Device - operationId: Device_Update - requestBody: - x-name: updatedDevice - content: - application/json: - schema: - $ref: '#/components/schemas/DeviceDetailDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/DeviceDetailDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Device/{id}/detail: - get: - tags: - - Device - operationId: Device_GetDetail - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/DeviceDetailDTO' - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - /api/Device/mainInfos: - put: - tags: - - Device - operationId: Device_UpdateMainInfos - requestBody: - x-name: deviceIn - content: - application/json: - schema: - $ref: '#/components/schemas/DeviceDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/DeviceDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Device/{id}: - delete: - tags: - - Device - operationId: Device_Delete - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '202': - description: '' - content: - application/json: - schema: - type: string - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Resource: - get: - tags: - - Resource - operationId: Resource_Get - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/ResourceDTO' - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - post: - tags: - - Resource - operationId: Resource_Create - requestBody: - x-name: newResource - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '409': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - put: - tags: - - Resource - operationId: Resource_Update - requestBody: - x-name: updatedResource - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Resource/{id}/detail: - get: - tags: - - Resource - operationId: Resource_GetDetail - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDTO' - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - /api/Resource/{id}: - get: - tags: - - Resource - operationId: Resource_Show - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/octet-stream: - schema: - type: string - format: binary - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - delete: - tags: - - Resource - operationId: Resource_Delete - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '202': - description: '' - content: - application/json: - schema: - type: string - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Resource/upload: - post: - tags: - - Resource - operationId: Resource_Upload - requestBody: - content: - multipart/form-data: - schema: - properties: - label: - type: string - nullable: true - type: - type: string - nullable: true - responses: - '200': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Section: - get: - tags: - - Section - operationId: Section_Get - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/SectionDTO' - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - post: - tags: - - Section - operationId: Section_Create - requestBody: - x-name: newSection - content: - application/json: - schema: - $ref: '#/components/schemas/SectionDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/SectionDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '409': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - put: - tags: - - Section - operationId: Section_Update - requestBody: - x-name: updatedSection - content: - application/json: - schema: - $ref: '#/components/schemas/SectionDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/SectionDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Section/configuration/{id}: - get: - tags: - - Section - operationId: Section_GetFromConfiguration - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/SectionDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - delete: - tags: - - Section - operationId: Section_DeleteAllForConfiguration - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '202': - description: '' - content: - application/json: - schema: - type: string - '400': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Section/{id}/subsections: - get: - tags: - - Section - operationId: Section_GetAllSectionSubSections - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: {} - '400': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Section/{id}: - get: - tags: - - Section - operationId: Section_GetDetail - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/SectionDTO' - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - delete: - tags: - - Section - operationId: Section_Delete - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '202': - description: '' - content: - application/json: - schema: - type: string - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Section/order: - put: - tags: - - Section - operationId: Section_UpdateOrder - requestBody: - x-name: updatedSectionsOrder - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/SectionDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - type: string - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Section/MapDTO: - get: - tags: - - Section - operationId: Section_GetMapDTO - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/MapDTO' - security: - - bearer: [] - /api/Section/SliderDTO: - get: - tags: - - Section - operationId: Section_GetSliderDTO - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/SliderDTO' - security: - - bearer: [] - /api/Section/VideoDTO: - get: - tags: - - Section - operationId: Section_GetVideoDTO - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/VideoDTO' - security: - - bearer: [] - /api/Section/WebDTO: - get: - tags: - - Section - operationId: Section_GetWebDTO - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/WebDTO' - security: - - bearer: [] - /api/Section/MenuDTO: - get: - tags: - - Section - operationId: Section_GetMenuDTO - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/MenuDTO' - security: - - bearer: [] - /api/Section/PlayerMessageDTO: - get: - tags: - - Section - operationId: Section_PlayerMessageDTO - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/PlayerMessageDTO' - security: - - bearer: [] - /api/Section/QuizzDTO: - get: - tags: - - Section - operationId: Section_GetQuizzDTO - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/QuizzDTO' - security: - - bearer: [] - /api/Section/ArticleDTO: - get: - tags: - - Section - operationId: Section_GetArticleDTO - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ArticleDTO' - security: - - bearer: [] - /api/User: - get: - tags: - - User - operationId: User_Get - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/User' - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - post: - tags: - - User - operationId: User_CreateUser - requestBody: - x-name: newUser - content: - application/json: - schema: - $ref: '#/components/schemas/User' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/UserDetailDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '409': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - put: - tags: - - User - operationId: User_UpdateUser - requestBody: - x-name: updatedUser - content: - application/json: - schema: - $ref: '#/components/schemas/User' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/UserDetailDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/User/{id}: - get: - tags: - - User - operationId: User_GetDetail - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/UserDetailDTO' - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - delete: - tags: - - User - operationId: User_DeleteUser - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '202': - description: '' - content: - application/json: - schema: - type: string - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Authentication/Token: - post: - tags: - - Authentication - operationId: Authentication_AuthenticateWithForm - requestBody: - content: - multipart/form-data: - schema: - properties: - grant_type: - type: string - nullable: true - username: - type: string - nullable: true - password: - type: string - nullable: true - client_id: - type: string - nullable: true - client_secret: - type: string - nullable: true - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/TokenDTO' - '401': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - /api/Authentication/Authenticate: - post: - tags: - - Authentication - operationId: Authentication_AuthenticateWithJson - requestBody: - x-name: login - content: - application/json: - schema: - $ref: '#/components/schemas/LoginDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/TokenDTO' - '401': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string -components: - schemas: - ConfigurationDTO: - type: object - additionalProperties: false - properties: - id: - type: string - nullable: true - label: - type: string - nullable: true - primaryColor: - type: string - nullable: true - secondaryColor: - type: string - nullable: true - languages: - type: array - nullable: true - items: - type: string - dateCreation: - type: string - format: date-time - isMobile: - type: boolean - isTablet: - type: boolean - isOffline: - type: boolean - ExportConfigurationDTO: - allOf: - - $ref: '#/components/schemas/ConfigurationDTO' - - type: object - additionalProperties: false - properties: - sections: - type: array - nullable: true - items: - $ref: '#/components/schemas/SectionDTO' - resources: - type: array - nullable: true - items: - $ref: '#/components/schemas/ResourceDTO' - SectionDTO: - type: object - additionalProperties: false - properties: - id: - type: string - nullable: true - label: - type: string - nullable: true - title: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - description: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - imageId: - type: string - nullable: true - imageSource: - type: string - nullable: true - configurationId: - type: string - nullable: true - isSubSection: - type: boolean - parentId: - type: string - nullable: true - type: - $ref: '#/components/schemas/SectionType' - data: - type: string - nullable: true - dateCreation: - type: string - format: date-time - order: - type: integer - format: int32 - TranslationDTO: - type: object - additionalProperties: false - properties: - language: - type: string - nullable: true - value: - type: string - nullable: true - SectionType: - type: integer - description: |- - 0 = Map - 1 = Slider - 2 = Video - 3 = Web - 4 = Menu - 5 = Quizz - 6 = Article - x-enumNames: - - Map - - Slider - - Video - - Web - - Menu - - Quizz - - Article - enum: - - 0 - - 1 - - 2 - - 3 - - 4 - - 5 - - 6 - ResourceDTO: - type: object - additionalProperties: false - properties: - id: - type: string - nullable: true - type: - $ref: '#/components/schemas/ResourceType' - label: - type: string - nullable: true - dateCreation: - type: string - format: date-time - data: - type: string - nullable: true - ResourceType: - type: integer - description: |- - 0 = Image - 1 = Video - 2 = ImageUrl - 3 = VideoUrl - x-enumNames: - - Image - - Video - - ImageUrl - - VideoUrl - enum: - - 0 - - 1 - - 2 - - 3 - DeviceDTO: - type: object - additionalProperties: false - properties: - id: - type: string - nullable: true - identifier: - type: string - nullable: true - name: - type: string - nullable: true - ipAddressWLAN: - type: string - nullable: true - ipAddressETH: - type: string - nullable: true - configurationId: - type: string - nullable: true - configuration: - type: string - nullable: true - connected: - type: boolean - dateCreation: - type: string - format: date-time - dateUpdate: - type: string - format: date-time - DeviceDetailDTO: - allOf: - - $ref: '#/components/schemas/DeviceDTO' - - type: object - additionalProperties: false - properties: - connectionLevel: - type: string - nullable: true - lastConnectionLevel: - type: string - format: date-time - batteryLevel: - type: string - nullable: true - lastBatteryLevel: - type: string - format: date-time - MapDTO: - type: object - additionalProperties: false - properties: - zoom: - type: integer - format: int32 - mapType: - $ref: '#/components/schemas/MapTypeApp' - points: - type: array - nullable: true - items: - $ref: '#/components/schemas/GeoPointDTO' - iconResourceId: - type: string - nullable: true - iconSource: - type: string - nullable: true - MapTypeApp: - type: integer - description: |- - 0 = none - 1 = normal - 2 = satellite - 3 = terrain - 4 = hybrid - x-enumNames: - - none - - normal - - satellite - - terrain - - hybrid - enum: - - 0 - - 1 - - 2 - - 3 - - 4 - GeoPointDTO: - type: object - additionalProperties: false - properties: - id: - type: integer - format: int32 - title: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - description: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - images: - type: array - nullable: true - items: - $ref: '#/components/schemas/ImageGeoPoint' - latitude: - type: string - nullable: true - longitude: - type: string - nullable: true - ImageGeoPoint: - type: object - additionalProperties: false - properties: - imageResourceId: - type: string - nullable: true - imageSource: - type: string - nullable: true - SliderDTO: - type: object - additionalProperties: false - properties: - images: - type: array - nullable: true - items: - $ref: '#/components/schemas/ImageDTO' - ImageDTO: - type: object - additionalProperties: false - properties: - title: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - description: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - resourceId: - type: string - nullable: true - source: - type: string - nullable: true - order: - type: integer - format: int32 - VideoDTO: - type: object - additionalProperties: false - properties: - source: - type: string - nullable: true - WebDTO: - type: object - additionalProperties: false - properties: - source: - type: string - nullable: true - MenuDTO: - type: object - additionalProperties: false - properties: - sections: - type: array - nullable: true - items: - $ref: '#/components/schemas/SectionDTO' - PlayerMessageDTO: - type: object - additionalProperties: false - properties: - configChanged: - type: boolean - isDeleted: - type: boolean - QuizzDTO: - type: object - additionalProperties: false - properties: - questions: - type: array - nullable: true - items: - $ref: '#/components/schemas/QuestionDTO' - bad_level: - nullable: true - oneOf: - - $ref: '#/components/schemas/LevelDTO' - medium_level: - nullable: true - oneOf: - - $ref: '#/components/schemas/LevelDTO' - good_level: - nullable: true - oneOf: - - $ref: '#/components/schemas/LevelDTO' - great_level: - nullable: true - oneOf: - - $ref: '#/components/schemas/LevelDTO' - QuestionDTO: - type: object - additionalProperties: false - properties: - label: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - responses: - type: array - nullable: true - items: - $ref: '#/components/schemas/ResponseDTO' - resourceId: - type: string - nullable: true - source: - type: string - nullable: true - order: - type: integer - format: int32 - ResponseDTO: - type: object - additionalProperties: false - properties: - label: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - isGood: - type: boolean - order: - type: integer - format: int32 - LevelDTO: - type: object - additionalProperties: false - properties: - label: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - resourceId: - type: string - nullable: true - source: - type: string - nullable: true - ArticleDTO: - type: object - additionalProperties: false - properties: - title: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - description: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - content: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - qrCode: - type: string - nullable: true - isContentTop: - type: boolean - audioId: - type: string - nullable: true - isReadAudioAuto: - type: boolean - images: - type: array - nullable: true - items: - $ref: '#/components/schemas/ImageDTO' - User: - type: object - additionalProperties: false - properties: - id: - type: string - nullable: true - email: - type: string - nullable: true - password: - type: string - nullable: true - firstName: - type: string - nullable: true - lastName: - type: string - nullable: true - token: - type: string - nullable: true - dateCreation: - type: string - format: date-time - UserDetailDTO: - type: object - additionalProperties: false - properties: - id: - type: string - nullable: true - email: - type: string - nullable: true - firstName: - type: string - nullable: true - lastName: - type: string - nullable: true - TokenDTO: - type: object - additionalProperties: false - properties: - access_token: - type: string - nullable: true - refresh_token: - type: string - nullable: true - scope: - type: string - nullable: true - token_type: - type: string - nullable: true - expires_in: - type: integer - format: int32 - expiration: - type: string - format: date-time - LoginDTO: - type: object - additionalProperties: false - properties: - email: - type: string - nullable: true - password: - type: string - nullable: true - securitySchemes: - bearer: - type: oauth2 - description: Manager Authentication - flows: - password: - authorizationUrl: /authentication/Token - tokenUrl: /api/authentication/Token - scopes: - Manager-api: Manager WebAPI -security: - - bearer: [] -tags: - - name: Configuration - description: Configuration management - - name: Device - description: Device management - - name: Resource - description: Resource management - - name: Section - description: Section management - - name: User - description: User management - - name: Authentication - description: Authentication management diff --git a/lib/api/swagger.yaml.bak1 b/lib/api/swagger.yaml.bak1 deleted file mode 100644 index e739b39..0000000 --- a/lib/api/swagger.yaml.bak1 +++ /dev/null @@ -1,1949 +0,0 @@ -x-generator: NSwag v13.10.8.0 (NJsonSchema v10.3.11.0 (Newtonsoft.Json v10.0.0.0)) -openapi: 3.0.0 -info: - title: Manager Service - description: API Manager Service - version: Version Alpha -servers: - - url: http://localhost:5000 -paths: - /api/Configuration: - get: - tags: - - Configuration - operationId: Configuration_Get - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/ConfigurationDTO' - '500': - description: '' - content: - application/json: - schema: - type: string - post: - tags: - - Configuration - operationId: Configuration_Create - requestBody: - x-name: newConfiguration - content: - application/json: - schema: - $ref: '#/components/schemas/ConfigurationDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ConfigurationDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '409': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - put: - tags: - - Configuration - operationId: Configuration_Update - requestBody: - x-name: updatedConfiguration - content: - application/json: - schema: - $ref: '#/components/schemas/ConfigurationDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ConfigurationDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Configuration/{id}: - get: - tags: - - Configuration - operationId: Configuration_GetDetail - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ConfigurationDTO' - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - delete: - tags: - - Configuration - operationId: Configuration_Delete - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '202': - description: '' - content: - application/json: - schema: - type: string - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Configuration/{id}/export: - get: - tags: - - Configuration - operationId: Configuration_Export - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/octet-stream: - schema: - type: string - format: binary - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - /api/Configuration/import: - post: - tags: - - Configuration - operationId: Configuration_Import - requestBody: - x-name: exportConfiguration - content: - application/json: - schema: - $ref: '#/components/schemas/ExportConfigurationDTO' - required: true - x-position: 1 - responses: - '202': - description: '' - content: - application/json: - schema: - type: string - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '409': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Device: - get: - tags: - - Device - operationId: Device_Get - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/DeviceDTO' - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - post: - tags: - - Device - operationId: Device_Create - requestBody: - x-name: newDevice - content: - application/json: - schema: - $ref: '#/components/schemas/DeviceDetailDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/DeviceDetailDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '409': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - put: - tags: - - Device - operationId: Device_Update - requestBody: - x-name: updatedDevice - content: - application/json: - schema: - $ref: '#/components/schemas/DeviceDetailDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/DeviceDetailDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Device/{id}/detail: - get: - tags: - - Device - operationId: Device_GetDetail - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/DeviceDetailDTO' - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - /api/Device/mainInfos: - put: - tags: - - Device - operationId: Device_UpdateMainInfos - requestBody: - x-name: deviceIn - content: - application/json: - schema: - $ref: '#/components/schemas/DeviceDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/DeviceDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Device/{id}: - delete: - tags: - - Device - operationId: Device_Delete - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '202': - description: '' - content: - application/json: - schema: - type: string - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Resource: - get: - tags: - - Resource - operationId: Resource_Get - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/ResourceDTO' - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - post: - tags: - - Resource - operationId: Resource_Create - requestBody: - x-name: newResource - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '409': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - put: - tags: - - Resource - operationId: Resource_Update - requestBody: - x-name: updatedResource - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Resource/{id}/detail: - get: - tags: - - Resource - operationId: Resource_GetDetail - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDTO' - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - /api/Resource/{id}: - get: - tags: - - Resource - operationId: Resource_Show - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/octet-stream: - schema: - type: string - format: binary - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - delete: - tags: - - Resource - operationId: Resource_Delete - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '202': - description: '' - content: - application/json: - schema: - type: string - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Resource/upload: - post: - tags: - - Resource - operationId: Resource_Upload - requestBody: - content: - multipart/form-data: - schema: - properties: - label: - type: string - nullable: true - type: - type: string - nullable: true - responses: - '200': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Section: - get: - tags: - - Section - operationId: Section_Get - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/SectionDTO' - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - post: - tags: - - Section - operationId: Section_Create - requestBody: - x-name: newSection - content: - application/json: - schema: - $ref: '#/components/schemas/SectionDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/SectionDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '409': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - put: - tags: - - Section - operationId: Section_Update - requestBody: - x-name: updatedSection - content: - application/json: - schema: - $ref: '#/components/schemas/SectionDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/SectionDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Section/configuration/{id}: - get: - tags: - - Section - operationId: Section_GetFromConfiguration - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/SectionDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - delete: - tags: - - Section - operationId: Section_DeleteAllForConfiguration - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '202': - description: '' - content: - application/json: - schema: - type: string - '400': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Section/{id}/subsections: - get: - tags: - - Section - operationId: Section_GetAllSectionSubSections - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: {} - '400': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Section/{id}: - get: - tags: - - Section - operationId: Section_GetDetail - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/SectionDTO' - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - delete: - tags: - - Section - operationId: Section_Delete - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '202': - description: '' - content: - application/json: - schema: - type: string - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Section/order: - put: - tags: - - Section - operationId: Section_UpdateOrder - requestBody: - x-name: updatedSectionsOrder - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/SectionDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - type: string - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Section/MapDTO: - get: - tags: - - Section - operationId: Section_GetMapDTO - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/MapDTO' - security: - - bearer: [] - /api/Section/SliderDTO: - get: - tags: - - Section - operationId: Section_GetSliderDTO - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/SliderDTO' - security: - - bearer: [] - /api/Section/VideoDTO: - get: - tags: - - Section - operationId: Section_GetVideoDTO - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/VideoDTO' - security: - - bearer: [] - /api/Section/WebDTO: - get: - tags: - - Section - operationId: Section_GetWebDTO - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/WebDTO' - security: - - bearer: [] - /api/Section/MenuDTO: - get: - tags: - - Section - operationId: Section_GetMenuDTO - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/MenuDTO' - security: - - bearer: [] - /api/Section/PlayerMessageDTO: - get: - tags: - - Section - operationId: Section_PlayerMessageDTO - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/PlayerMessageDTO' - security: - - bearer: [] - /api/Section/QuizzDTO: - get: - tags: - - Section - operationId: Section_GetQuizzDTO - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/QuizzDTO' - security: - - bearer: [] - /api/Section/ArticleDTO: - get: - tags: - - Section - operationId: Section_GetArticleDTO - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ArticleDTO' - security: - - bearer: [] - /api/User: - get: - tags: - - User - operationId: User_Get - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/User' - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - post: - tags: - - User - operationId: User_CreateUser - requestBody: - x-name: newUser - content: - application/json: - schema: - $ref: '#/components/schemas/User' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/UserDetailDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '409': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - put: - tags: - - User - operationId: User_UpdateUser - requestBody: - x-name: updatedUser - content: - application/json: - schema: - $ref: '#/components/schemas/User' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/UserDetailDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/User/{id}: - get: - tags: - - User - operationId: User_GetDetail - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/UserDetailDTO' - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - delete: - tags: - - User - operationId: User_DeleteUser - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '202': - description: '' - content: - application/json: - schema: - type: string - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Authentication/Token: - post: - tags: - - Authentication - operationId: Authentication_AuthenticateWithForm - requestBody: - content: - multipart/form-data: - schema: - properties: - grant_type: - type: string - nullable: true - username: - type: string - nullable: true - password: - type: string - nullable: true - client_id: - type: string - nullable: true - client_secret: - type: string - nullable: true - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/TokenDTO' - '401': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - /api/Authentication/Authenticate: - post: - tags: - - Authentication - operationId: Authentication_AuthenticateWithJson - requestBody: - x-name: login - content: - application/json: - schema: - $ref: '#/components/schemas/LoginDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/TokenDTO' - '401': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string -components: - schemas: - ConfigurationDTO: - type: object - additionalProperties: false - properties: - id: - type: string - nullable: true - label: - type: string - nullable: true - primaryColor: - type: string - nullable: true - secondaryColor: - type: string - nullable: true - languages: - type: array - nullable: true - items: - type: string - dateCreation: - type: string - format: date-time - isMobile: - type: boolean - isTablet: - type: boolean - isOffline: - type: boolean - ExportConfigurationDTO: - allOf: - - $ref: '#/components/schemas/ConfigurationDTO' - - type: object - additionalProperties: false - properties: - sections: - type: array - nullable: true - items: - $ref: '#/components/schemas/SectionDTO' - resources: - type: array - nullable: true - items: - $ref: '#/components/schemas/ResourceDTO' - SectionDTO: - type: object - additionalProperties: false - properties: - id: - type: string - nullable: true - label: - type: string - nullable: true - title: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - description: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - imageId: - type: string - nullable: true - imageSource: - type: string - nullable: true - configurationId: - type: string - nullable: true - isSubSection: - type: boolean - parentId: - type: string - nullable: true - type: - $ref: '#/components/schemas/SectionType' - data: - type: string - nullable: true - dateCreation: - type: string - format: date-time - order: - type: integer - format: int32 - TranslationDTO: - type: object - additionalProperties: false - properties: - language: - type: string - nullable: true - value: - type: string - nullable: true - SectionType: - type: integer - description: |- - 0 = Map - 1 = Slider - 2 = Video - 3 = Web - 4 = Menu - 5 = Quizz - 6 = Article - x-enumNames: - - Map - - Slider - - Video - - Web - - Menu - - Quizz - - Article - enum: - - 0 - - 1 - - 2 - - 3 - - 4 - - 5 - - 6 - ResourceDTO: - type: object - additionalProperties: false - properties: - id: - type: string - nullable: true - type: - $ref: '#/components/schemas/ResourceType' - label: - type: string - nullable: true - dateCreation: - type: string - format: date-time - data: - type: string - nullable: true - ResourceType: - type: integer - description: |- - 0 = Image - 1 = Video - 2 = ImageUrl - 3 = VideoUrl - x-enumNames: - - Image - - Video - - ImageUrl - - VideoUrl - enum: - - 0 - - 1 - - 2 - - 3 - DeviceDTO: - type: object - additionalProperties: false - properties: - id: - type: string - nullable: true - identifier: - type: string - nullable: true - name: - type: string - nullable: true - ipAddressWLAN: - type: string - nullable: true - ipAddressETH: - type: string - nullable: true - configurationId: - type: string - nullable: true - configuration: - type: string - nullable: true - connected: - type: boolean - dateCreation: - type: string - format: date-time - dateUpdate: - type: string - format: date-time - DeviceDetailDTO: - allOf: - - $ref: '#/components/schemas/DeviceDTO' - - type: object - additionalProperties: false - properties: - connectionLevel: - type: string - nullable: true - lastConnectionLevel: - type: string - format: date-time - batteryLevel: - type: string - nullable: true - lastBatteryLevel: - type: string - format: date-time - MapDTO: - type: object - additionalProperties: false - properties: - zoom: - type: integer - format: int32 - mapType: - $ref: '#/components/schemas/MapTypeApp' - points: - type: array - nullable: true - items: - $ref: '#/components/schemas/GeoPointDTO' - iconResourceId: - type: string - nullable: true - iconSource: - type: string - nullable: true - MapTypeApp: - type: integer - description: |- - 0 = none - 1 = normal - 2 = satellite - 3 = terrain - 4 = hybrid - x-enumNames: - - none - - normal - - satellite - - terrain - - hybrid - enum: - - 0 - - 1 - - 2 - - 3 - - 4 - GeoPointDTO: - type: object - additionalProperties: false - properties: - id: - type: integer - format: int32 - title: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - description: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - images: - type: array - nullable: true - items: - $ref: '#/components/schemas/ImageGeoPoint' - latitude: - type: string - nullable: true - longitude: - type: string - nullable: true - ImageGeoPoint: - type: object - additionalProperties: false - properties: - imageResourceId: - type: string - nullable: true - imageSource: - type: string - nullable: true - SliderDTO: - type: object - additionalProperties: false - properties: - images: - type: array - nullable: true - items: - $ref: '#/components/schemas/ImageDTO' - ImageDTO: - type: object - additionalProperties: false - properties: - title: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - description: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - resourceId: - type: string - nullable: true - source: - type: string - nullable: true - order: - type: integer - format: int32 - VideoDTO: - type: object - additionalProperties: false - properties: - source: - type: string - nullable: true - WebDTO: - type: object - additionalProperties: false - properties: - source: - type: string - nullable: true - MenuDTO: - type: object - additionalProperties: false - properties: - sections: - type: array - nullable: true - items: - $ref: '#/components/schemas/SectionDTO' - PlayerMessageDTO: - type: object - additionalProperties: false - properties: - configChanged: - type: boolean - isDeleted: - type: boolean - QuizzDTO: - type: object - additionalProperties: false - properties: - questions: - type: array - nullable: true - items: - $ref: '#/components/schemas/QuestionDTO' - bad_level: - nullable: true - oneOf: - - $ref: '#/components/schemas/LevelDTO' - medium_level: - nullable: true - oneOf: - - $ref: '#/components/schemas/LevelDTO' - good_level: - nullable: true - oneOf: - - $ref: '#/components/schemas/LevelDTO' - great_level: - nullable: true - oneOf: - - $ref: '#/components/schemas/LevelDTO' - QuestionDTO: - type: object - additionalProperties: false - properties: - label: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - responses: - type: array - nullable: true - items: - $ref: '#/components/schemas/ResponseDTO' - resourceId: - type: string - nullable: true - source: - type: string - nullable: true - order: - type: integer - format: int32 - ResponseDTO: - type: object - additionalProperties: false - properties: - label: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - isGood: - type: boolean - order: - type: integer - format: int32 - LevelDTO: - type: object - additionalProperties: false - properties: - label: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - resourceId: - type: string - nullable: true - source: - type: string - nullable: true - ArticleDTO: - type: object - additionalProperties: false - properties: - content: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - qrCode: - type: string - nullable: true - isContentTop: - type: boolean - audioId: - type: string - nullable: true - isReadAudioAuto: - type: boolean - images: - type: array - nullable: true - items: - $ref: '#/components/schemas/ImageDTO' - User: - type: object - additionalProperties: false - properties: - id: - type: string - nullable: true - email: - type: string - nullable: true - password: - type: string - nullable: true - firstName: - type: string - nullable: true - lastName: - type: string - nullable: true - token: - type: string - nullable: true - dateCreation: - type: string - format: date-time - UserDetailDTO: - type: object - additionalProperties: false - properties: - id: - type: string - nullable: true - email: - type: string - nullable: true - firstName: - type: string - nullable: true - lastName: - type: string - nullable: true - TokenDTO: - type: object - additionalProperties: false - properties: - access_token: - type: string - nullable: true - refresh_token: - type: string - nullable: true - scope: - type: string - nullable: true - token_type: - type: string - nullable: true - expires_in: - type: integer - format: int32 - expiration: - type: string - format: date-time - LoginDTO: - type: object - additionalProperties: false - properties: - email: - type: string - nullable: true - password: - type: string - nullable: true - securitySchemes: - bearer: - type: oauth2 - description: Manager Authentication - flows: - password: - authorizationUrl: /authentication/Token - tokenUrl: /api/authentication/Token - scopes: - Manager-api: Manager WebAPI -security: - - bearer: [] -tags: - - name: Configuration - description: Configuration management - - name: Device - description: Device management - - name: Resource - description: Resource management - - name: Section - description: Section management - - name: User - description: User management - - name: Authentication - description: Authentication management diff --git a/lib/api/swagger.yaml.bak2 b/lib/api/swagger.yaml.bak2 deleted file mode 100644 index 2dadf26..0000000 --- a/lib/api/swagger.yaml.bak2 +++ /dev/null @@ -1,1944 +0,0 @@ -x-generator: NSwag v13.10.8.0 (NJsonSchema v10.3.11.0 (Newtonsoft.Json v10.0.0.0)) -openapi: 3.0.0 -info: - title: Manager Service - description: API Manager Service - version: Version Alpha -servers: - - url: http://localhost:5000 -paths: - /api/Configuration: - get: - tags: - - Configuration - operationId: Configuration_Get - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/ConfigurationDTO' - '500': - description: '' - content: - application/json: - schema: - type: string - post: - tags: - - Configuration - operationId: Configuration_Create - requestBody: - x-name: newConfiguration - content: - application/json: - schema: - $ref: '#/components/schemas/ConfigurationDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ConfigurationDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '409': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - put: - tags: - - Configuration - operationId: Configuration_Update - requestBody: - x-name: updatedConfiguration - content: - application/json: - schema: - $ref: '#/components/schemas/ConfigurationDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ConfigurationDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Configuration/{id}: - get: - tags: - - Configuration - operationId: Configuration_GetDetail - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ConfigurationDTO' - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - delete: - tags: - - Configuration - operationId: Configuration_Delete - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '202': - description: '' - content: - application/json: - schema: - type: string - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Configuration/{id}/export: - get: - tags: - - Configuration - operationId: Configuration_Export - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/octet-stream: - schema: - type: string - format: binary - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - /api/Configuration/import: - post: - tags: - - Configuration - operationId: Configuration_Import - requestBody: - x-name: exportConfiguration - content: - application/json: - schema: - $ref: '#/components/schemas/ExportConfigurationDTO' - required: true - x-position: 1 - responses: - '202': - description: '' - content: - application/json: - schema: - type: string - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '409': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Device: - get: - tags: - - Device - operationId: Device_Get - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/DeviceDTO' - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - post: - tags: - - Device - operationId: Device_Create - requestBody: - x-name: newDevice - content: - application/json: - schema: - $ref: '#/components/schemas/DeviceDetailDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/DeviceDetailDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '409': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - put: - tags: - - Device - operationId: Device_Update - requestBody: - x-name: updatedDevice - content: - application/json: - schema: - $ref: '#/components/schemas/DeviceDetailDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/DeviceDetailDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Device/{id}/detail: - get: - tags: - - Device - operationId: Device_GetDetail - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/DeviceDetailDTO' - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - /api/Device/mainInfos: - put: - tags: - - Device - operationId: Device_UpdateMainInfos - requestBody: - x-name: deviceIn - content: - application/json: - schema: - $ref: '#/components/schemas/DeviceDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/DeviceDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Device/{id}: - delete: - tags: - - Device - operationId: Device_Delete - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '202': - description: '' - content: - application/json: - schema: - type: string - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Resource: - get: - tags: - - Resource - operationId: Resource_Get - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/ResourceDTO' - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - post: - tags: - - Resource - operationId: Resource_Create - requestBody: - x-name: newResource - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '409': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - put: - tags: - - Resource - operationId: Resource_Update - requestBody: - x-name: updatedResource - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Resource/{id}/detail: - get: - tags: - - Resource - operationId: Resource_GetDetail - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDTO' - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - /api/Resource/{id}: - get: - tags: - - Resource - operationId: Resource_Show - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/octet-stream: - schema: - type: string - format: binary - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - delete: - tags: - - Resource - operationId: Resource_Delete - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '202': - description: '' - content: - application/json: - schema: - type: string - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Resource/upload: - post: - tags: - - Resource - operationId: Resource_Upload - requestBody: - content: - multipart/form-data: - schema: - properties: - label: - type: string - nullable: true - type: - type: string - nullable: true - responses: - '200': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Section: - get: - tags: - - Section - operationId: Section_Get - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/SectionDTO' - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - post: - tags: - - Section - operationId: Section_Create - requestBody: - x-name: newSection - content: - application/json: - schema: - $ref: '#/components/schemas/SectionDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/SectionDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '409': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - put: - tags: - - Section - operationId: Section_Update - requestBody: - x-name: updatedSection - content: - application/json: - schema: - $ref: '#/components/schemas/SectionDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/SectionDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Section/configuration/{id}: - get: - tags: - - Section - operationId: Section_GetFromConfiguration - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/SectionDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - delete: - tags: - - Section - operationId: Section_DeleteAllForConfiguration - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '202': - description: '' - content: - application/json: - schema: - type: string - '400': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Section/{id}/subsections: - get: - tags: - - Section - operationId: Section_GetAllSectionSubSections - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: {} - '400': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Section/{id}: - get: - tags: - - Section - operationId: Section_GetDetail - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/SectionDTO' - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - delete: - tags: - - Section - operationId: Section_Delete - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '202': - description: '' - content: - application/json: - schema: - type: string - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Section/order: - put: - tags: - - Section - operationId: Section_UpdateOrder - requestBody: - x-name: updatedSectionsOrder - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/SectionDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - type: string - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Section/MapDTO: - get: - tags: - - Section - operationId: Section_GetMapDTO - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/MapDTO' - security: - - bearer: [] - /api/Section/SliderDTO: - get: - tags: - - Section - operationId: Section_GetSliderDTO - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/SliderDTO' - security: - - bearer: [] - /api/Section/VideoDTO: - get: - tags: - - Section - operationId: Section_GetVideoDTO - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/VideoDTO' - security: - - bearer: [] - /api/Section/WebDTO: - get: - tags: - - Section - operationId: Section_GetWebDTO - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/WebDTO' - security: - - bearer: [] - /api/Section/MenuDTO: - get: - tags: - - Section - operationId: Section_GetMenuDTO - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/MenuDTO' - security: - - bearer: [] - /api/Section/PlayerMessageDTO: - get: - tags: - - Section - operationId: Section_PlayerMessageDTO - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/PlayerMessageDTO' - security: - - bearer: [] - /api/Section/QuizzDTO: - get: - tags: - - Section - operationId: Section_GetQuizzDTO - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/QuizzDTO' - security: - - bearer: [] - /api/Section/ArticleDTO: - get: - tags: - - Section - operationId: Section_GetArticleDTO - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ArticleDTO' - security: - - bearer: [] - /api/User: - get: - tags: - - User - operationId: User_Get - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/User' - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - post: - tags: - - User - operationId: User_CreateUser - requestBody: - x-name: newUser - content: - application/json: - schema: - $ref: '#/components/schemas/User' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/UserDetailDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '409': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - put: - tags: - - User - operationId: User_UpdateUser - requestBody: - x-name: updatedUser - content: - application/json: - schema: - $ref: '#/components/schemas/User' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/UserDetailDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/User/{id}: - get: - tags: - - User - operationId: User_GetDetail - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/UserDetailDTO' - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - delete: - tags: - - User - operationId: User_DeleteUser - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '202': - description: '' - content: - application/json: - schema: - type: string - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Authentication/Token: - post: - tags: - - Authentication - operationId: Authentication_AuthenticateWithForm - requestBody: - content: - multipart/form-data: - schema: - properties: - grant_type: - type: string - nullable: true - username: - type: string - nullable: true - password: - type: string - nullable: true - client_id: - type: string - nullable: true - client_secret: - type: string - nullable: true - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/TokenDTO' - '401': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - /api/Authentication/Authenticate: - post: - tags: - - Authentication - operationId: Authentication_AuthenticateWithJson - requestBody: - x-name: login - content: - application/json: - schema: - $ref: '#/components/schemas/LoginDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/TokenDTO' - '401': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string -components: - schemas: - ConfigurationDTO: - type: object - additionalProperties: false - properties: - id: - type: string - nullable: true - label: - type: string - nullable: true - title: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - imageId: - type: string - nullable: true - imageSource: - type: string - nullable: true - primaryColor: - type: string - nullable: true - secondaryColor: - type: string - nullable: true - languages: - type: array - nullable: true - items: - type: string - dateCreation: - type: string - format: date-time - isMobile: - type: boolean - isTablet: - type: boolean - isOffline: - type: boolean - TranslationDTO: - type: object - additionalProperties: false - properties: - language: - type: string - nullable: true - value: - type: string - nullable: true - ExportConfigurationDTO: - allOf: - - $ref: '#/components/schemas/ConfigurationDTO' - - type: object - additionalProperties: false - properties: - sections: - type: array - nullable: true - items: - $ref: '#/components/schemas/SectionDTO' - resources: - type: array - nullable: true - items: - $ref: '#/components/schemas/ResourceDTO' - SectionDTO: - type: object - additionalProperties: false - properties: - id: - type: string - nullable: true - label: - type: string - nullable: true - title: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - description: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - imageId: - type: string - nullable: true - imageSource: - type: string - nullable: true - configurationId: - type: string - nullable: true - isSubSection: - type: boolean - parentId: - type: string - nullable: true - type: - $ref: '#/components/schemas/SectionType' - data: - type: string - nullable: true - dateCreation: - type: string - format: date-time - order: - type: integer - format: int32 - SectionType: - type: string - description: '' - x-enumNames: - - Map - - Slider - - Video - - Web - - Menu - - Quizz - - Article - enum: - - Map - - Slider - - Video - - Web - - Menu - - Quizz - - Article - ResourceDTO: - type: object - additionalProperties: false - properties: - id: - type: string - nullable: true - type: - $ref: '#/components/schemas/ResourceType' - label: - type: string - nullable: true - dateCreation: - type: string - format: date-time - data: - type: string - nullable: true - ResourceType: - type: string - description: '' - x-enumNames: - - Image - - Video - - ImageUrl - - VideoUrl - enum: - - Image - - Video - - ImageUrl - - VideoUrl - DeviceDTO: - type: object - additionalProperties: false - properties: - id: - type: string - nullable: true - identifier: - type: string - nullable: true - name: - type: string - nullable: true - ipAddressWLAN: - type: string - nullable: true - ipAddressETH: - type: string - nullable: true - configurationId: - type: string - nullable: true - configuration: - type: string - nullable: true - connected: - type: boolean - dateCreation: - type: string - format: date-time - dateUpdate: - type: string - format: date-time - DeviceDetailDTO: - allOf: - - $ref: '#/components/schemas/DeviceDTO' - - type: object - additionalProperties: false - properties: - connectionLevel: - type: string - nullable: true - lastConnectionLevel: - type: string - format: date-time - batteryLevel: - type: string - nullable: true - lastBatteryLevel: - type: string - format: date-time - MapDTO: - type: object - additionalProperties: false - properties: - zoom: - type: integer - format: int32 - mapType: - $ref: '#/components/schemas/MapTypeApp' - points: - type: array - nullable: true - items: - $ref: '#/components/schemas/GeoPointDTO' - iconResourceId: - type: string - nullable: true - iconSource: - type: string - nullable: true - MapTypeApp: - type: string - description: '' - x-enumNames: - - none - - normal - - satellite - - terrain - - hybrid - enum: - - none - - normal - - satellite - - terrain - - hybrid - GeoPointDTO: - type: object - additionalProperties: false - properties: - id: - type: integer - format: int32 - title: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - description: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - images: - type: array - nullable: true - items: - $ref: '#/components/schemas/ImageGeoPoint' - latitude: - type: string - nullable: true - longitude: - type: string - nullable: true - ImageGeoPoint: - type: object - additionalProperties: false - properties: - imageResourceId: - type: string - nullable: true - imageSource: - type: string - nullable: true - SliderDTO: - type: object - additionalProperties: false - properties: - images: - type: array - nullable: true - items: - $ref: '#/components/schemas/ImageDTO' - ImageDTO: - type: object - additionalProperties: false - properties: - title: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - description: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - resourceId: - type: string - nullable: true - source: - type: string - nullable: true - order: - type: integer - format: int32 - VideoDTO: - type: object - additionalProperties: false - properties: - source: - type: string - nullable: true - WebDTO: - type: object - additionalProperties: false - properties: - source: - type: string - nullable: true - MenuDTO: - type: object - additionalProperties: false - properties: - sections: - type: array - nullable: true - items: - $ref: '#/components/schemas/SectionDTO' - PlayerMessageDTO: - type: object - additionalProperties: false - properties: - configChanged: - type: boolean - isDeleted: - type: boolean - QuizzDTO: - type: object - additionalProperties: false - properties: - questions: - type: array - nullable: true - items: - $ref: '#/components/schemas/QuestionDTO' - bad_level: - nullable: true - oneOf: - - $ref: '#/components/schemas/LevelDTO' - medium_level: - nullable: true - oneOf: - - $ref: '#/components/schemas/LevelDTO' - good_level: - nullable: true - oneOf: - - $ref: '#/components/schemas/LevelDTO' - great_level: - nullable: true - oneOf: - - $ref: '#/components/schemas/LevelDTO' - QuestionDTO: - type: object - additionalProperties: false - properties: - label: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - responses: - type: array - nullable: true - items: - $ref: '#/components/schemas/ResponseDTO' - resourceId: - type: string - nullable: true - source: - type: string - nullable: true - order: - type: integer - format: int32 - ResponseDTO: - type: object - additionalProperties: false - properties: - label: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - isGood: - type: boolean - order: - type: integer - format: int32 - LevelDTO: - type: object - additionalProperties: false - properties: - label: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - resourceId: - type: string - nullable: true - source: - type: string - nullable: true - ArticleDTO: - type: object - additionalProperties: false - properties: - content: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - qrCode: - type: string - nullable: true - isContentTop: - type: boolean - audioId: - type: string - nullable: true - isReadAudioAuto: - type: boolean - images: - type: array - nullable: true - items: - $ref: '#/components/schemas/ImageDTO' - User: - type: object - additionalProperties: false - properties: - id: - type: string - nullable: true - email: - type: string - nullable: true - password: - type: string - nullable: true - firstName: - type: string - nullable: true - lastName: - type: string - nullable: true - token: - type: string - nullable: true - dateCreation: - type: string - format: date-time - UserDetailDTO: - type: object - additionalProperties: false - properties: - id: - type: string - nullable: true - email: - type: string - nullable: true - firstName: - type: string - nullable: true - lastName: - type: string - nullable: true - TokenDTO: - type: object - additionalProperties: false - properties: - access_token: - type: string - nullable: true - refresh_token: - type: string - nullable: true - scope: - type: string - nullable: true - token_type: - type: string - nullable: true - expires_in: - type: integer - format: int32 - expiration: - type: string - format: date-time - LoginDTO: - type: object - additionalProperties: false - properties: - email: - type: string - nullable: true - password: - type: string - nullable: true - securitySchemes: - bearer: - type: oauth2 - description: Manager Authentication - flows: - password: - authorizationUrl: /authentication/Token - tokenUrl: /api/authentication/Token - scopes: - Manager-api: Manager WebAPI -security: - - bearer: [] -tags: - - name: Configuration - description: Configuration management - - name: Device - description: Device management - - name: Resource - description: Resource management - - name: Section - description: Section management - - name: User - description: User management - - name: Authentication - description: Authentication management diff --git a/lib/constants.dart b/lib/constants.dart index 7f5467e..bda62f7 100644 --- a/lib/constants.dart +++ b/lib/constants.dart @@ -19,6 +19,12 @@ const kSuccess = Color(0xFF8bc34a); const List section_types = ["Map", "Slider", "Video", "Web", "Menu", "Quizz", "Article", "PDF", "Puzzle", "Agenda"]; const List map_types = ["none", "normal", "satellite", "terrain", "hybrid"]; const List languages = ["FR", "NL", "EN", "DE", "IT", "ES", "CN", "PL", "AR", "UK"]; +const List map_types_mapBox = ["standard", "streets", "outdoors", "light", "dark", "satellite", "satellite_streets"]; +const List map_providers = ["Google", "MapBox"]; + +const kTitleMaxLength = 110; +const kDescriptionMaxLength = 2500; + List resource_types = [ ResourceTypeModel(label: "Image", type: ResourceType.Image), ResourceTypeModel(label: "Image url", type: ResourceType.ImageUrl), diff --git a/manager_api_new/.openapi-generator/FILES b/manager_api_new/.openapi-generator/FILES index 091da7e..7d78126 100644 --- a/manager_api_new/.openapi-generator/FILES +++ b/manager_api_new/.openapi-generator/FILES @@ -24,8 +24,14 @@ doc/InstanceDTO.md doc/LevelDTO.md doc/LoginDTO.md doc/MapDTO.md +doc/MapDTOMapProvider.md +doc/MapDTOMapType.md +doc/MapDTOMapTypeMapbox.md +doc/MapProvider.md doc/MapTypeApp.md +doc/MapTypeMapBox.md doc/MenuDTO.md +doc/PDFFileDTO.md doc/PdfDTO.md doc/PlayerMessageDTO.md doc/PuzzleDTO.md @@ -84,9 +90,15 @@ lib/model/instance_dto.dart lib/model/level_dto.dart lib/model/login_dto.dart lib/model/map_dto.dart +lib/model/map_dto_map_provider.dart +lib/model/map_dto_map_type.dart +lib/model/map_dto_map_type_mapbox.dart +lib/model/map_provider.dart lib/model/map_type_app.dart +lib/model/map_type_map_box.dart lib/model/menu_dto.dart lib/model/pdf_dto.dart +lib/model/pdf_file_dto.dart lib/model/player_message_dto.dart lib/model/puzzle_dto.dart lib/model/puzzle_dto_image.dart @@ -107,3 +119,4 @@ lib/model/user_detail_dto.dart lib/model/video_dto.dart lib/model/web_dto.dart pubspec.yaml +test/pdf_file_dto_test.dart diff --git a/manager_api_new/README.md b/manager_api_new/README.md index 65d8acd..4913527 100644 --- a/manager_api_new/README.md +++ b/manager_api_new/README.md @@ -141,8 +141,14 @@ Class | Method | HTTP request | Description - [LevelDTO](doc\/LevelDTO.md) - [LoginDTO](doc\/LoginDTO.md) - [MapDTO](doc\/MapDTO.md) + - [MapDTOMapProvider](doc\/MapDTOMapProvider.md) + - [MapDTOMapType](doc\/MapDTOMapType.md) + - [MapDTOMapTypeMapbox](doc\/MapDTOMapTypeMapbox.md) + - [MapProvider](doc\/MapProvider.md) - [MapTypeApp](doc\/MapTypeApp.md) + - [MapTypeMapBox](doc\/MapTypeMapBox.md) - [MenuDTO](doc\/MenuDTO.md) + - [PDFFileDTO](doc\/PDFFileDTO.md) - [PdfDTO](doc\/PdfDTO.md) - [PlayerMessageDTO](doc\/PlayerMessageDTO.md) - [PuzzleDTO](doc\/PuzzleDTO.md) diff --git a/manager_api_new/doc/AgendaDTO.md b/manager_api_new/doc/AgendaDTO.md index 48800b2..7d91c0a 100644 --- a/manager_api_new/doc/AgendaDTO.md +++ b/manager_api_new/doc/AgendaDTO.md @@ -9,6 +9,7 @@ import 'package:manager_api_new/api.dart'; Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **resourceIds** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**mapProvider** | [**MapDTOMapProvider**](MapDTOMapProvider.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api_new/doc/MapDTO.md b/manager_api_new/doc/MapDTO.md index 1b4f90a..e636119 100644 --- a/manager_api_new/doc/MapDTO.md +++ b/manager_api_new/doc/MapDTO.md @@ -9,7 +9,9 @@ import 'package:manager_api_new/api.dart'; Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **zoom** | **int** | | [optional] -**mapType** | [**MapTypeApp**](MapTypeApp.md) | | [optional] +**mapType** | [**MapDTOMapType**](MapDTOMapType.md) | | [optional] +**mapTypeMapbox** | [**MapDTOMapTypeMapbox**](MapDTOMapTypeMapbox.md) | | [optional] +**mapProvider** | [**MapDTOMapProvider**](MapDTOMapProvider.md) | | [optional] **points** | [**List**](GeoPointDTO.md) | | [optional] [default to const []] **iconResourceId** | **String** | | [optional] **iconSource** | **String** | | [optional] diff --git a/manager_api_new/doc/MapDTOMapProvider.md b/manager_api_new/doc/MapDTOMapProvider.md new file mode 100644 index 0000000..ab01794 --- /dev/null +++ b/manager_api_new/doc/MapDTOMapProvider.md @@ -0,0 +1,14 @@ +# manager_api_new.model.MapDTOMapProvider + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/doc/MapDTOMapType.md b/manager_api_new/doc/MapDTOMapType.md new file mode 100644 index 0000000..514d3b3 --- /dev/null +++ b/manager_api_new/doc/MapDTOMapType.md @@ -0,0 +1,14 @@ +# manager_api_new.model.MapDTOMapType + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/doc/MapDTOMapTypeMapbox.md b/manager_api_new/doc/MapDTOMapTypeMapbox.md new file mode 100644 index 0000000..9014978 --- /dev/null +++ b/manager_api_new/doc/MapDTOMapTypeMapbox.md @@ -0,0 +1,14 @@ +# manager_api_new.model.MapDTOMapTypeMapbox + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/doc/MapProvider.md b/manager_api_new/doc/MapProvider.md new file mode 100644 index 0000000..21714af --- /dev/null +++ b/manager_api_new/doc/MapProvider.md @@ -0,0 +1,14 @@ +# manager_api_new.model.MapProvider + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/doc/MapTypeMapBox.md b/manager_api_new/doc/MapTypeMapBox.md new file mode 100644 index 0000000..561b3a4 --- /dev/null +++ b/manager_api_new/doc/MapTypeMapBox.md @@ -0,0 +1,14 @@ +# manager_api_new.model.MapTypeMapBox + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/doc/PDFFileDTO.md b/manager_api_new/doc/PDFFileDTO.md new file mode 100644 index 0000000..f70fea4 --- /dev/null +++ b/manager_api_new/doc/PDFFileDTO.md @@ -0,0 +1,16 @@ +# manager_api_new.model.PDFFileDTO + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pdfFilesAndTitles** | [**List**](TranslationAndResourceDTO.md) | | [optional] [default to const []] +**order** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/doc/PdfDTO.md b/manager_api_new/doc/PdfDTO.md index 50300aa..19a2efc 100644 --- a/manager_api_new/doc/PdfDTO.md +++ b/manager_api_new/doc/PdfDTO.md @@ -8,8 +8,7 @@ import 'package:manager_api_new/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**resourceId** | **String** | | [optional] -**resourceUrl** | **String** | | [optional] +**pdfs** | [**List**](PDFFileDTO.md) | | [optional] [default to const []] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api_new/doc/QuestionDTOImageBackgroundResourceType.md b/manager_api_new/doc/QuestionDTOImageBackgroundResourceType.md new file mode 100644 index 0000000..fd5da45 --- /dev/null +++ b/manager_api_new/doc/QuestionDTOImageBackgroundResourceType.md @@ -0,0 +1,14 @@ +# manager_api_new.model.QuestionDTOImageBackgroundResourceType + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/lib/api.dart b/manager_api_new/lib/api.dart index 3a2761d..f8ec430 100644 --- a/manager_api_new/lib/api.dart +++ b/manager_api_new/lib/api.dart @@ -53,8 +53,14 @@ part 'model/instance_dto.dart'; part 'model/level_dto.dart'; part 'model/login_dto.dart'; part 'model/map_dto.dart'; +part 'model/map_dto_map_provider.dart'; +part 'model/map_dto_map_type.dart'; +part 'model/map_dto_map_type_mapbox.dart'; +part 'model/map_provider.dart'; part 'model/map_type_app.dart'; +part 'model/map_type_map_box.dart'; part 'model/menu_dto.dart'; +part 'model/pdf_file_dto.dart'; part 'model/pdf_dto.dart'; part 'model/player_message_dto.dart'; part 'model/puzzle_dto.dart'; diff --git a/manager_api_new/lib/api_client.dart b/manager_api_new/lib/api_client.dart index fa3fc94..6ffed59 100644 --- a/manager_api_new/lib/api_client.dart +++ b/manager_api_new/lib/api_client.dart @@ -217,10 +217,22 @@ class ApiClient { return LoginDTO.fromJson(value); case 'MapDTO': return MapDTO.fromJson(value); + case 'MapDTOMapProvider': + return MapDTOMapProvider.fromJson(value); + case 'MapDTOMapType': + return MapDTOMapType.fromJson(value); + case 'MapDTOMapTypeMapbox': + return MapDTOMapTypeMapbox.fromJson(value); + case 'MapProvider': + return MapProviderTypeTransformer().decode(value); case 'MapTypeApp': return MapTypeAppTypeTransformer().decode(value); + case 'MapTypeMapBox': + return MapTypeMapBoxTypeTransformer().decode(value); case 'MenuDTO': return MenuDTO.fromJson(value); + case 'PDFFileDTO': + return PDFFileDTO.fromJson(value); case 'PdfDTO': return PdfDTO.fromJson(value); case 'PlayerMessageDTO': diff --git a/manager_api_new/lib/api_helper.dart b/manager_api_new/lib/api_helper.dart index fbfe3c5..d13d9d7 100644 --- a/manager_api_new/lib/api_helper.dart +++ b/manager_api_new/lib/api_helper.dart @@ -55,9 +55,15 @@ String parameterToString(dynamic value) { if (value is DateTime) { return value.toUtc().toIso8601String(); } + if (value is MapProvider) { + return MapProviderTypeTransformer().encode(value).toString(); + } if (value is MapTypeApp) { return MapTypeAppTypeTransformer().encode(value).toString(); } + if (value is MapTypeMapBox) { + return MapTypeMapBoxTypeTransformer().encode(value).toString(); + } if (value is ResourceType) { return ResourceTypeTypeTransformer().encode(value).toString(); } diff --git a/manager_api_new/lib/model/agenda_dto.dart b/manager_api_new/lib/model/agenda_dto.dart index e3cac18..27e2e1b 100644 --- a/manager_api_new/lib/model/agenda_dto.dart +++ b/manager_api_new/lib/model/agenda_dto.dart @@ -14,21 +14,26 @@ class AgendaDTO { /// Returns a new [AgendaDTO] instance. AgendaDTO({ this.resourceIds = const [], + this.mapProvider, }); List? resourceIds; + MapProvider? mapProvider; + @override bool operator ==(Object other) => identical(this, other) || other is AgendaDTO && - other.resourceIds == resourceIds; + other.resourceIds == resourceIds && + other.mapProvider == mapProvider; @override int get hashCode => // ignore: unnecessary_parenthesis - (resourceIds == null ? 0 : resourceIds!.hashCode); + (resourceIds == null ? 0 : resourceIds!.hashCode) + + (mapProvider == null ? 0 : mapProvider!.hashCode); @override - String toString() => 'AgendaDTO[resourceIds=$resourceIds]'; + String toString() => 'AgendaDTO[resourceIds=$resourceIds, mapProvider=$mapProvider]'; Map toJson() { final json = {}; @@ -37,6 +42,11 @@ class AgendaDTO { } else { json[r'resourceIds'] = null; } + if (this.mapProvider != null) { + json[r'mapProvider'] = this.mapProvider; + } else { + json[r'mapProvider'] = null; + } return json; } @@ -60,6 +70,7 @@ class AgendaDTO { return AgendaDTO( resourceIds: TranslationDTO.listFromJson(json[r'resourceIds']), + mapProvider: MapProvider.fromJson(json[r'mapProvider']), ); } return null; diff --git a/manager_api_new/lib/model/map_dto.dart b/manager_api_new/lib/model/map_dto.dart index c9614c2..3507560 100644 --- a/manager_api_new/lib/model/map_dto.dart +++ b/manager_api_new/lib/model/map_dto.dart @@ -15,6 +15,8 @@ class MapDTO { MapDTO({ this.zoom, this.mapType, + this.mapTypeMapbox, + this.mapProvider, this.points = const [], this.iconResourceId, this.iconSource, @@ -29,14 +31,12 @@ class MapDTO { /// int? zoom; - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// MapTypeApp? mapType; + MapTypeMapBox? mapTypeMapbox; + + MapProvider? mapProvider; + List? points; String? iconResourceId; @@ -47,25 +47,29 @@ class MapDTO { @override bool operator ==(Object other) => identical(this, other) || other is MapDTO && - other.zoom == zoom && - other.mapType == mapType && - other.points == points && - other.iconResourceId == iconResourceId && - other.iconSource == iconSource && - other.categories == categories; + other.zoom == zoom && + other.mapType == mapType && + other.mapTypeMapbox == mapTypeMapbox && + other.mapProvider == mapProvider && + other.points == points && + other.iconResourceId == iconResourceId && + other.iconSource == iconSource && + other.categories == categories; @override int get hashCode => - // ignore: unnecessary_parenthesis - (zoom == null ? 0 : zoom!.hashCode) + - (mapType == null ? 0 : mapType!.hashCode) + - (points == null ? 0 : points!.hashCode) + - (iconResourceId == null ? 0 : iconResourceId!.hashCode) + - (iconSource == null ? 0 : iconSource!.hashCode) + - (categories == null ? 0 : categories!.hashCode); + // ignore: unnecessary_parenthesis + (zoom == null ? 0 : zoom!.hashCode) + + (mapType == null ? 0 : mapType!.hashCode) + + (mapTypeMapbox == null ? 0 : mapTypeMapbox!.hashCode) + + (mapProvider == null ? 0 : mapProvider!.hashCode) + + (points == null ? 0 : points!.hashCode) + + (iconResourceId == null ? 0 : iconResourceId!.hashCode) + + (iconSource == null ? 0 : iconSource!.hashCode) + + (categories == null ? 0 : categories!.hashCode); @override - String toString() => 'MapDTO[zoom=$zoom, mapType=$mapType, points=$points, iconResourceId=$iconResourceId, iconSource=$iconSource, categories=$categories]'; + String toString() => 'MapDTO[zoom=$zoom, mapType=$mapType, mapTypeMapbox=$mapTypeMapbox, mapProvider=$mapProvider, points=$points, iconResourceId=$iconResourceId, iconSource=$iconSource, categories=$categories]'; Map toJson() { final json = {}; @@ -79,6 +83,16 @@ class MapDTO { } else { json[r'mapType'] = null; } + if (this.mapTypeMapbox != null) { + json[r'mapTypeMapbox'] = this.mapTypeMapbox; + } else { + json[r'mapTypeMapbox'] = null; + } + if (this.mapProvider != null) { + json[r'mapProvider'] = this.mapProvider; + } else { + json[r'mapProvider'] = null; + } if (this.points != null) { json[r'points'] = this.points; } else { @@ -123,6 +137,8 @@ class MapDTO { return MapDTO( zoom: mapValueOfType(json, r'zoom'), mapType: MapTypeApp.fromJson(json[r'mapType']), + mapTypeMapbox: MapTypeMapBox.fromJson(json[r'mapTypeMapbox']), + mapProvider: MapProvider.fromJson(json[r'mapProvider']), points: GeoPointDTO.listFromJson(json[r'points']), iconResourceId: mapValueOfType(json, r'iconResourceId'), iconSource: mapValueOfType(json, r'iconSource'), diff --git a/manager_api_new/lib/model/map_dto_map_provider.dart b/manager_api_new/lib/model/map_dto_map_provider.dart new file mode 100644 index 0000000..2ab6869 --- /dev/null +++ b/manager_api_new/lib/model/map_dto_map_provider.dart @@ -0,0 +1,96 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class MapDTOMapProvider { + /// Returns a new [MapDTOMapProvider] instance. + MapDTOMapProvider(); + + @override + bool operator ==(Object other) => identical(this, other) || other is MapDTOMapProvider; + + @override + String toString() => 'MapDTOMapProvider[]'; + + Map toJson() { + final json = {}; + return json; + } + + /// Returns a new [MapDTOMapProvider] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static MapDTOMapProvider? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "MapDTOMapProvider[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "MapDTOMapProvider[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return MapDTOMapProvider( + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = MapDTOMapProvider.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = MapDTOMapProvider.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of MapDTOMapProvider-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = MapDTOMapProvider.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} + diff --git a/manager_api_new/lib/model/map_dto_map_type.dart b/manager_api_new/lib/model/map_dto_map_type.dart new file mode 100644 index 0000000..8b78f37 --- /dev/null +++ b/manager_api_new/lib/model/map_dto_map_type.dart @@ -0,0 +1,96 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class MapDTOMapType { + /// Returns a new [MapDTOMapType] instance. + MapDTOMapType(); + + @override + bool operator ==(Object other) => identical(this, other) || other is MapDTOMapType; + + @override + String toString() => 'MapDTOMapType[]'; + + Map toJson() { + final json = {}; + return json; + } + + /// Returns a new [MapDTOMapType] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static MapDTOMapType? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "MapDTOMapType[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "MapDTOMapType[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return MapDTOMapType( + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = MapDTOMapType.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = MapDTOMapType.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of MapDTOMapType-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = MapDTOMapType.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} + diff --git a/manager_api_new/lib/model/map_dto_map_type_mapbox.dart b/manager_api_new/lib/model/map_dto_map_type_mapbox.dart new file mode 100644 index 0000000..2c164f5 --- /dev/null +++ b/manager_api_new/lib/model/map_dto_map_type_mapbox.dart @@ -0,0 +1,96 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class MapDTOMapTypeMapbox { + /// Returns a new [MapDTOMapTypeMapbox] instance. + MapDTOMapTypeMapbox(); + + @override + bool operator ==(Object other) => identical(this, other) || other is MapDTOMapTypeMapbox; + + @override + String toString() => 'MapDTOMapTypeMapbox[]'; + + Map toJson() { + final json = {}; + return json; + } + + /// Returns a new [MapDTOMapTypeMapbox] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static MapDTOMapTypeMapbox? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "MapDTOMapTypeMapbox[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "MapDTOMapTypeMapbox[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return MapDTOMapTypeMapbox( + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = MapDTOMapTypeMapbox.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = MapDTOMapTypeMapbox.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of MapDTOMapTypeMapbox-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = MapDTOMapTypeMapbox.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} + diff --git a/manager_api_new/lib/model/map_provider.dart b/manager_api_new/lib/model/map_provider.dart new file mode 100644 index 0000000..c017c9b --- /dev/null +++ b/manager_api_new/lib/model/map_provider.dart @@ -0,0 +1,98 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +/// 0 = Google 1 = MapBox +class MapProvider { + /// Instantiate a new enum with the provided [value]. + const MapProvider._(this.value); + + /// The underlying value of this enum member. + final int value; + + @override + String toString() => value.toString(); + + int toJson() => value; + + static const Google = MapProvider._(0); + static const MapBox = MapProvider._(1); + + /// List of all possible values in this [enum][MapProvider]. + static const values = [ + Google, + MapBox, + ]; + + static MapProvider? fromJson(dynamic value) => MapProviderTypeTransformer().decode(value); + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = MapProvider.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } +} + +/// Transformation class that can [encode] an instance of [MapProvider] to int, +/// and [decode] dynamic data back to [MapProvider]. +class MapProviderTypeTransformer { + factory MapProviderTypeTransformer() => _instance ??= const MapProviderTypeTransformer._(); + + const MapProviderTypeTransformer._(); + + int encode(MapProvider data) => data.value; + + /// Decodes a [dynamic value][data] to a MapProvider. + /// + /// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully, + /// then null is returned. However, if [allowNull] is false and the [dynamic value][data] + /// cannot be decoded successfully, then an [UnimplementedError] is thrown. + /// + /// The [allowNull] is very handy when an API changes and a new enum value is added or removed, + /// and users are still using an old app with the old code. + MapProvider? decode(dynamic data, {bool allowNull = true}) { + if (data != null) { + if(data.runtimeType == String) { + switch (data.toString().toLowerCase()) { + case r'google': return MapProvider.Google; + case r'mapbox': return MapProvider.MapBox; + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + } else { + if(data.runtimeType == int) { + switch (data) { + case 0: return MapProvider.Google; + case 1: return MapProvider.MapBox; + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + } + } + } + return null; + } + + /// Singleton [MapProviderTypeTransformer] instance. + static MapProviderTypeTransformer? _instance; +} + diff --git a/manager_api_new/lib/model/map_type_map_box.dart b/manager_api_new/lib/model/map_type_map_box.dart new file mode 100644 index 0000000..7aaad20 --- /dev/null +++ b/manager_api_new/lib/model/map_type_map_box.dart @@ -0,0 +1,119 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +/// 0 = standard 1 = streets 2 = outdoors 3 = light 4 = dark 5 = satellite 6 = satellite_streets +class MapTypeMapBox { + /// Instantiate a new enum with the provided [value]. + const MapTypeMapBox._(this.value); + + /// The underlying value of this enum member. + final int value; + + @override + String toString() => value.toString(); + + int toJson() => value; + + static const standard = MapTypeMapBox._(0); + static const streets = MapTypeMapBox._(1); + static const outdoors = MapTypeMapBox._(2); + static const light = MapTypeMapBox._(3); + static const dark = MapTypeMapBox._(4); + static const satellite = MapTypeMapBox._(5); + static const satellite_streets = MapTypeMapBox._(6); + + /// List of all possible values in this [enum][MapTypeMapBox]. + static const values = [ + standard, + streets, + outdoors, + light, + dark, + satellite, + satellite_streets, + ]; + + static MapTypeMapBox? fromJson(dynamic value) => MapTypeMapBoxTypeTransformer().decode(value); + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = MapTypeMapBox.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } +} + +/// Transformation class that can [encode] an instance of [MapTypeMapBox] to int, +/// and [decode] dynamic data back to [MapTypeMapBox]. +class MapTypeMapBoxTypeTransformer { + factory MapTypeMapBoxTypeTransformer() => _instance ??= const MapTypeMapBoxTypeTransformer._(); + + const MapTypeMapBoxTypeTransformer._(); + + int encode(MapTypeMapBox data) => data.value; + + /// Decodes a [dynamic value][data] to a MapTypeMapBox. + /// + /// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully, + /// then null is returned. However, if [allowNull] is false and the [dynamic value][data] + /// cannot be decoded successfully, then an [UnimplementedError] is thrown. + /// + /// The [allowNull] is very handy when an API changes and a new enum value is added or removed, + /// and users are still using an old app with the old code. + MapTypeMapBox? decode(dynamic data, {bool allowNull = true}) { + if (data != null) { + if(data.runtimeType == String) { + switch (data.toString().toLowerCase()) { + case r'standard': return MapTypeMapBox.standard; + case r'streets': return MapTypeMapBox.streets; + case r'outdoors': return MapTypeMapBox.outdoors; + case r'light': return MapTypeMapBox.light; + case r'dark': return MapTypeMapBox.dark; + case r'satellite': return MapTypeMapBox.satellite; + case r'satellite_streets': return MapTypeMapBox.satellite_streets; + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + } else { + if(data.runtimeType == int) { + switch (data) { + case 0: return MapTypeMapBox.standard; + case 1: return MapTypeMapBox.streets; + case 2: return MapTypeMapBox.outdoors; + case 3: return MapTypeMapBox.light; + case 4: return MapTypeMapBox.dark; + case 5: return MapTypeMapBox.satellite; + case 6: return MapTypeMapBox.satellite_streets; + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + } + } + + } + return null; + } + + /// Singleton [MapTypeMapBoxTypeTransformer] instance. + static MapTypeMapBoxTypeTransformer? _instance; +} + diff --git a/manager_api_new/lib/model/pdf_dto.dart b/manager_api_new/lib/model/pdf_dto.dart index a6242cc..53cb445 100644 --- a/manager_api_new/lib/model/pdf_dto.dart +++ b/manager_api_new/lib/model/pdf_dto.dart @@ -13,39 +13,29 @@ part of openapi.api; class PdfDTO { /// Returns a new [PdfDTO] instance. PdfDTO({ - this.resourceId, - this.resourceUrl, + this.pdfs = const [], }); - String? resourceId; - - String? resourceUrl; + List? pdfs; @override bool operator ==(Object other) => identical(this, other) || other is PdfDTO && - other.resourceId == resourceId && - other.resourceUrl == resourceUrl; + other.pdfs == pdfs; @override int get hashCode => // ignore: unnecessary_parenthesis - (resourceId == null ? 0 : resourceId!.hashCode) + - (resourceUrl == null ? 0 : resourceUrl!.hashCode); + (pdfs == null ? 0 : pdfs!.hashCode); @override - String toString() => 'PdfDTO[resourceId=$resourceId, resourceUrl=$resourceUrl]'; + String toString() => 'PdfDTO[pdfs=$pdfs]'; Map toJson() { final json = {}; - if (this.resourceId != null) { - json[r'resourceId'] = this.resourceId; + if (this.pdfs != null) { + json[r'pdfs'] = this.pdfs; } else { - json[r'resourceId'] = null; - } - if (this.resourceUrl != null) { - json[r'resourceUrl'] = this.resourceUrl; - } else { - json[r'resourceUrl'] = null; + json[r'pdfs'] = null; } return json; } @@ -69,8 +59,7 @@ class PdfDTO { }()); return PdfDTO( - resourceId: mapValueOfType(json, r'resourceId'), - resourceUrl: mapValueOfType(json, r'resourceUrl'), + pdfs: PDFFileDTO.listFromJson(json[r'pdfs']), ); } return null; diff --git a/manager_api_new/lib/model/pdf_file_dto.dart b/manager_api_new/lib/model/pdf_file_dto.dart new file mode 100644 index 0000000..fbe682e --- /dev/null +++ b/manager_api_new/lib/model/pdf_file_dto.dart @@ -0,0 +1,123 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class PDFFileDTO { + /// Returns a new [PDFFileDTO] instance. + PDFFileDTO({ + this.pdfFilesAndTitles = const [], + this.order, + }); + + List? pdfFilesAndTitles; + + int? order; + + @override + bool operator ==(Object other) => identical(this, other) || other is PDFFileDTO && + other.pdfFilesAndTitles == pdfFilesAndTitles && + other.order == order; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (pdfFilesAndTitles == null ? 0 : pdfFilesAndTitles!.hashCode) + + (order == null ? 0 : order!.hashCode); + + @override + String toString() => 'PDFFileDTO[pdfFilesAndTitles=$pdfFilesAndTitles, order=$order]'; + + Map toJson() { + final json = {}; + if (this.pdfFilesAndTitles != null) { + json[r'pdfFilesAndTitles'] = this.pdfFilesAndTitles; + } else { + json[r'pdfFilesAndTitles'] = null; + } + if (this.order != null) { + json[r'order'] = this.order; + } else { + json[r'order'] = null; + } + return json; + } + + /// Returns a new [PDFFileDTO] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static PDFFileDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "PDFFileDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "PDFFileDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return PDFFileDTO( + pdfFilesAndTitles: TranslationAndResourceDTO.listFromJson(json[r'pdfFilesAndTitles']), + order: mapValueOfType(json, r'order'), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = PDFFileDTO.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = PDFFileDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of PDFFileDTO-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = PDFFileDTO.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} + diff --git a/manager_api_new/test/map_dto_map_provider_test.dart b/manager_api_new/test/map_dto_map_provider_test.dart new file mode 100644 index 0000000..568cad9 --- /dev/null +++ b/manager_api_new/test/map_dto_map_provider_test.dart @@ -0,0 +1,22 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for MapDTOMapProvider +void main() { + // final instance = MapDTOMapProvider(); + + group('test MapDTOMapProvider', () { + + }); + +} diff --git a/manager_api_new/test/map_dto_map_type_mapbox_test.dart b/manager_api_new/test/map_dto_map_type_mapbox_test.dart new file mode 100644 index 0000000..e8411b7 --- /dev/null +++ b/manager_api_new/test/map_dto_map_type_mapbox_test.dart @@ -0,0 +1,22 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for MapDTOMapTypeMapbox +void main() { + // final instance = MapDTOMapTypeMapbox(); + + group('test MapDTOMapTypeMapbox', () { + + }); + +} diff --git a/manager_api_new/test/map_dto_map_type_test.dart b/manager_api_new/test/map_dto_map_type_test.dart new file mode 100644 index 0000000..793444f --- /dev/null +++ b/manager_api_new/test/map_dto_map_type_test.dart @@ -0,0 +1,22 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for MapDTOMapType +void main() { + // final instance = MapDTOMapType(); + + group('test MapDTOMapType', () { + + }); + +} diff --git a/manager_api_new/test/map_provider_test.dart b/manager_api_new/test/map_provider_test.dart new file mode 100644 index 0000000..c1d4e9c --- /dev/null +++ b/manager_api_new/test/map_provider_test.dart @@ -0,0 +1,21 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for MapProvider +void main() { + + group('test MapProvider', () { + + }); + +} diff --git a/manager_api_new/test/map_type_map_box_test.dart b/manager_api_new/test/map_type_map_box_test.dart new file mode 100644 index 0000000..b11e2b7 --- /dev/null +++ b/manager_api_new/test/map_type_map_box_test.dart @@ -0,0 +1,21 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for MapTypeMapBox +void main() { + + group('test MapTypeMapBox', () { + + }); + +} diff --git a/manager_api_new/test/pdf_file_dto_test.dart b/manager_api_new/test/pdf_file_dto_test.dart new file mode 100644 index 0000000..a6d37ca --- /dev/null +++ b/manager_api_new/test/pdf_file_dto_test.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for PDFFileDTO +void main() { + // final instance = PDFFileDTO(); + + group('test PDFFileDTO', () { + // List pdfFilesAndTitles (default value: const []) + test('to test the property `pdfFilesAndTitles`', () async { + // TODO + }); + + + }); + +}