From 9d099a201cf0f911f36c1af8938f36aba2f981a9 Mon Sep 17 00:00:00 2001 From: Thomas Fransolet Date: Fri, 15 Dec 2023 17:00:57 +0100 Subject: [PATCH] Wip handle new entities and updates for visitNamur --- lib/Components/image_input_container.dart | 2 +- lib/Components/resource_tab.dart | 79 ++++++-- lib/Components/upload_image_container.dart | 13 +- .../upload_online_resources_container.dart | 12 +- .../SubSection/Article/article_config.dart | 34 ++-- .../SubSection/Map/geopoint_image_list.dart | 40 ++-- .../Map/listView_card_geoPoint_images.dart | 26 +-- .../Section/SubSection/Map/map_config.dart | 2 +- .../Map/showNewOrUpdateGeoPoint.dart | 12 +- .../SubSection/Menu/showEditSubSection.dart | 2 +- .../Quizz/new_update_question_quizz.dart | 4 +- .../Quizz/new_update_score_quizz.dart | 4 +- .../SubSection/Quizz/quizz_config.dart | 6 +- .../Slider/listView_card_image.dart | 18 +- .../Slider/new_update_image_slider.dart | 46 ++--- .../SubSection/Slider/slider_config.dart | 34 ++-- .../Section/section_detail_screen.dart | 2 +- .../configuration_detail_screen.dart | 2 +- lib/Screens/Main/components/body.dart | 8 +- lib/Screens/Main/main_screen.dart | 4 +- lib/Screens/Resources/new_resource_popup.dart | 6 +- lib/Screens/Resources/resource_body_grid.dart | 8 +- lib/Screens/Resources/resources_screen.dart | 81 ++++++-- lib/Screens/login_screen.dart | 8 +- lib/api/swagger.yaml | 155 +++++++++++++-- lib/constants.dart | 10 +- manager_api_new/.openapi-generator/FILES | 20 +- manager_api_new/README.md | 15 +- manager_api_new/doc/AgendaDTO.md | 16 ++ manager_api_new/doc/ArticleDTO.md | 2 +- manager_api_new/doc/AuthenticationApi.md | 2 +- manager_api_new/doc/CategorieDTO.md | 16 ++ manager_api_new/doc/ConfigurationApi.md | 2 +- manager_api_new/doc/ContentDTO.md | 20 ++ manager_api_new/doc/ContentGeoPoint.md | 18 ++ manager_api_new/doc/DeviceApi.md | 2 +- manager_api_new/doc/GeoPointDTO.md | 3 +- manager_api_new/doc/GeoPointDTOCategorie.md | 16 ++ manager_api_new/doc/ImageDTO.md | 1 + manager_api_new/doc/InstanceApi.md | 2 +- manager_api_new/doc/LevelDTO.md | 3 +- manager_api_new/doc/MapDTO.md | 1 + manager_api_new/doc/PdfDTO.md | 16 ++ manager_api_new/doc/PuzzleDTO.md | 17 ++ manager_api_new/doc/PuzzleDTOImage.md | 20 ++ manager_api_new/doc/QuestionDTO.md | 3 +- manager_api_new/doc/QuizzDTOBadLevel.md | 3 +- manager_api_new/doc/ResourceApi.md | 2 +- manager_api_new/doc/ResourceDTO.md | 2 +- manager_api_new/doc/SectionApi.md | 122 +++++++++++- manager_api_new/doc/SliderDTO.md | 2 +- manager_api_new/doc/UserApi.md | 2 +- manager_api_new/lib/api.dart | 10 +- manager_api_new/lib/api/section_api.dart | 123 ++++++++++++ manager_api_new/lib/api_client.dart | 22 ++- manager_api_new/lib/model/agenda_dto.dart | 123 ++++++++++++ manager_api_new/lib/model/article_dto.dart | 18 +- manager_api_new/lib/model/categorie_dto.dart | 123 ++++++++++++ manager_api_new/lib/model/content_dto.dart | 179 ++++++++++++++++++ .../lib/model/content_geo_point.dart | 151 +++++++++++++++ manager_api_new/lib/model/geo_point_dto.dart | 29 ++- .../lib/model/geo_point_dto_categorie.dart | 123 ++++++++++++ manager_api_new/lib/model/image_dto.dart | 23 ++- manager_api_new/lib/model/level_dto.dart | 35 +++- manager_api_new/lib/model/map_dto.dart | 17 +- manager_api_new/lib/model/pdf_dto.dart | 123 ++++++++++++ manager_api_new/lib/model/puzzle_dto.dart | 134 +++++++++++++ .../lib/model/puzzle_dto_image.dart | 179 ++++++++++++++++++ manager_api_new/lib/model/question_dto.dart | 35 +++- .../lib/model/quizz_dto_bad_level.dart | 35 +++- manager_api_new/lib/model/resource_dto.dart | 18 +- manager_api_new/lib/model/resource_type.dart | 10 +- manager_api_new/lib/model/slider_dto.dart | 18 +- manager_api_new/test/agenda_dto_test.dart | 27 +++ manager_api_new/test/categorie_dto_test.dart | 32 ++++ manager_api_new/test/content_dto_test.dart | 52 +++++ .../test/content_geo_point_test.dart | 42 ++++ .../test/geo_point_dto_categorie_test.dart | 32 ++++ manager_api_new/test/pdf_dto_test.dart | 27 +++ .../test/puzzle_dto_image_test.dart | 52 +++++ manager_api_new/test/puzzle_dto_test.dart | 37 ++++ 81 files changed, 2491 insertions(+), 284 deletions(-) create mode 100644 manager_api_new/doc/AgendaDTO.md create mode 100644 manager_api_new/doc/CategorieDTO.md create mode 100644 manager_api_new/doc/ContentDTO.md create mode 100644 manager_api_new/doc/ContentGeoPoint.md create mode 100644 manager_api_new/doc/GeoPointDTOCategorie.md create mode 100644 manager_api_new/doc/PdfDTO.md create mode 100644 manager_api_new/doc/PuzzleDTO.md create mode 100644 manager_api_new/doc/PuzzleDTOImage.md create mode 100644 manager_api_new/lib/model/agenda_dto.dart create mode 100644 manager_api_new/lib/model/categorie_dto.dart create mode 100644 manager_api_new/lib/model/content_dto.dart create mode 100644 manager_api_new/lib/model/content_geo_point.dart create mode 100644 manager_api_new/lib/model/geo_point_dto_categorie.dart create mode 100644 manager_api_new/lib/model/pdf_dto.dart create mode 100644 manager_api_new/lib/model/puzzle_dto.dart create mode 100644 manager_api_new/lib/model/puzzle_dto_image.dart create mode 100644 manager_api_new/test/agenda_dto_test.dart create mode 100644 manager_api_new/test/categorie_dto_test.dart create mode 100644 manager_api_new/test/content_dto_test.dart create mode 100644 manager_api_new/test/content_geo_point_test.dart create mode 100644 manager_api_new/test/geo_point_dto_categorie_test.dart create mode 100644 manager_api_new/test/pdf_dto_test.dart create mode 100644 manager_api_new/test/puzzle_dto_image_test.dart create mode 100644 manager_api_new/test/puzzle_dto_test.dart diff --git a/lib/Components/image_input_container.dart b/lib/Components/image_input_container.dart index b61a8fa..c220a5c 100644 --- a/lib/Components/image_input_container.dart +++ b/lib/Components/image_input_container.dart @@ -158,7 +158,7 @@ class _ImageInputContainerState extends State { image: resourceDTO != null ? resourceDTO.type != null ? new DecorationImage( fit: widget.imageFit, image: new NetworkImage( - resourceDTO.type! == ResourceType.Image ? (appContext.getContext() as ManagerAppContext).clientAPI!.resourceApi!.apiClient.basePath+"/api/Resource/"+ resourceDTO.id! : resourceDTO.data!, + resourceDTO.url!, // TODO handle multiple type of content ), ) : null : null, boxShadow: [ diff --git a/lib/Components/resource_tab.dart b/lib/Components/resource_tab.dart index 39de2ed..a809b42 100644 --- a/lib/Components/resource_tab.dart +++ b/lib/Components/resource_tab.dart @@ -28,13 +28,11 @@ class _ResourceTabState extends State with SingleTickerProviderStat @override void initState() { - tabsToShow.add(new Tab(text: "Image local")); - tabsToShow.add(new Tab(text: "Image en ligne")); - tabsToShow.add(new Tab(text: "Audio local")); - //tabsToShow.add(new Tab(text: "Vidéo en ligne")); + tabsToShow.add(new Tab(text: "Local")); + tabsToShow.add(new Tab(text: "En ligne")); - _tabController = new TabController(length: 3, vsync: this); - _tabController!.addListener(_handleTabSelection); + _tabController = new TabController(length: 2, vsync: this); + //_tabController!.addListener(_handleTabSelection); super.initState(); } @@ -66,28 +64,28 @@ class _ResourceTabState extends State with SingleTickerProviderStat ); } - void _handleTabSelection() { + /*void _handleTabSelection() { switch(_tabController!.index) { case 0: setState(() { - widget.resourceDTO.data = null; + widget.resourceDTO.url = null; widget.resourceDTO.type = ResourceType.Image; }); break; case 1: setState(() { - widget.resourceDTO.data = null; + widget.resourceDTO.url = null; widget.resourceDTO.type = ResourceType.ImageUrl; }); break; case 2: setState(() { - widget.resourceDTO.data = null; + widget.resourceDTO.url = null; widget.resourceDTO.type = ResourceType.Audio; }); break; } - } + }*/ } getContent(ResourceDTO resourceDTO, Function onFileUpload, Function onFileUploadWeb) { @@ -97,7 +95,7 @@ getContent(ResourceDTO resourceDTO, Function onFileUpload, Function onFileUpload tabsToShow.add( new Padding( padding: EdgeInsets.symmetric(horizontal: 8, vertical: 16), - child: UploadImageContainer( + child: UploadContentContainer( onChanged: (List? files) { onFileUpload(files); resourceDTO.type = ResourceType.Image; @@ -123,8 +121,8 @@ getContent(ResourceDTO resourceDTO, Function onFileUpload, Function onFileUpload ) ); - // Audio local - tabsToShow.add( + // Audio + /*tabsToShow.add( new Padding( padding: EdgeInsets.symmetric(horizontal: 8, vertical: 16), child: UploadAudioContainer( @@ -140,8 +138,25 @@ getContent(ResourceDTO resourceDTO, Function onFileUpload, Function onFileUpload ) ); + // Video + tabsToShow.add( + new Padding( + padding: EdgeInsets.symmetric(horizontal: 8, vertical: 16), + child: UploadContentContainer( + onChanged: (List? files) { + onFileUpload(files); + resourceDTO.type = ResourceType.Video; + }, + onChangedWeb: (List? files) { + onFileUploadWeb(files); + resourceDTO.type = ResourceType.Video; + }, + ), + ) + ); + // Online Video - /*tabsToShow.add( + tabsToShow.add( new Padding( padding: EdgeInsets.symmetric(horizontal: 8, vertical: 16), child: UploadOnlineResourceContainer( @@ -151,6 +166,40 @@ getContent(ResourceDTO resourceDTO, Function onFileUpload, Function onFileUpload }, ), ) + ); + + // PDF + tabsToShow.add( + new Padding( + padding: EdgeInsets.symmetric(horizontal: 8, vertical: 16), + child: UploadContentContainer( + onChanged: (List? files) { + onFileUpload(files); + resourceDTO.type = ResourceType.Pdf; + }, + onChangedWeb: (List? files) { + onFileUploadWeb(files); + resourceDTO.type = ResourceType.Pdf; + }, + ), + ) + ); + + // JSON + tabsToShow.add( + new Padding( + padding: EdgeInsets.symmetric(horizontal: 8, vertical: 16), + child: UploadContentContainer( + onChanged: (List? files) { + onFileUpload(files); + resourceDTO.type = ResourceType.Json; + }, + onChangedWeb: (List? files) { + onFileUploadWeb(files); + resourceDTO.type = ResourceType.Json; + }, + ), + ) );*/ return tabsToShow; } \ No newline at end of file diff --git a/lib/Components/upload_image_container.dart b/lib/Components/upload_image_container.dart index 7b7ccd0..f734a31 100644 --- a/lib/Components/upload_image_container.dart +++ b/lib/Components/upload_image_container.dart @@ -4,20 +4,20 @@ import 'package:manager_app/constants.dart'; import 'package:flutter/material.dart'; import 'package:flutter/foundation.dart' show kIsWeb; -class UploadImageContainer extends StatefulWidget { +class UploadContentContainer extends StatefulWidget { final ValueChanged?> onChanged; final ValueChanged?> onChangedWeb; - const UploadImageContainer({ + const UploadContentContainer({ Key? key, required this.onChanged, required this.onChangedWeb, }) : super(key: key); @override - _UploadImageContainerState createState() => _UploadImageContainerState(); + _UploadContentContainerState createState() => _UploadContentContainerState(); } -class _UploadImageContainerState extends State with SingleTickerProviderStateMixin { +class _UploadContentContainerState extends State with SingleTickerProviderStateMixin { var filePath; File? fileToShow; String? fileToShowWeb; @@ -48,7 +48,7 @@ class _UploadImageContainerState extends State with Single type: FileType.custom, dialogTitle: 'Sélectionner un fichier', allowMultiple: true, - allowedExtensions: ['jpg', 'jpeg', 'png'], + allowedExtensions: ['jpg', 'jpeg', 'png', 'mp3', 'mp4', 'pdf', 'json'], ); if (result != null) { @@ -65,7 +65,7 @@ class _UploadImageContainerState extends State with Single type: FileType.custom, dialogTitle: 'Sélectionner un fichier', allowMultiple: true, - allowedExtensions: ['jpg', 'jpeg', 'png'], + allowedExtensions: ['jpg', 'jpeg', 'png', 'mp3', 'mp4', 'pdf', 'json'], ); if (result != null) { @@ -139,6 +139,7 @@ class _UploadImageContainerState extends State with Single return null; } else { if(fileToShow != null) { + // depends on type.. return Image.file( fileToShow!, height: 200, diff --git a/lib/Components/upload_online_resources_container.dart b/lib/Components/upload_online_resources_container.dart index 48ded7e..468e35a 100644 --- a/lib/Components/upload_online_resources_container.dart +++ b/lib/Components/upload_online_resources_container.dart @@ -105,12 +105,14 @@ class _UploadOnlineResourceContainerState extends State { void initState() { super.initState(); articleDTO = ArticleDTO.fromJson(json.decode(widget.initialValue))!; - List test = new List.from(articleDTO.images!); + List test = new List.from(articleDTO.contents!); - articleDTO.images = test; - articleDTO.images!.sort((a, b) => a.order!.compareTo(b.order!)); + articleDTO.contents = test; + articleDTO.contents!.sort((a, b) => a.order!.compareTo(b.order!)); } @override @@ -53,11 +53,11 @@ class _ArticleConfigState extends State { if (newIndex > oldIndex) { newIndex -= 1; } - final ImageDTO item = articleDTO.images!.removeAt(oldIndex); - articleDTO.images!.insert(newIndex, item); + final ContentDTO item = articleDTO.contents!.removeAt(oldIndex); + articleDTO.contents!.insert(newIndex, item); var i = 0; - articleDTO.images!.forEach((image) { + articleDTO.contents!.forEach((image) { image.order = i; i++; }); @@ -166,21 +166,21 @@ class _ArticleConfigState extends State { scrollDirection: Axis.horizontal, padding: const EdgeInsets.symmetric(vertical: 20.0), children: List.generate( - articleDTO.images!.length, + articleDTO.contents!.length, (index) { - return ListViewCardImage( - articleDTO.images!, + return ListViewCardContent( + articleDTO.contents!, index, Key('$index'), appContext, (images) { setState(() { - List test = new List.from(images); - articleDTO.images = test; - List testToSend = new List.from(images); - testToSend = testToSend.where((element) => element.source_ != null).toList(); + List test = new List.from(images); + articleDTO.contents = test; + List testToSend = new List.from(images); + testToSend = testToSend.where((element) => element.resourceUrl != null).toList(); var articleToSend = new ArticleDTO(); - articleToSend.images = testToSend; + articleToSend.contents = testToSend; articleToSend.audioIds = articleDTO.audioIds; articleToSend.isContentTop = articleDTO.isContentTop; articleToSend.content = articleDTO.content; @@ -209,12 +209,12 @@ class _ArticleConfigState extends State { right: 15, child: InkWell( onTap: () async { - var result = await showNewOrUpdateImageSlider(null, appContext, context, true, false); + var result = await showNewOrUpdateContentSlider(null, appContext, context, true, false); if (result != null) { setState(() { - result.order = articleDTO.images!.length; - articleDTO.images!.add(result); + result.order = articleDTO.contents!.length; + articleDTO.contents!.add(result); widget.onChanged(jsonEncode(articleDTO).toString()); }); } diff --git a/lib/Screens/Configurations/Section/SubSection/Map/geopoint_image_list.dart b/lib/Screens/Configurations/Section/SubSection/Map/geopoint_image_list.dart index b9618c5..5efaaa7 100644 --- a/lib/Screens/Configurations/Section/SubSection/Map/geopoint_image_list.dart +++ b/lib/Screens/Configurations/Section/SubSection/Map/geopoint_image_list.dart @@ -7,26 +7,26 @@ import 'package:manager_app/constants.dart'; import 'package:manager_api_new/api.dart'; import 'package:provider/provider.dart'; -class GeoPointImageList extends StatefulWidget { - final List images; - final ValueChanged> onChanged; - const GeoPointImageList({ +class GeoPointContentList extends StatefulWidget { + final List contents; + final ValueChanged> onChanged; + const GeoPointContentList({ Key? key, - required this.images, + required this.contents, required this.onChanged, }) : super(key: key); @override - _GeoPointImageListState createState() => _GeoPointImageListState(); + _GeoPointContentListState createState() => _GeoPointContentListState(); } -class _GeoPointImageListState extends State { - late List imagesGeo; +class _GeoPointContentListState extends State { + late List contentsGeo; @override void initState() { super.initState(); - imagesGeo = new List.from(widget.images); + contentsGeo = new List.from(widget.contents); } void _onReorder(int oldIndex, int newIndex) { @@ -35,10 +35,10 @@ class _GeoPointImageListState extends State { if (newIndex > oldIndex) { newIndex -= 1; } - final ImageGeoPoint item = imagesGeo.removeAt(oldIndex); - imagesGeo.insert(newIndex, item); + final ContentGeoPoint item = contentsGeo.removeAt(oldIndex); + contentsGeo.insert(newIndex, item); - widget.onChanged(imagesGeo); + widget.onChanged(contentsGeo); }, ); } @@ -57,18 +57,18 @@ class _GeoPointImageListState extends State { scrollDirection: Axis.horizontal, padding: const EdgeInsets.symmetric(vertical: 20.0), children: List.generate( - imagesGeo.length, + contentsGeo.length, (index) { - return ListViewCardGeoPointImages( - imagesGeo, + return ListViewCardGeoPointContents( + contentsGeo, index, Key('$index'), appContext, (imagesOutput) { setState(() { //List test = new List.from(imagesOutput); - imagesGeo = imagesOutput; - widget.onChanged(imagesGeo); + contentsGeo = imagesOutput; + widget.onChanged(contentsGeo); }); } ); @@ -97,12 +97,12 @@ class _GeoPointImageListState extends State { ); if (result != null) { setState(() { - ImageGeoPoint newImage = new ImageGeoPoint(imageResourceId: result.id, imageSource: result.type == ResourceType.ImageUrl ? result.data : (appContext.getContext() as ManagerAppContext).clientAPI!.resourceApi!.apiClient.basePath+"/api/Resource/"+ result.id); + ContentGeoPoint newImage = new ContentGeoPoint(resourceId: result.id, resourceUrl: result.url); //print("REULT IMAGES = "); //print(newImage); - imagesGeo.add(newImage); + contentsGeo.add(newImage); //print(imagesGeo); - widget.onChanged(imagesGeo); + widget.onChanged(contentsGeo); }); } }, diff --git a/lib/Screens/Configurations/Section/SubSection/Map/listView_card_geoPoint_images.dart b/lib/Screens/Configurations/Section/SubSection/Map/listView_card_geoPoint_images.dart index 8bb6d63..18133de 100644 --- a/lib/Screens/Configurations/Section/SubSection/Map/listView_card_geoPoint_images.dart +++ b/lib/Screens/Configurations/Section/SubSection/Map/listView_card_geoPoint_images.dart @@ -4,15 +4,15 @@ import 'package:manager_app/constants.dart'; import 'package:manager_api_new/api.dart'; import 'package:provider/provider.dart'; -class ListViewCardGeoPointImages extends StatefulWidget { +class ListViewCardGeoPointContents extends StatefulWidget { final int index; final Key key; - final List listImages; + final List listContents; final AppContext appContext; - final ValueChanged> onChanged; + final ValueChanged> onChanged; - ListViewCardGeoPointImages( - this.listImages, + ListViewCardGeoPointContents( + this.listContents, this.index, this.key, this.appContext, @@ -20,10 +20,10 @@ class ListViewCardGeoPointImages extends StatefulWidget { ); @override - _ListViewCardGeoPointImagesState createState() => _ListViewCardGeoPointImagesState(); + _ListViewCardGeoPointContentsState createState() => _ListViewCardGeoPointContentsState(); } -class _ListViewCardGeoPointImagesState extends State { +class _ListViewCardGeoPointContentsState extends State { @override Widget build(BuildContext context) { final appContext = Provider.of(context); @@ -43,7 +43,7 @@ class _ListViewCardGeoPointImagesState extends State ),*/ child: Padding( padding: const EdgeInsets.only(right: 30.0), - child: getElement(widget.index, widget.listImages[widget.index], size, appContext) + child: getElement(widget.index, widget.listContents[widget.index], size, appContext) ), ), Positioned( @@ -53,8 +53,8 @@ class _ListViewCardGeoPointImagesState extends State children: [ InkWell( onTap: () { - widget.listImages.removeAt(widget.index); - widget.onChanged(widget.listImages); + widget.listContents.removeAt(widget.index); + widget.onChanged(widget.listContents); }, child: Padding( padding: const EdgeInsets.all(8.0), @@ -74,15 +74,15 @@ class _ListViewCardGeoPointImagesState extends State ); } - getElement(int index, ImageGeoPoint imageGeoPoint, Size size, AppContext appContext) { + getElement(int index, ContentGeoPoint contentGeoPoint, Size size, AppContext appContext) { return Container( width: double.infinity, height: double.infinity, child: Stack( children: [ Center( - child: Image.network( - imageGeoPoint.imageSource!, + child: Image.network( // TODO support video etc + contentGeoPoint.resourceUrl!, fit:BoxFit.scaleDown, loadingBuilder: (BuildContext context, Widget child, ImageChunkEvent? loadingProgress) { diff --git a/lib/Screens/Configurations/Section/SubSection/Map/map_config.dart b/lib/Screens/Configurations/Section/SubSection/Map/map_config.dart index b341a1f..b9fd7fb 100644 --- a/lib/Screens/Configurations/Section/SubSection/Map/map_config.dart +++ b/lib/Screens/Configurations/Section/SubSection/Map/map_config.dart @@ -98,7 +98,7 @@ class _MapConfigState extends State { mapDTO.iconResourceId = null; } else { mapDTO.iconResourceId = resource.id; - mapDTO.iconSource = resource.type == ResourceType.ImageUrl ? resource.data : (appContext.getContext() as ManagerAppContext).clientAPI!.resourceApi!.apiClient.basePath+"/api/Resource/"+ resource.id!; + mapDTO.iconSource = resource.url; } widget.onChanged(jsonEncode(mapDTO).toString()); }, diff --git a/lib/Screens/Configurations/Section/SubSection/Map/showNewOrUpdateGeoPoint.dart b/lib/Screens/Configurations/Section/SubSection/Map/showNewOrUpdateGeoPoint.dart index a6840d8..d806bde 100644 --- a/lib/Screens/Configurations/Section/SubSection/Map/showNewOrUpdateGeoPoint.dart +++ b/lib/Screens/Configurations/Section/SubSection/Map/showNewOrUpdateGeoPoint.dart @@ -18,7 +18,7 @@ void showNewOrUpdateGeoPoint(GeoPointDTO? inputGeoPointDTO, Function getResult, } else { geoPointDTO.title = []; geoPointDTO.description = []; - geoPointDTO.images = []; + geoPointDTO.contents = []; ManagerAppContext managerAppContext = appContext.getContext(); managerAppContext.selectedConfiguration!.languages!.forEach((element) { @@ -124,10 +124,10 @@ void showNewOrUpdateGeoPoint(GeoPointDTO? inputGeoPointDTO, Function getResult, ), ], ), - child: GeoPointImageList( - images: geoPointDTO.images!, - onChanged: (List imagesOutput) { - geoPointDTO.images = imagesOutput; + child: GeoPointContentList( + contents: geoPointDTO.contents!, + onChanged: (List contentsOutput) { + geoPointDTO.contents = contentsOutput; }, ), ), @@ -152,7 +152,7 @@ void showNewOrUpdateGeoPoint(GeoPointDTO? inputGeoPointDTO, Function getResult, color: kSecond, press: () { if (inputGeoPointDTO != null) { - geoPointDTO.images = inputGeoPointDTO.images; + geoPointDTO.contents = inputGeoPointDTO.contents; } Navigator.of(context).pop(); }, diff --git a/lib/Screens/Configurations/Section/SubSection/Menu/showEditSubSection.dart b/lib/Screens/Configurations/Section/SubSection/Menu/showEditSubSection.dart index b1af686..d5c6099 100644 --- a/lib/Screens/Configurations/Section/SubSection/Menu/showEditSubSection.dart +++ b/lib/Screens/Configurations/Section/SubSection/Menu/showEditSubSection.dart @@ -53,7 +53,7 @@ void showEditSubSection(SectionDTO subSectionDTO, Function getResult, AppContext subSectionDTO.imageSource = null; } else { subSectionDTO.imageId = resource.id; - subSectionDTO.imageSource = resource.type == ResourceType.ImageUrl ? resource.data : (appContext.getContext() as ManagerAppContext).clientAPI!.resourceApi!.apiClient.basePath+"/api/Resource/"+ resource.id!; + subSectionDTO.imageSource = resource.url; } }, isSmall: true, diff --git a/lib/Screens/Configurations/Section/SubSection/Quizz/new_update_question_quizz.dart b/lib/Screens/Configurations/Section/SubSection/Quizz/new_update_question_quizz.dart index e2c6142..3d8d307 100644 --- a/lib/Screens/Configurations/Section/SubSection/Quizz/new_update_question_quizz.dart +++ b/lib/Screens/Configurations/Section/SubSection/Quizz/new_update_question_quizz.dart @@ -62,10 +62,10 @@ Future showNewOrUpdateQuestionQuizz(QuestionDTO? inputQuestionDTO, onChanged: (ResourceDTO resource) { if(resource.id == null) { questionDTO.resourceId = null; - questionDTO.source_ = null; + questionDTO.resourceUrl = null; } else { questionDTO.resourceId = resource.id; - questionDTO.source_ = resource.type == ResourceType.ImageUrl ? resource.data : (appContext.getContext() as ManagerAppContext).clientAPI!.resourceApi!.apiClient.basePath+"/api/Resource/"+ resource.id!; + questionDTO.resourceUrl = resource.url; } }, isSmall: true diff --git a/lib/Screens/Configurations/Section/SubSection/Quizz/new_update_score_quizz.dart b/lib/Screens/Configurations/Section/SubSection/Quizz/new_update_score_quizz.dart index 61a6f6d..ec518cf 100644 --- a/lib/Screens/Configurations/Section/SubSection/Quizz/new_update_score_quizz.dart +++ b/lib/Screens/Configurations/Section/SubSection/Quizz/new_update_score_quizz.dart @@ -51,10 +51,10 @@ Future showNewOrUpdateScoreQuizz(LevelDTO? inputLevelDTO, AppContext onChanged: (ResourceDTO resource) { if(resource.id == null) { levelDTO.resourceId = null; - levelDTO.source_ = null; + levelDTO.resourceUrl = null; } else { levelDTO.resourceId = resource.id; - levelDTO.source_ = resource.type == ResourceType.ImageUrl ? resource.data : (appContext.getContext() as ManagerAppContext).clientAPI!.resourceApi!.apiClient.basePath+"/api/Resource/"+ resource.id!; + levelDTO.resourceUrl = resource.url; } }, isSmall: true diff --git a/lib/Screens/Configurations/Section/SubSection/Quizz/quizz_config.dart b/lib/Screens/Configurations/Section/SubSection/Quizz/quizz_config.dart index dba6c42..9841865 100644 --- a/lib/Screens/Configurations/Section/SubSection/Quizz/quizz_config.dart +++ b/lib/Screens/Configurations/Section/SubSection/Quizz/quizz_config.dart @@ -263,7 +263,7 @@ class _QuizzConfigState extends State { height: 75, child: Row( children: [ - if(question.source_ != null) Container( + if(question.resourceUrl != null) Container( height: 60, width: 60, decoration: imageBoxDecoration(question, appContext), @@ -366,10 +366,10 @@ imageBoxDecoration(QuestionDTO questionDTO, appContext) { shape: BoxShape.rectangle, border: Border.all(width: 1.5, color: kSecond), borderRadius: BorderRadius.circular(10.0), - image: questionDTO.source_ != null ? new DecorationImage( + image: questionDTO.resourceUrl != null ? new DecorationImage( fit: BoxFit.cover, image: new NetworkImage( - questionDTO.source_!, + questionDTO.resourceUrl!, ), ) : null, ); diff --git a/lib/Screens/Configurations/Section/SubSection/Slider/listView_card_image.dart b/lib/Screens/Configurations/Section/SubSection/Slider/listView_card_image.dart index 9b1c86f..92c209b 100644 --- a/lib/Screens/Configurations/Section/SubSection/Slider/listView_card_image.dart +++ b/lib/Screens/Configurations/Section/SubSection/Slider/listView_card_image.dart @@ -6,16 +6,16 @@ import 'package:manager_app/constants.dart'; import 'package:manager_api_new/api.dart'; import 'package:flutter_widget_from_html/flutter_widget_from_html.dart'; -class ListViewCardImage extends StatefulWidget { +class ListViewCardContent extends StatefulWidget { final int index; final Key key; - final List listItems; + final List listItems; final AppContext appContext; - final ValueChanged> onChanged; + final ValueChanged> onChanged; final bool showTitleTranslations; final bool showDescriptionTranslations; - ListViewCardImage( + ListViewCardContent( this.listItems, this.index, this.key, @@ -29,7 +29,7 @@ class ListViewCardImage extends StatefulWidget { _ListViewCard createState() => _ListViewCard(); } -class _ListViewCard extends State { +class _ListViewCard extends State { @override Widget build(BuildContext context) { return Card( @@ -87,7 +87,7 @@ class _ListViewCard extends State { children: [ InkWell( onTap: () async { - var result = await showNewOrUpdateImageSlider( + var result = await showNewOrUpdateContentSlider( widget.listItems[widget.index], widget.appContext, context, @@ -134,16 +134,16 @@ class _ListViewCard extends State { } } -boxDecoration(ImageDTO imageDTO, appContext) { +boxDecoration(ContentDTO contentDTO, appContext) { return BoxDecoration( color: kBackgroundColor, shape: BoxShape.rectangle, border: Border.all(width: 1.5, color: kSecond), borderRadius: BorderRadius.circular(10.0), - image: imageDTO.title != null && imageDTO.source_ != null ? new DecorationImage( + image: contentDTO.title != null && contentDTO.resourceUrl != null ? new DecorationImage( fit: BoxFit.scaleDown, image: new NetworkImage( - imageDTO.source_!, + contentDTO.resourceUrl!, ), ) : null, boxShadow: [ diff --git a/lib/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart b/lib/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart index ab69351..d09e5fd 100644 --- a/lib/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart +++ b/lib/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart @@ -9,14 +9,14 @@ import 'package:manager_app/app_context.dart'; import 'package:manager_app/constants.dart'; import 'package:manager_api_new/api.dart'; -Future showNewOrUpdateImageSlider(ImageDTO? inputImageDTO, AppContext appContext, BuildContext context, bool showTitle, bool showDescription) async { - ImageDTO imageDTO = new ImageDTO(); +Future showNewOrUpdateContentSlider(ContentDTO? inputContentDTO, AppContext appContext, BuildContext context, bool showTitle, bool showDescription) async { + ContentDTO contentDTO = new ContentDTO(); - if (inputImageDTO != null) { - imageDTO = inputImageDTO; + if (inputContentDTO != null) { + contentDTO = inputContentDTO; } else { - imageDTO.title = []; - imageDTO.description = []; + contentDTO.title = []; + contentDTO.description = []; ManagerAppContext managerAppContext = appContext.getContext(); managerAppContext.selectedConfiguration!.languages!.forEach((element) { @@ -28,8 +28,8 @@ Future showNewOrUpdateImageSlider(ImageDTO? inputImageDTO, AppContext translationDescriptionDTO.language = element; translationDescriptionDTO.value = ""; - imageDTO.title!.add(translationTitleDTO); - imageDTO.description!.add(translationDescriptionDTO); + contentDTO.title!.add(translationTitleDTO); + contentDTO.description!.add(translationDescriptionDTO); }); } @@ -53,16 +53,16 @@ Future showNewOrUpdateImageSlider(ImageDTO? inputImageDTO, AppContext Center( child: ImageInputContainer( label: "Image :", - initialValue: imageDTO.resourceId, + initialValue: contentDTO.resourceId, color: kPrimaryColor, fontSize: 20, onChanged: (ResourceDTO resource) { if(resource.id == null) { - imageDTO.resourceId = null; - imageDTO.source_ = null; + contentDTO.resourceId = null; + contentDTO.resourceUrl = null; } else { - imageDTO.resourceId = resource.id; - imageDTO.source_ = resource.type == ResourceType.ImageUrl ? resource.data : (appContext.getContext() as ManagerAppContext).clientAPI!.resourceApi!.apiClient.basePath+"/api/Resource/"+ resource.id!; + contentDTO.resourceId = resource.id; + contentDTO.resourceUrl = resource.url; } }, isSmall: true @@ -81,10 +81,10 @@ Future showNewOrUpdateImageSlider(ImageDTO? inputImageDTO, AppContext fontSize: 20, isHTML: true, color: kPrimaryColor, - initialValue: imageDTO.title != null ? imageDTO.title! : [], + initialValue: contentDTO.title != null ? contentDTO.title! : [], onGetResult: (value) { - if (imageDTO.title != value) { - imageDTO.title = value; + if (contentDTO.title != value) { + contentDTO.title = value; } }, maxLines: 1, @@ -96,10 +96,10 @@ Future showNewOrUpdateImageSlider(ImageDTO? inputImageDTO, AppContext fontSize: 20, isHTML: true, color: kPrimaryColor, - initialValue: imageDTO.description != null ? imageDTO.description! : [], + initialValue: contentDTO.description != null ? contentDTO.description! : [], onGetResult: (value) { - if (imageDTO.description != value) { - imageDTO.description = value; + if (contentDTO.description != value) { + contentDTO.description = value; } }, maxLines: 1, @@ -137,16 +137,16 @@ Future showNewOrUpdateImageSlider(ImageDTO? inputImageDTO, AppContext Align( alignment: AlignmentDirectional.bottomEnd, child: Container( - width: inputImageDTO != null ? 220: 150, + width: inputContentDTO != null ? 220: 150, height: 70, child: RoundedButton( - text: inputImageDTO != null ? "Sauvegarder" : "Créer", + text: inputContentDTO != null ? "Sauvegarder" : "Créer", icon: Icons.check, color: kPrimaryColor, textColor: kWhite, press: () { - if (imageDTO.resourceId != null) { - Navigator.pop(dialogContext, imageDTO); + if (contentDTO.resourceId != null) { + Navigator.pop(dialogContext, contentDTO); } }, fontSize: 20, diff --git a/lib/Screens/Configurations/Section/SubSection/Slider/slider_config.dart b/lib/Screens/Configurations/Section/SubSection/Slider/slider_config.dart index 68f5baf..5bd5f00 100644 --- a/lib/Screens/Configurations/Section/SubSection/Slider/slider_config.dart +++ b/lib/Screens/Configurations/Section/SubSection/Slider/slider_config.dart @@ -33,9 +33,9 @@ class _SliderConfigState extends State { super.initState(); sliderDTO = SliderDTO.fromJson(json.decode(widget.initialValue))!; - List test = new List.from(sliderDTO.images!); - sliderDTO.images = test; - sliderDTO.images!.sort((a, b) => a.order!.compareTo(b.order!)); + List test = new List.from(sliderDTO.contents!); + sliderDTO.contents = test; + sliderDTO.contents!.sort((a, b) => a.order!.compareTo(b.order!)); } @override @@ -49,11 +49,11 @@ class _SliderConfigState extends State { if (newIndex > oldIndex) { newIndex -= 1; } - final ImageDTO item = sliderDTO.images!.removeAt(oldIndex); - sliderDTO.images!.insert(newIndex, item); + final ContentDTO item = sliderDTO.contents!.removeAt(oldIndex); + sliderDTO.contents!.insert(newIndex, item); var i = 0; - sliderDTO.images!.forEach((image) { + sliderDTO.contents!.forEach((image) { image.order = i; i++; }); @@ -72,21 +72,21 @@ class _SliderConfigState extends State { scrollDirection: Axis.horizontal, padding: const EdgeInsets.symmetric(vertical: 20.0), children: List.generate( - sliderDTO.images!.length, + sliderDTO.contents!.length, (index) { - return ListViewCardImage( - sliderDTO.images!, + return ListViewCardContent( + sliderDTO.contents!, index, Key('$index'), appContext, (images) { setState(() { - List test = new List.from(images); - sliderDTO.images = test; - List testToSend = new List.from(images); - testToSend = testToSend.where((element) => element.source_ != null).toList(); + List test = new List.from(images); + sliderDTO.contents = test; + List testToSend = new List.from(images); + testToSend = testToSend.where((element) => element.resourceUrl != null).toList(); var sliderToSend = new SliderDTO(); - sliderToSend.images = testToSend; + sliderToSend.contents = testToSend; widget.onChanged(jsonEncode(sliderToSend).toString()); }); }, @@ -102,12 +102,12 @@ class _SliderConfigState extends State { right: 0, child: InkWell( onTap: () async { - var result = await showNewOrUpdateImageSlider(null, appContext, context, true, true); + var result = await showNewOrUpdateContentSlider(null, appContext, context, true, true); if (result != null) { setState(() { - result.order = sliderDTO.images!.length; - sliderDTO.images!.add(result); + result.order = sliderDTO.contents!.length; + sliderDTO.contents!.add(result); widget.onChanged(jsonEncode(sliderDTO).toString()); }); } diff --git a/lib/Screens/Configurations/Section/section_detail_screen.dart b/lib/Screens/Configurations/Section/section_detail_screen.dart index 12006e2..88d5a7b 100644 --- a/lib/Screens/Configurations/Section/section_detail_screen.dart +++ b/lib/Screens/Configurations/Section/section_detail_screen.dart @@ -277,7 +277,7 @@ class _SectionDetailScreenState extends State { sectionDTO.imageSource = null; } else { sectionDTO!.imageId = resource.id; - sectionDTO.imageSource = resource.type == ResourceType.ImageUrl ? resource.data : (appContext.getContext() as ManagerAppContext).clientAPI!.resourceApi!.apiClient.basePath+"/api/Resource/"+ resource.id!; + sectionDTO.imageSource = resource.url; } }, ), diff --git a/lib/Screens/Configurations/configuration_detail_screen.dart b/lib/Screens/Configurations/configuration_detail_screen.dart index d2e8337..14d7413 100644 --- a/lib/Screens/Configurations/configuration_detail_screen.dart +++ b/lib/Screens/Configurations/configuration_detail_screen.dart @@ -292,7 +292,7 @@ class _ConfigurationDetailScreenState extends State { configurationDTO.imageSource = null; } else { configurationDTO.imageId = resource.id; - configurationDTO.imageSource = resource.type == ResourceType.ImageUrl ? resource.data : (appContext.getContext() as ManagerAppContext).clientAPI!.resourceApi!.apiClient.basePath+"/api/Resource/"+ resource.id!; + configurationDTO.imageSource = resource.url; } }, ), diff --git a/lib/Screens/Main/components/body.dart b/lib/Screens/Main/components/body.dart index e86ef51..caca357 100644 --- a/lib/Screens/Main/components/body.dart +++ b/lib/Screens/Main/components/body.dart @@ -37,7 +37,7 @@ class _BodyState extends State { late MenuSection configurations; late MenuSection resources; - Menu menu = new Menu(title: "MyMuseum"); + Menu menu = new Menu(title: "MyInfoMate"); @override void initState() { @@ -217,7 +217,11 @@ class _BodyState extends State { resourceTypes: [ ResourceType.Audio, ResourceType.Image, - ResourceType.ImageUrl + ResourceType.ImageUrl, + ResourceType.Video, + ResourceType.VideoUrl, + ResourceType.Pdf, + ResourceType.Json ] ) ); diff --git a/lib/Screens/Main/main_screen.dart b/lib/Screens/Main/main_screen.dart index b9d8388..98c56ba 100644 --- a/lib/Screens/Main/main_screen.dart +++ b/lib/Screens/Main/main_screen.dart @@ -31,7 +31,7 @@ class _MainScreenState extends State { ); } else { return Scaffold( - appBar: AppBar(title: Text("MyMuseum", style: new TextStyle(color: kPrimaryColor, fontSize: 30, fontWeight: FontWeight.w400, fontFamily: "Helvetica")), backgroundColor: kSecond.withOpacity(0.3), iconTheme: IconThemeData(color: kPrimaryColor)), + appBar: AppBar(title: Text("MyInfoMate", style: new TextStyle(color: kPrimaryColor, fontSize: 30, fontWeight: FontWeight.w400, fontFamily: "Helvetica")), backgroundColor: kSecond.withOpacity(0.3), iconTheme: IconThemeData(color: kPrimaryColor)), drawer: Drawer( child: getMenu() ), @@ -46,7 +46,7 @@ class _MainScreenState extends State { MenuSection configurations = new MenuSection(name: "Configurations", type: "configurations", order: 1); // TODO Visites pour Fort St Héribert MenuSection resources = new MenuSection(name: "Ressources", type: "resources", order: 2); - Menu menu = new Menu(title: "MyMuseum"); + Menu menu = new Menu(title: "MyInfoMate"); return ListView( // Important: Remove any padding from the ListView. diff --git a/lib/Screens/Resources/new_resource_popup.dart b/lib/Screens/Resources/new_resource_popup.dart index 3a56c2b..1264c79 100644 --- a/lib/Screens/Resources/new_resource_popup.dart +++ b/lib/Screens/Resources/new_resource_popup.dart @@ -42,7 +42,7 @@ dynamic showNewResource(AppContext appContext, BuildContext context) async { ], ), Container( - width: size.width *0.5, + width: size.width *0.85, height: size.height *0.5, child: ResourceTab( resourceDTO: resourceDetailDTO, @@ -91,13 +91,13 @@ dynamic showNewResource(AppContext appContext, BuildContext context) async { press: () { if (resourceDetailDTO.label != null && resourceDetailDTO.label!.trim() != '') { if(kIsWeb) { - if(resourceDetailDTO.data != null || filesToSendWeb != null) { + if(resourceDetailDTO.url != null || filesToSendWeb != null) { // TODO clarify resourceDetailDTO.data != null Navigator.pop(context, [resourceDetailDTO, filesToSend, filesToSendWeb]); } else { showNotification(Colors.orange, kWhite, 'Aucun fichier n\'a été chargé', context, null); } } else { - if (resourceDetailDTO.data != null || filesToSendWeb!.length > 0 || filesToSend!.length > 0) { + if (resourceDetailDTO.url != null || filesToSendWeb!.length > 0 || filesToSend!.length > 0) { // TODO clarify resourceDetailDTO.data != null Navigator.pop(context, [resourceDetailDTO, filesToSend, filesToSendWeb]); } else { showNotification(Colors.orange, kWhite, 'Aucun fichier n\'a été chargé', context, null); diff --git a/lib/Screens/Resources/resource_body_grid.dart b/lib/Screens/Resources/resource_body_grid.dart index caa79ad..96a53e8 100644 --- a/lib/Screens/Resources/resource_body_grid.dart +++ b/lib/Screens/Resources/resource_body_grid.dart @@ -190,16 +190,18 @@ class _ResourceBodyGridState extends State { } } -boxDecoration(dynamic resourceDetailDTO, appContext) { +boxDecoration(ResourceDTO resourceDetailDTO, appContext) { + print("boxDecorationboxDecorationboxDecorationboxDecoration"); + print(resourceDetailDTO); return BoxDecoration( color: resourceDetailDTO.id == null ? kSecond : kBackgroundColor, shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(30.0), - image: resourceDetailDTO.id != null && (resourceDetailDTO.type == ResourceType.Image || resourceDetailDTO.data != null && resourceDetailDTO.type == ResourceType.ImageUrl)? new DecorationImage( + image: resourceDetailDTO.id != null && (resourceDetailDTO.type == ResourceType.Image || resourceDetailDTO.url != null && resourceDetailDTO.type == ResourceType.ImageUrl)? new DecorationImage( fit: BoxFit.cover, colorFilter: new ColorFilter.mode(Colors.black.withOpacity(0.3), BlendMode.dstATop), image: new NetworkImage( - resourceDetailDTO.type == ResourceType.Image ? (appContext.getContext() as ManagerAppContext).clientAPI!.resourceApi!.apiClient.basePath+"/api/Resource/"+ resourceDetailDTO.id : resourceDetailDTO.data, + resourceDetailDTO.url!, ), ) : null, boxShadow: [ diff --git a/lib/Screens/Resources/resources_screen.dart b/lib/Screens/Resources/resources_screen.dart index c0a48d4..358147a 100644 --- a/lib/Screens/Resources/resources_screen.dart +++ b/lib/Screens/Resources/resources_screen.dart @@ -121,8 +121,72 @@ Future?> getResources(Function? onGetResult, bool isImage, App return resources; } -Future create(ResourceDTO resourceDTO, List? files, List? filesWeb, AppContext appContext, context) async { - switch(resourceDTO.type) { +Future?> create(ResourceDTO resourceDTO, List? files, List? filesWeb, AppContext appContext, context) async { + List createdResources = []; + print("Coucou create"); + print(resourceDTO); + + ManagerAppContext managerAppContext = appContext.getContext(); + int index = 0; + // TODO handle online resource + for (PlatformFile platformFile in filesWeb!) { + print("Coucou platformFile"); + print(platformFile); + print(platformFile.name); + print(platformFile.extension); + ResourceDTO resourceDTO = new ResourceDTO(label: platformFile.name); + switch(platformFile.extension) { + case 'jpg': + case 'jpeg': + case 'png': + resourceDTO.type = ResourceType.Image; + break; + case 'mp3': + resourceDTO.type = ResourceType.Audio; + break; + case 'mp4': + resourceDTO.type = ResourceType.Video; + break; + case 'pdf': + resourceDTO.type = ResourceType.Pdf; + break; + case 'json': + resourceDTO.type = ResourceType.Json; + break; + } + resourceDTO.instanceId = managerAppContext.instanceId; + try { + print("Trying to create resource"); + resourceDTO.dateCreation = DateTime.now(); + ResourceDTO? newResource = await managerAppContext.clientAPI!.resourceApi!.resourceCreate(resourceDTO); + print("created resource"); + print(newResource); + if(newResource != null && resourceDTO.type != null) { + FirebaseStorage storage = FirebaseStorage.instance; + Reference ref = storage.ref().child('pictures/${appContext.getContext().instanceId}/${Path.basename(newResource.id!.toString())}.${platformFile.extension}'); + + UploadTask uploadTask = ref.putData(platformFile.bytes!); + uploadTask.then((res) { + res.ref.getDownloadURL().then((urlImage) { + showNotification(Colors.green, kWhite, 'La ressource a été créée avec succès', context, null); + newResource.url = urlImage; + (appContext.getContext() as ManagerAppContext).clientAPI!.resourceApi!.resourceUpdate(newResource); + createdResources.add(newResource); + index++; + if(index == filesWeb.length) { + return createdResources; + } + }); + }); + } + } catch(e) { + print("ERROR creating resource"); + print(e); + } + } + return null; + + /*switch(resourceDTO.type) { case ResourceType.Audio: case ResourceType.Image: case ResourceType.Video: @@ -162,8 +226,6 @@ Future create(ResourceDTO resourceDTO, List? files, List create(ResourceDTO resourceDTO, List? files, List create(ResourceDTO resourceDTO, List? files, List create(ResourceDTO resourceDTO, List? files, List create(ResourceDTO resourceDTO, List? files, List { String email = ""; // DEV "test@email.be" String password = ""; // DEV = "kljqsdkljqsd" - String? host = "https://api.mymuseum.be"; // DEV = "http://192.168.31.96" // http://localhost:5000 // https://api.mymuseum.be // myCore http://192.168.31.140:8089 + String? host = "http://localhost:5000"; // "https://api.myinfomate.be" // "https://api.mymuseum.be" // DEV = "http://192.168.31.96" // http://localhost:5000 // https://api.mymuseum.be // myCore http://192.168.31.140:8089 Client? clientAPI; bool isLoading = false; bool isRememberMe = false; - String pageTitle = "MyMuseum"; + String pageTitle = "MyInfoMate"; String? token; String? instanceId; int? pinCode; @@ -174,7 +174,7 @@ class _LoginScreenState extends State { @override void initState() { //this.isRememberMe = widget.session.rememberMe; - this.host = "https://api.mymuseum.be"; // "http://localhost:5000" //widget.session.host; // MDLF "http://192.168.1.19:8089" // "https://api.mymuseum.be" + this.host = "http://localhost:5000"; // "https://api.myinfomate.be"// "https://api.mymuseum.be" // "http://localhost:5000" //widget.session.host; // MDLF "http://192.168.1.19:8089" // "https://api.mymuseum.be" //this.email = "test@email.be"; //widget.session.email; //this.password = "kljqsdkljqsd"; //widget.session.password; @@ -205,7 +205,7 @@ class _LoginScreenState extends State { var subdomain = urlParts[0].replaceAll('https://', ''); switch(subdomain) { case "manager": - this.pageTitle = "MyMuseum"; + this.pageTitle = "MyInfoMate"; break; case "fortsaintheribert": this.pageTitle = "Fort de Saint Héribert"; diff --git a/lib/api/swagger.yaml b/lib/api/swagger.yaml index c746371..e884bc9 100644 --- a/lib/api/swagger.yaml +++ b/lib/api/swagger.yaml @@ -5,7 +5,7 @@ info: description: API Manager Service version: Version Alpha servers: - - url: https://api.mymuseum.be + - url: http://localhost:5000 paths: /api/Configuration: get: @@ -1463,6 +1463,48 @@ paths: $ref: '#/components/schemas/ArticleDTO' security: - bearer: [] + /api/Section/PdfDTO: + get: + tags: + - Section + operationId: Section_GetPdfDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/PdfDTO' + security: + - bearer: [] + /api/Section/PuzzleDTO: + get: + tags: + - Section + operationId: Section_GetPuzzleDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/PuzzleDTO' + security: + - bearer: [] + /api/Section/AgendaDTO: + get: + tags: + - Section + operationId: Section_GetAgendaDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/AgendaDTO' + security: + - bearer: [] /api/User: get: tags: @@ -1866,6 +1908,9 @@ components: 4 = Menu 5 = Quizz 6 = Article + 7 = PDF + 8 = Puzzle + 9 = Agenda x-enumNames: - Map - Slider @@ -1874,6 +1919,9 @@ components: - Menu - Quizz - Article + - PDF + - Puzzle + - Agenda enum: - 0 - 1 @@ -1882,6 +1930,9 @@ components: - 4 - 5 - 6 + - 7 + - 8 + - 9 ResourceDTO: type: object additionalProperties: false @@ -1894,7 +1945,7 @@ components: label: type: string nullable: true - data: + url: type: string nullable: true dateCreation: @@ -1911,18 +1962,24 @@ components: 2 = ImageUrl 3 = VideoUrl 4 = Audio + 5 = PDF + 6 = JSON x-enumNames: - Image - Video - ImageUrl - VideoUrl - Audio + - PDF + - JSON enum: - 0 - 1 - 2 - 3 - 4 + - 5 + - 6 DeviceDTO: type: object additionalProperties: false @@ -2031,6 +2088,11 @@ components: iconSource: type: string nullable: true + categories: + type: array + nullable: true + items: + $ref: '#/components/schemas/CategorieDTO' MapTypeApp: type: integer description: |- @@ -2068,37 +2130,56 @@ components: nullable: true items: $ref: '#/components/schemas/TranslationDTO' - images: + contents: type: array nullable: true items: - $ref: '#/components/schemas/ImageGeoPoint' + $ref: '#/components/schemas/ContentGeoPoint' + categorie: + nullable: true + oneOf: + - $ref: '#/components/schemas/CategorieDTO' latitude: type: string nullable: true longitude: type: string nullable: true - ImageGeoPoint: + ContentGeoPoint: type: object additionalProperties: false properties: - imageResourceId: + resourceId: type: string nullable: true - imageSource: + resourceType: + $ref: '#/components/schemas/ResourceType' + resourceUrl: + type: string + nullable: true + latitude: + type: string + nullable: true + CategorieDTO: + type: object + additionalProperties: false + properties: + name: + type: string + nullable: true + icon: type: string nullable: true SliderDTO: type: object additionalProperties: false properties: - images: + contents: type: array nullable: true items: - $ref: '#/components/schemas/ImageDTO' - ImageDTO: + $ref: '#/components/schemas/ContentDTO' + ContentDTO: type: object additionalProperties: false properties: @@ -2115,12 +2196,14 @@ components: resourceId: type: string nullable: true - source: + resourceUrl: type: string nullable: true order: type: integer format: int32 + resourceType: + $ref: '#/components/schemas/ResourceType' VideoDTO: type: object additionalProperties: false @@ -2194,7 +2277,9 @@ components: resourceId: type: string nullable: true - source: + resourceType: + $ref: '#/components/schemas/ResourceType' + resourceUrl: type: string nullable: true order: @@ -2226,7 +2311,9 @@ components: resourceId: type: string nullable: true - source: + resourceType: + $ref: '#/components/schemas/ResourceType' + resourceUrl: type: string nullable: true ArticleDTO: @@ -2247,11 +2334,49 @@ components: $ref: '#/components/schemas/TranslationDTO' isReadAudioAuto: type: boolean - images: + contents: type: array nullable: true items: - $ref: '#/components/schemas/ImageDTO' + $ref: '#/components/schemas/ContentDTO' + PdfDTO: + type: object + additionalProperties: false + properties: + resourceId: + type: string + nullable: true + resourceUrl: + type: string + nullable: true + PuzzleDTO: + type: object + additionalProperties: false + properties: + messageDebut: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + messageFin: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + image: + nullable: true + oneOf: + - $ref: '#/components/schemas/ContentDTO' + AgendaDTO: + type: object + additionalProperties: false + properties: + resourceId: + type: string + nullable: true + resourceUrl: + type: string + nullable: true User: type: object additionalProperties: false diff --git a/lib/constants.dart b/lib/constants.dart index 6e9da0e..2bdb036 100644 --- a/lib/constants.dart +++ b/lib/constants.dart @@ -20,9 +20,13 @@ const List section_types = ["Map", "Slider", "Video", "Web", "Menu", "Qu const List map_types = ["none", "normal", "satellite", "terrain", "hybrid"]; const List languages = ["FR", "NL", "EN", "DE", "IT", "ES", "CN", "PL", "AR", "UK"]; List resource_types = [ - ResourceTypeModel(label: "image", type: ResourceType.Image), - ResourceTypeModel(label: "image url", type: ResourceType.ImageUrl), - ResourceTypeModel(label: "audio", type: ResourceType.Audio) + ResourceTypeModel(label: "Image", type: ResourceType.Image), + ResourceTypeModel(label: "Image url", type: ResourceType.ImageUrl), + ResourceTypeModel(label: "Vidéo", type: ResourceType.Video), + ResourceTypeModel(label: "Vidéo url", type: ResourceType.VideoUrl), + ResourceTypeModel(label: "Audio", type: ResourceType.Audio), + ResourceTypeModel(label: "PDF", type: ResourceType.Pdf), + ResourceTypeModel(label: "JSON", type: ResourceType.Json) ]; // "video url" , "video", {"label": "image"}, "image url", "audio" /* diff --git a/manager_api_new/.openapi-generator/FILES b/manager_api_new/.openapi-generator/FILES index ca166c6..0fd499a 100644 --- a/manager_api_new/.openapi-generator/FILES +++ b/manager_api_new/.openapi-generator/FILES @@ -2,10 +2,14 @@ .travis.yml README.md analysis_options.yaml +doc/AgendaDTO.md doc/ArticleDTO.md doc/AuthenticationApi.md +doc/CategorieDTO.md doc/ConfigurationApi.md doc/ConfigurationDTO.md +doc/ContentDTO.md +doc/ContentGeoPoint.md doc/DeviceApi.md doc/DeviceDTO.md doc/DeviceDetailDTO.md @@ -13,8 +17,7 @@ doc/DeviceDetailDTOAllOf.md doc/ExportConfigurationDTO.md doc/ExportConfigurationDTOAllOf.md doc/GeoPointDTO.md -doc/ImageDTO.md -doc/ImageGeoPoint.md +doc/GeoPointDTOCategorie.md doc/Instance.md doc/InstanceApi.md doc/InstanceDTO.md @@ -23,7 +26,10 @@ doc/LoginDTO.md doc/MapDTO.md doc/MapTypeApp.md doc/MenuDTO.md +doc/PdfDTO.md doc/PlayerMessageDTO.md +doc/PuzzleDTO.md +doc/PuzzleDTOImage.md doc/QuestionDTO.md doc/QuizzDTO.md doc/QuizzDTOBadLevel.md @@ -59,16 +65,19 @@ lib/auth/authentication.dart lib/auth/http_basic_auth.dart lib/auth/http_bearer_auth.dart lib/auth/oauth.dart +lib/model/agenda_dto.dart lib/model/article_dto.dart +lib/model/categorie_dto.dart lib/model/configuration_dto.dart +lib/model/content_dto.dart +lib/model/content_geo_point.dart lib/model/device_detail_dto.dart lib/model/device_detail_dto_all_of.dart lib/model/device_dto.dart lib/model/export_configuration_dto.dart lib/model/export_configuration_dto_all_of.dart lib/model/geo_point_dto.dart -lib/model/image_dto.dart -lib/model/image_geo_point.dart +lib/model/geo_point_dto_categorie.dart lib/model/instance.dart lib/model/instance_dto.dart lib/model/level_dto.dart @@ -76,7 +85,10 @@ lib/model/login_dto.dart lib/model/map_dto.dart lib/model/map_type_app.dart lib/model/menu_dto.dart +lib/model/pdf_dto.dart lib/model/player_message_dto.dart +lib/model/puzzle_dto.dart +lib/model/puzzle_dto_image.dart lib/model/question_dto.dart lib/model/quizz_dto.dart lib/model/quizz_dto_bad_level.dart diff --git a/manager_api_new/README.md b/manager_api_new/README.md index c606dcd..fe30308 100644 --- a/manager_api_new/README.md +++ b/manager_api_new/README.md @@ -60,7 +60,7 @@ try { ## Documentation for API Endpoints -All URIs are relative to *https://api.mymuseum.be* +All URIs are relative to *http://localhost:5000* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- @@ -97,6 +97,7 @@ Class | Method | HTTP request | Description *SectionApi* | [**sectionDelete**](doc\/SectionApi.md#sectiondelete) | **DELETE** /api/Section/{id} | *SectionApi* | [**sectionDeleteAllForConfiguration**](doc\/SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} | *SectionApi* | [**sectionGet**](doc\/SectionApi.md#sectionget) | **GET** /api/Section | +*SectionApi* | [**sectionGetAgendaDTO**](doc\/SectionApi.md#sectiongetagendadto) | **GET** /api/Section/AgendaDTO | *SectionApi* | [**sectionGetAllBeaconsForInstance**](doc\/SectionApi.md#sectiongetallbeaconsforinstance) | **GET** /api/Section/beacons/{instanceId} | *SectionApi* | [**sectionGetAllSectionSubSections**](doc\/SectionApi.md#sectiongetallsectionsubsections) | **GET** /api/Section/{id}/subsections | *SectionApi* | [**sectionGetArticleDTO**](doc\/SectionApi.md#sectiongetarticledto) | **GET** /api/Section/ArticleDTO | @@ -104,6 +105,8 @@ Class | Method | HTTP request | Description *SectionApi* | [**sectionGetFromConfiguration**](doc\/SectionApi.md#sectiongetfromconfiguration) | **GET** /api/Section/configuration/{id} | *SectionApi* | [**sectionGetMapDTO**](doc\/SectionApi.md#sectiongetmapdto) | **GET** /api/Section/MapDTO | *SectionApi* | [**sectionGetMenuDTO**](doc\/SectionApi.md#sectiongetmenudto) | **GET** /api/Section/MenuDTO | +*SectionApi* | [**sectionGetPdfDTO**](doc\/SectionApi.md#sectiongetpdfdto) | **GET** /api/Section/PdfDTO | +*SectionApi* | [**sectionGetPuzzleDTO**](doc\/SectionApi.md#sectiongetpuzzledto) | **GET** /api/Section/PuzzleDTO | *SectionApi* | [**sectionGetQuizzDTO**](doc\/SectionApi.md#sectiongetquizzdto) | **GET** /api/Section/QuizzDTO | *SectionApi* | [**sectionGetSliderDTO**](doc\/SectionApi.md#sectiongetsliderdto) | **GET** /api/Section/SliderDTO | *SectionApi* | [**sectionGetVideoDTO**](doc\/SectionApi.md#sectiongetvideodto) | **GET** /api/Section/VideoDTO | @@ -120,16 +123,19 @@ Class | Method | HTTP request | Description ## Documentation For Models + - [AgendaDTO](doc\/AgendaDTO.md) - [ArticleDTO](doc\/ArticleDTO.md) + - [CategorieDTO](doc\/CategorieDTO.md) - [ConfigurationDTO](doc\/ConfigurationDTO.md) + - [ContentDTO](doc\/ContentDTO.md) + - [ContentGeoPoint](doc\/ContentGeoPoint.md) - [DeviceDTO](doc\/DeviceDTO.md) - [DeviceDetailDTO](doc\/DeviceDetailDTO.md) - [DeviceDetailDTOAllOf](doc\/DeviceDetailDTOAllOf.md) - [ExportConfigurationDTO](doc\/ExportConfigurationDTO.md) - [ExportConfigurationDTOAllOf](doc\/ExportConfigurationDTOAllOf.md) - [GeoPointDTO](doc\/GeoPointDTO.md) - - [ImageDTO](doc\/ImageDTO.md) - - [ImageGeoPoint](doc\/ImageGeoPoint.md) + - [GeoPointDTOCategorie](doc\/GeoPointDTOCategorie.md) - [Instance](doc\/Instance.md) - [InstanceDTO](doc\/InstanceDTO.md) - [LevelDTO](doc\/LevelDTO.md) @@ -137,7 +143,10 @@ Class | Method | HTTP request | Description - [MapDTO](doc\/MapDTO.md) - [MapTypeApp](doc\/MapTypeApp.md) - [MenuDTO](doc\/MenuDTO.md) + - [PdfDTO](doc\/PdfDTO.md) - [PlayerMessageDTO](doc\/PlayerMessageDTO.md) + - [PuzzleDTO](doc\/PuzzleDTO.md) + - [PuzzleDTOImage](doc\/PuzzleDTOImage.md) - [QuestionDTO](doc\/QuestionDTO.md) - [QuizzDTO](doc\/QuizzDTO.md) - [QuizzDTOBadLevel](doc\/QuizzDTOBadLevel.md) diff --git a/manager_api_new/doc/AgendaDTO.md b/manager_api_new/doc/AgendaDTO.md new file mode 100644 index 0000000..8b47e93 --- /dev/null +++ b/manager_api_new/doc/AgendaDTO.md @@ -0,0 +1,16 @@ +# manager_api_new.model.AgendaDTO + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**resourceId** | **String** | | [optional] +**resourceUrl** | **String** | | [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/ArticleDTO.md b/manager_api_new/doc/ArticleDTO.md index 82099a1..49d69b7 100644 --- a/manager_api_new/doc/ArticleDTO.md +++ b/manager_api_new/doc/ArticleDTO.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **isContentTop** | **bool** | | [optional] **audioIds** | [**List**](TranslationDTO.md) | | [optional] [default to const []] **isReadAudioAuto** | **bool** | | [optional] -**images** | [**List**](ImageDTO.md) | | [optional] [default to const []] +**contents** | [**List**](ContentDTO.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/AuthenticationApi.md b/manager_api_new/doc/AuthenticationApi.md index db6c1f1..b17a2f1 100644 --- a/manager_api_new/doc/AuthenticationApi.md +++ b/manager_api_new/doc/AuthenticationApi.md @@ -5,7 +5,7 @@ import 'package:manager_api_new/api.dart'; ``` -All URIs are relative to *https://api.mymuseum.be* +All URIs are relative to *http://localhost:5000* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/manager_api_new/doc/CategorieDTO.md b/manager_api_new/doc/CategorieDTO.md new file mode 100644 index 0000000..2bb0200 --- /dev/null +++ b/manager_api_new/doc/CategorieDTO.md @@ -0,0 +1,16 @@ +# manager_api_new.model.CategorieDTO + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] +**icon** | **String** | | [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/ConfigurationApi.md b/manager_api_new/doc/ConfigurationApi.md index 40100b7..0b3b922 100644 --- a/manager_api_new/doc/ConfigurationApi.md +++ b/manager_api_new/doc/ConfigurationApi.md @@ -5,7 +5,7 @@ import 'package:manager_api_new/api.dart'; ``` -All URIs are relative to *https://api.mymuseum.be* +All URIs are relative to *http://localhost:5000* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/manager_api_new/doc/ContentDTO.md b/manager_api_new/doc/ContentDTO.md new file mode 100644 index 0000000..2b883a0 --- /dev/null +++ b/manager_api_new/doc/ContentDTO.md @@ -0,0 +1,20 @@ +# manager_api_new.model.ContentDTO + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**description** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**resourceId** | **String** | | [optional] +**resourceUrl** | **String** | | [optional] +**order** | **int** | | [optional] +**resourceType** | [**ResourceType**](ResourceType.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/ContentGeoPoint.md b/manager_api_new/doc/ContentGeoPoint.md new file mode 100644 index 0000000..0594bd9 --- /dev/null +++ b/manager_api_new/doc/ContentGeoPoint.md @@ -0,0 +1,18 @@ +# manager_api_new.model.ContentGeoPoint + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**resourceId** | **String** | | [optional] +**resourceType** | [**ResourceType**](ResourceType.md) | | [optional] +**resourceUrl** | **String** | | [optional] +**latitude** | **String** | | [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/DeviceApi.md b/manager_api_new/doc/DeviceApi.md index e43a287..a586e58 100644 --- a/manager_api_new/doc/DeviceApi.md +++ b/manager_api_new/doc/DeviceApi.md @@ -5,7 +5,7 @@ import 'package:manager_api_new/api.dart'; ``` -All URIs are relative to *https://api.mymuseum.be* +All URIs are relative to *http://localhost:5000* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/manager_api_new/doc/GeoPointDTO.md b/manager_api_new/doc/GeoPointDTO.md index f1cc161..006bc69 100644 --- a/manager_api_new/doc/GeoPointDTO.md +++ b/manager_api_new/doc/GeoPointDTO.md @@ -11,7 +11,8 @@ Name | Type | Description | Notes **id** | **int** | | [optional] **title** | [**List**](TranslationDTO.md) | | [optional] [default to const []] **description** | [**List**](TranslationDTO.md) | | [optional] [default to const []] -**images** | [**List**](ImageGeoPoint.md) | | [optional] [default to const []] +**contents** | [**List**](ContentGeoPoint.md) | | [optional] [default to const []] +**categorie** | [**GeoPointDTOCategorie**](GeoPointDTOCategorie.md) | | [optional] **latitude** | **String** | | [optional] **longitude** | **String** | | [optional] diff --git a/manager_api_new/doc/GeoPointDTOCategorie.md b/manager_api_new/doc/GeoPointDTOCategorie.md new file mode 100644 index 0000000..55eb3f0 --- /dev/null +++ b/manager_api_new/doc/GeoPointDTOCategorie.md @@ -0,0 +1,16 @@ +# manager_api_new.model.GeoPointDTOCategorie + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] +**icon** | **String** | | [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/ImageDTO.md b/manager_api_new/doc/ImageDTO.md index 5e90d0a..20db40a 100644 --- a/manager_api_new/doc/ImageDTO.md +++ b/manager_api_new/doc/ImageDTO.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **resourceId** | **String** | | [optional] **source_** | **String** | | [optional] **order** | **int** | | [optional] +**type** | [**ResourceType**](ResourceType.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/InstanceApi.md b/manager_api_new/doc/InstanceApi.md index b636f20..534cad6 100644 --- a/manager_api_new/doc/InstanceApi.md +++ b/manager_api_new/doc/InstanceApi.md @@ -5,7 +5,7 @@ import 'package:manager_api_new/api.dart'; ``` -All URIs are relative to *https://api.mymuseum.be* +All URIs are relative to *http://localhost:5000* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/manager_api_new/doc/LevelDTO.md b/manager_api_new/doc/LevelDTO.md index d919264..cc90072 100644 --- a/manager_api_new/doc/LevelDTO.md +++ b/manager_api_new/doc/LevelDTO.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **label** | [**List**](TranslationDTO.md) | | [optional] [default to const []] **resourceId** | **String** | | [optional] -**source_** | **String** | | [optional] +**resourceType** | [**ResourceType**](ResourceType.md) | | [optional] +**resourceUrl** | **String** | | [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 2dce0e4..1b4f90a 100644 --- a/manager_api_new/doc/MapDTO.md +++ b/manager_api_new/doc/MapDTO.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **points** | [**List**](GeoPointDTO.md) | | [optional] [default to const []] **iconResourceId** | **String** | | [optional] **iconSource** | **String** | | [optional] +**categories** | [**List**](CategorieDTO.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/PdfDTO.md b/manager_api_new/doc/PdfDTO.md new file mode 100644 index 0000000..50300aa --- /dev/null +++ b/manager_api_new/doc/PdfDTO.md @@ -0,0 +1,16 @@ +# manager_api_new.model.PdfDTO + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**resourceId** | **String** | | [optional] +**resourceUrl** | **String** | | [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/PuzzleDTO.md b/manager_api_new/doc/PuzzleDTO.md new file mode 100644 index 0000000..152c9aa --- /dev/null +++ b/manager_api_new/doc/PuzzleDTO.md @@ -0,0 +1,17 @@ +# manager_api_new.model.PuzzleDTO + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**messageDebut** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**messageFin** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**image** | [**PuzzleDTOImage**](PuzzleDTOImage.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/PuzzleDTOImage.md b/manager_api_new/doc/PuzzleDTOImage.md new file mode 100644 index 0000000..9777e5f --- /dev/null +++ b/manager_api_new/doc/PuzzleDTOImage.md @@ -0,0 +1,20 @@ +# manager_api_new.model.PuzzleDTOImage + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**description** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**resourceId** | **String** | | [optional] +**resourceUrl** | **String** | | [optional] +**order** | **int** | | [optional] +**resourceType** | [**ResourceType**](ResourceType.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/QuestionDTO.md b/manager_api_new/doc/QuestionDTO.md index 74f2893..51cce4a 100644 --- a/manager_api_new/doc/QuestionDTO.md +++ b/manager_api_new/doc/QuestionDTO.md @@ -11,7 +11,8 @@ Name | Type | Description | Notes **label** | [**List**](TranslationDTO.md) | | [optional] [default to const []] **responses** | [**List**](ResponseDTO.md) | | [optional] [default to const []] **resourceId** | **String** | | [optional] -**source_** | **String** | | [optional] +**resourceType** | [**ResourceType**](ResourceType.md) | | [optional] +**resourceUrl** | **String** | | [optional] **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/QuizzDTOBadLevel.md b/manager_api_new/doc/QuizzDTOBadLevel.md index ffd04e8..f7f96ac 100644 --- a/manager_api_new/doc/QuizzDTOBadLevel.md +++ b/manager_api_new/doc/QuizzDTOBadLevel.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **label** | [**List**](TranslationDTO.md) | | [optional] [default to const []] **resourceId** | **String** | | [optional] -**source_** | **String** | | [optional] +**resourceType** | [**ResourceType**](ResourceType.md) | | [optional] +**resourceUrl** | **String** | | [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/ResourceApi.md b/manager_api_new/doc/ResourceApi.md index 4ec3857..fcf1ea2 100644 --- a/manager_api_new/doc/ResourceApi.md +++ b/manager_api_new/doc/ResourceApi.md @@ -5,7 +5,7 @@ import 'package:manager_api_new/api.dart'; ``` -All URIs are relative to *https://api.mymuseum.be* +All URIs are relative to *http://localhost:5000* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/manager_api_new/doc/ResourceDTO.md b/manager_api_new/doc/ResourceDTO.md index 1795c95..883e620 100644 --- a/manager_api_new/doc/ResourceDTO.md +++ b/manager_api_new/doc/ResourceDTO.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **id** | **String** | | [optional] **type** | [**ResourceType**](ResourceType.md) | | [optional] **label** | **String** | | [optional] -**data** | **String** | | [optional] +**url** | **String** | | [optional] **dateCreation** | [**DateTime**](DateTime.md) | | [optional] **instanceId** | **String** | | [optional] diff --git a/manager_api_new/doc/SectionApi.md b/manager_api_new/doc/SectionApi.md index 6831bd9..7df327e 100644 --- a/manager_api_new/doc/SectionApi.md +++ b/manager_api_new/doc/SectionApi.md @@ -5,7 +5,7 @@ import 'package:manager_api_new/api.dart'; ``` -All URIs are relative to *https://api.mymuseum.be* +All URIs are relative to *http://localhost:5000* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -13,6 +13,7 @@ Method | HTTP request | Description [**sectionDelete**](SectionApi.md#sectiondelete) | **DELETE** /api/Section/{id} | [**sectionDeleteAllForConfiguration**](SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} | [**sectionGet**](SectionApi.md#sectionget) | **GET** /api/Section | +[**sectionGetAgendaDTO**](SectionApi.md#sectiongetagendadto) | **GET** /api/Section/AgendaDTO | [**sectionGetAllBeaconsForInstance**](SectionApi.md#sectiongetallbeaconsforinstance) | **GET** /api/Section/beacons/{instanceId} | [**sectionGetAllSectionSubSections**](SectionApi.md#sectiongetallsectionsubsections) | **GET** /api/Section/{id}/subsections | [**sectionGetArticleDTO**](SectionApi.md#sectiongetarticledto) | **GET** /api/Section/ArticleDTO | @@ -20,6 +21,8 @@ Method | HTTP request | Description [**sectionGetFromConfiguration**](SectionApi.md#sectiongetfromconfiguration) | **GET** /api/Section/configuration/{id} | [**sectionGetMapDTO**](SectionApi.md#sectiongetmapdto) | **GET** /api/Section/MapDTO | [**sectionGetMenuDTO**](SectionApi.md#sectiongetmenudto) | **GET** /api/Section/MenuDTO | +[**sectionGetPdfDTO**](SectionApi.md#sectiongetpdfdto) | **GET** /api/Section/PdfDTO | +[**sectionGetPuzzleDTO**](SectionApi.md#sectiongetpuzzledto) | **GET** /api/Section/PuzzleDTO | [**sectionGetQuizzDTO**](SectionApi.md#sectiongetquizzdto) | **GET** /api/Section/QuizzDTO | [**sectionGetSliderDTO**](SectionApi.md#sectiongetsliderdto) | **GET** /api/Section/SliderDTO | [**sectionGetVideoDTO**](SectionApi.md#sectiongetvideodto) | **GET** /api/Section/VideoDTO | @@ -201,6 +204,45 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **sectionGetAgendaDTO** +> AgendaDTO sectionGetAgendaDTO() + + + +### Example +```dart +import 'package:manager_api_new/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = SectionApi(); + +try { + final result = api_instance.sectionGetAgendaDTO(); + print(result); +} catch (e) { + print('Exception when calling SectionApi->sectionGetAgendaDTO: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**AgendaDTO**](AgendaDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **sectionGetAllBeaconsForInstance** > List sectionGetAllBeaconsForInstance(instanceId) @@ -490,6 +532,84 @@ This endpoint does not need any parameter. [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **sectionGetPdfDTO** +> PdfDTO sectionGetPdfDTO() + + + +### Example +```dart +import 'package:manager_api_new/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = SectionApi(); + +try { + final result = api_instance.sectionGetPdfDTO(); + print(result); +} catch (e) { + print('Exception when calling SectionApi->sectionGetPdfDTO: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**PdfDTO**](PdfDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **sectionGetPuzzleDTO** +> PuzzleDTO sectionGetPuzzleDTO() + + + +### Example +```dart +import 'package:manager_api_new/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = SectionApi(); + +try { + final result = api_instance.sectionGetPuzzleDTO(); + print(result); +} catch (e) { + print('Exception when calling SectionApi->sectionGetPuzzleDTO: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**PuzzleDTO**](PuzzleDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **sectionGetQuizzDTO** > QuizzDTO sectionGetQuizzDTO() diff --git a/manager_api_new/doc/SliderDTO.md b/manager_api_new/doc/SliderDTO.md index 7c6e562..bb096d5 100644 --- a/manager_api_new/doc/SliderDTO.md +++ b/manager_api_new/doc/SliderDTO.md @@ -8,7 +8,7 @@ import 'package:manager_api_new/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**images** | [**List**](ImageDTO.md) | | [optional] [default to const []] +**contents** | [**List**](ContentDTO.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/UserApi.md b/manager_api_new/doc/UserApi.md index ac33309..29e98ed 100644 --- a/manager_api_new/doc/UserApi.md +++ b/manager_api_new/doc/UserApi.md @@ -5,7 +5,7 @@ import 'package:manager_api_new/api.dart'; ``` -All URIs are relative to *https://api.mymuseum.be* +All URIs are relative to *http://localhost:5000* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/manager_api_new/lib/api.dart b/manager_api_new/lib/api.dart index 3d214e5..d05a44a 100644 --- a/manager_api_new/lib/api.dart +++ b/manager_api_new/lib/api.dart @@ -35,16 +35,19 @@ part 'api/resource_api.dart'; part 'api/section_api.dart'; part 'api/user_api.dart'; +part 'model/agenda_dto.dart'; part 'model/article_dto.dart'; +part 'model/categorie_dto.dart'; part 'model/configuration_dto.dart'; +part 'model/content_dto.dart'; +part 'model/content_geo_point.dart'; part 'model/device_dto.dart'; part 'model/device_detail_dto.dart'; part 'model/device_detail_dto_all_of.dart'; part 'model/export_configuration_dto.dart'; part 'model/export_configuration_dto_all_of.dart'; part 'model/geo_point_dto.dart'; -part 'model/image_dto.dart'; -part 'model/image_geo_point.dart'; +part 'model/geo_point_dto_categorie.dart'; part 'model/instance.dart'; part 'model/instance_dto.dart'; part 'model/level_dto.dart'; @@ -52,7 +55,10 @@ part 'model/login_dto.dart'; part 'model/map_dto.dart'; part 'model/map_type_app.dart'; part 'model/menu_dto.dart'; +part 'model/pdf_dto.dart'; part 'model/player_message_dto.dart'; +part 'model/puzzle_dto.dart'; +part 'model/puzzle_dto_image.dart'; part 'model/question_dto.dart'; part 'model/quizz_dto.dart'; part 'model/quizz_dto_bad_level.dart'; diff --git a/manager_api_new/lib/api/section_api.dart b/manager_api_new/lib/api/section_api.dart index bc9addb..5f94765 100644 --- a/manager_api_new/lib/api/section_api.dart +++ b/manager_api_new/lib/api/section_api.dart @@ -213,6 +213,47 @@ class SectionApi { return null; } + /// Performs an HTTP 'GET /api/Section/AgendaDTO' operation and returns the [Response]. + Future sectionGetAgendaDTOWithHttpInfo() async { + // ignore: prefer_const_declarations + final path = r'/api/Section/AgendaDTO'; + + // ignore: prefer_final_locals + Object? postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = []; + + + return apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + Future sectionGetAgendaDTO() async { + final response = await sectionGetAgendaDTOWithHttpInfo(); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AgendaDTO',) as AgendaDTO; + + } + return null; + } + /// Performs an HTTP 'GET /api/Section/beacons/{instanceId}' operation and returns the [Response]. /// Parameters: /// @@ -537,6 +578,88 @@ class SectionApi { return null; } + /// Performs an HTTP 'GET /api/Section/PdfDTO' operation and returns the [Response]. + Future sectionGetPdfDTOWithHttpInfo() async { + // ignore: prefer_const_declarations + final path = r'/api/Section/PdfDTO'; + + // ignore: prefer_final_locals + Object? postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = []; + + + return apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + Future sectionGetPdfDTO() async { + final response = await sectionGetPdfDTOWithHttpInfo(); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'PdfDTO',) as PdfDTO; + + } + return null; + } + + /// Performs an HTTP 'GET /api/Section/PuzzleDTO' operation and returns the [Response]. + Future sectionGetPuzzleDTOWithHttpInfo() async { + // ignore: prefer_const_declarations + final path = r'/api/Section/PuzzleDTO'; + + // ignore: prefer_final_locals + Object? postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = []; + + + return apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + Future sectionGetPuzzleDTO() async { + final response = await sectionGetPuzzleDTOWithHttpInfo(); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'PuzzleDTO',) as PuzzleDTO; + + } + return null; + } + /// Performs an HTTP 'GET /api/Section/QuizzDTO' operation and returns the [Response]. Future sectionGetQuizzDTOWithHttpInfo() async { // ignore: prefer_const_declarations diff --git a/manager_api_new/lib/api_client.dart b/manager_api_new/lib/api_client.dart index 007b008..d12228b 100644 --- a/manager_api_new/lib/api_client.dart +++ b/manager_api_new/lib/api_client.dart @@ -11,7 +11,7 @@ part of openapi.api; class ApiClient { - ApiClient({this.basePath = 'https://api.mymuseum.be', this.authentication,}); + ApiClient({this.basePath = 'http://localhost:5000', this.authentication,}); final String basePath; final Authentication? authentication; @@ -181,10 +181,18 @@ class ApiClient { return valueString == 'true' || valueString == '1'; case 'DateTime': return value is DateTime ? value : DateTime.tryParse(value); + case 'AgendaDTO': + return AgendaDTO.fromJson(value); case 'ArticleDTO': return ArticleDTO.fromJson(value); + case 'CategorieDTO': + return CategorieDTO.fromJson(value); case 'ConfigurationDTO': return ConfigurationDTO.fromJson(value); + case 'ContentDTO': + return ContentDTO.fromJson(value); + case 'ContentGeoPoint': + return ContentGeoPoint.fromJson(value); case 'DeviceDTO': return DeviceDTO.fromJson(value); case 'DeviceDetailDTO': @@ -197,10 +205,8 @@ class ApiClient { return ExportConfigurationDTOAllOf.fromJson(value); case 'GeoPointDTO': return GeoPointDTO.fromJson(value); - case 'ImageDTO': - return ImageDTO.fromJson(value); - case 'ImageGeoPoint': - return ImageGeoPoint.fromJson(value); + case 'GeoPointDTOCategorie': + return GeoPointDTOCategorie.fromJson(value); case 'Instance': return Instance.fromJson(value); case 'InstanceDTO': @@ -215,8 +221,14 @@ class ApiClient { return MapTypeAppTypeTransformer().decode(value); case 'MenuDTO': return MenuDTO.fromJson(value); + case 'PdfDTO': + return PdfDTO.fromJson(value); case 'PlayerMessageDTO': return PlayerMessageDTO.fromJson(value); + case 'PuzzleDTO': + return PuzzleDTO.fromJson(value); + case 'PuzzleDTOImage': + return PuzzleDTOImage.fromJson(value); case 'QuestionDTO': return QuestionDTO.fromJson(value); case 'QuizzDTO': diff --git a/manager_api_new/lib/model/agenda_dto.dart b/manager_api_new/lib/model/agenda_dto.dart new file mode 100644 index 0000000..1e46c8d --- /dev/null +++ b/manager_api_new/lib/model/agenda_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 AgendaDTO { + /// Returns a new [AgendaDTO] instance. + AgendaDTO({ + this.resourceId, + this.resourceUrl, + }); + + String? resourceId; + + String? resourceUrl; + + @override + bool operator ==(Object other) => identical(this, other) || other is AgendaDTO && + other.resourceId == resourceId && + other.resourceUrl == resourceUrl; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (resourceId == null ? 0 : resourceId!.hashCode) + + (resourceUrl == null ? 0 : resourceUrl!.hashCode); + + @override + String toString() => 'AgendaDTO[resourceId=$resourceId, resourceUrl=$resourceUrl]'; + + Map toJson() { + final json = {}; + if (this.resourceId != null) { + json[r'resourceId'] = this.resourceId; + } else { + json[r'resourceId'] = null; + } + if (this.resourceUrl != null) { + json[r'resourceUrl'] = this.resourceUrl; + } else { + json[r'resourceUrl'] = null; + } + return json; + } + + /// Returns a new [AgendaDTO] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static AgendaDTO? 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 "AgendaDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "AgendaDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return AgendaDTO( + resourceId: mapValueOfType(json, r'resourceId'), + resourceUrl: mapValueOfType(json, r'resourceUrl'), + ); + } + 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 = AgendaDTO.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 = AgendaDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of AgendaDTO-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] = AgendaDTO.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/article_dto.dart b/manager_api_new/lib/model/article_dto.dart index 3b72137..2221429 100644 --- a/manager_api_new/lib/model/article_dto.dart +++ b/manager_api_new/lib/model/article_dto.dart @@ -17,7 +17,7 @@ class ArticleDTO { this.isContentTop, this.audioIds = const [], this.isReadAudioAuto, - this.images = const [], + this.contents = const [], }); List? content; @@ -40,7 +40,7 @@ class ArticleDTO { /// bool? isReadAudioAuto; - List? images; + List? contents; @override bool operator ==(Object other) => identical(this, other) || other is ArticleDTO && @@ -48,7 +48,7 @@ class ArticleDTO { other.isContentTop == isContentTop && other.audioIds == audioIds && other.isReadAudioAuto == isReadAudioAuto && - other.images == images; + other.contents == contents; @override int get hashCode => @@ -57,10 +57,10 @@ class ArticleDTO { (isContentTop == null ? 0 : isContentTop!.hashCode) + (audioIds == null ? 0 : audioIds!.hashCode) + (isReadAudioAuto == null ? 0 : isReadAudioAuto!.hashCode) + - (images == null ? 0 : images!.hashCode); + (contents == null ? 0 : contents!.hashCode); @override - String toString() => 'ArticleDTO[content=$content, isContentTop=$isContentTop, audioIds=$audioIds, isReadAudioAuto=$isReadAudioAuto, images=$images]'; + String toString() => 'ArticleDTO[content=$content, isContentTop=$isContentTop, audioIds=$audioIds, isReadAudioAuto=$isReadAudioAuto, contents=$contents]'; Map toJson() { final json = {}; @@ -84,10 +84,10 @@ class ArticleDTO { } else { json[r'isReadAudioAuto'] = null; } - if (this.images != null) { - json[r'images'] = this.images; + if (this.contents != null) { + json[r'contents'] = this.contents; } else { - json[r'images'] = null; + json[r'contents'] = null; } return json; } @@ -115,7 +115,7 @@ class ArticleDTO { isContentTop: mapValueOfType(json, r'isContentTop'), audioIds: TranslationDTO.listFromJson(json[r'audioIds']), isReadAudioAuto: mapValueOfType(json, r'isReadAudioAuto'), - images: ImageDTO.listFromJson(json[r'images']), + contents: ContentDTO.listFromJson(json[r'contents']), ); } return null; diff --git a/manager_api_new/lib/model/categorie_dto.dart b/manager_api_new/lib/model/categorie_dto.dart new file mode 100644 index 0000000..ce4fcbe --- /dev/null +++ b/manager_api_new/lib/model/categorie_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 CategorieDTO { + /// Returns a new [CategorieDTO] instance. + CategorieDTO({ + this.name, + this.icon, + }); + + String? name; + + String? icon; + + @override + bool operator ==(Object other) => identical(this, other) || other is CategorieDTO && + other.name == name && + other.icon == icon; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (name == null ? 0 : name!.hashCode) + + (icon == null ? 0 : icon!.hashCode); + + @override + String toString() => 'CategorieDTO[name=$name, icon=$icon]'; + + Map toJson() { + final json = {}; + if (this.name != null) { + json[r'name'] = this.name; + } else { + json[r'name'] = null; + } + if (this.icon != null) { + json[r'icon'] = this.icon; + } else { + json[r'icon'] = null; + } + return json; + } + + /// Returns a new [CategorieDTO] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static CategorieDTO? 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 "CategorieDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "CategorieDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return CategorieDTO( + name: mapValueOfType(json, r'name'), + icon: mapValueOfType(json, r'icon'), + ); + } + 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 = CategorieDTO.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 = CategorieDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of CategorieDTO-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] = CategorieDTO.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/content_dto.dart b/manager_api_new/lib/model/content_dto.dart new file mode 100644 index 0000000..32512da --- /dev/null +++ b/manager_api_new/lib/model/content_dto.dart @@ -0,0 +1,179 @@ +// +// 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 ContentDTO { + /// Returns a new [ContentDTO] instance. + ContentDTO({ + this.title = const [], + this.description = const [], + this.resourceId, + this.resourceUrl, + this.order, + this.resourceType, + }); + + List? title; + + List? description; + + String? resourceId; + + String? resourceUrl; + + /// + /// 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. + /// + int? order; + + /// + /// 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. + /// + ResourceType? resourceType; + + @override + bool operator ==(Object other) => identical(this, other) || other is ContentDTO && + other.title == title && + other.description == description && + other.resourceId == resourceId && + other.resourceUrl == resourceUrl && + other.order == order && + other.resourceType == resourceType; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (title == null ? 0 : title!.hashCode) + + (description == null ? 0 : description!.hashCode) + + (resourceId == null ? 0 : resourceId!.hashCode) + + (resourceUrl == null ? 0 : resourceUrl!.hashCode) + + (order == null ? 0 : order!.hashCode) + + (resourceType == null ? 0 : resourceType!.hashCode); + + @override + String toString() => 'ContentDTO[title=$title, description=$description, resourceId=$resourceId, resourceUrl=$resourceUrl, order=$order, resourceType=$resourceType]'; + + Map toJson() { + final json = {}; + if (this.title != null) { + json[r'title'] = this.title; + } else { + json[r'title'] = null; + } + if (this.description != null) { + json[r'description'] = this.description; + } else { + json[r'description'] = null; + } + if (this.resourceId != null) { + json[r'resourceId'] = this.resourceId; + } else { + json[r'resourceId'] = null; + } + if (this.resourceUrl != null) { + json[r'resourceUrl'] = this.resourceUrl; + } else { + json[r'resourceUrl'] = null; + } + if (this.order != null) { + json[r'order'] = this.order; + } else { + json[r'order'] = null; + } + if (this.resourceType != null) { + json[r'resourceType'] = this.resourceType; + } else { + json[r'resourceType'] = null; + } + return json; + } + + /// Returns a new [ContentDTO] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static ContentDTO? 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 "ContentDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "ContentDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return ContentDTO( + title: TranslationDTO.listFromJson(json[r'title']), + description: TranslationDTO.listFromJson(json[r'description']), + resourceId: mapValueOfType(json, r'resourceId'), + resourceUrl: mapValueOfType(json, r'resourceUrl'), + order: mapValueOfType(json, r'order'), + resourceType: ResourceType.fromJson(json[r'resourceType']), + ); + } + 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 = ContentDTO.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 = ContentDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of ContentDTO-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] = ContentDTO.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/content_geo_point.dart b/manager_api_new/lib/model/content_geo_point.dart new file mode 100644 index 0000000..e8fe80f --- /dev/null +++ b/manager_api_new/lib/model/content_geo_point.dart @@ -0,0 +1,151 @@ +// +// 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 ContentGeoPoint { + /// Returns a new [ContentGeoPoint] instance. + ContentGeoPoint({ + this.resourceId, + this.resourceType, + this.resourceUrl, + this.latitude, + }); + + String? resourceId; + + /// + /// 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. + /// + ResourceType? resourceType; + + String? resourceUrl; + + String? latitude; + + @override + bool operator ==(Object other) => identical(this, other) || other is ContentGeoPoint && + other.resourceId == resourceId && + other.resourceType == resourceType && + other.resourceUrl == resourceUrl && + other.latitude == latitude; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (resourceId == null ? 0 : resourceId!.hashCode) + + (resourceType == null ? 0 : resourceType!.hashCode) + + (resourceUrl == null ? 0 : resourceUrl!.hashCode) + + (latitude == null ? 0 : latitude!.hashCode); + + @override + String toString() => 'ContentGeoPoint[resourceId=$resourceId, resourceType=$resourceType, resourceUrl=$resourceUrl, latitude=$latitude]'; + + Map toJson() { + final json = {}; + if (this.resourceId != null) { + json[r'resourceId'] = this.resourceId; + } else { + json[r'resourceId'] = null; + } + if (this.resourceType != null) { + json[r'resourceType'] = this.resourceType; + } else { + json[r'resourceType'] = null; + } + if (this.resourceUrl != null) { + json[r'resourceUrl'] = this.resourceUrl; + } else { + json[r'resourceUrl'] = null; + } + if (this.latitude != null) { + json[r'latitude'] = this.latitude; + } else { + json[r'latitude'] = null; + } + return json; + } + + /// Returns a new [ContentGeoPoint] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static ContentGeoPoint? 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 "ContentGeoPoint[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "ContentGeoPoint[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return ContentGeoPoint( + resourceId: mapValueOfType(json, r'resourceId'), + resourceType: ResourceType.fromJson(json[r'resourceType']), + resourceUrl: mapValueOfType(json, r'resourceUrl'), + latitude: mapValueOfType(json, r'latitude'), + ); + } + 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 = ContentGeoPoint.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 = ContentGeoPoint.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of ContentGeoPoint-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] = ContentGeoPoint.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/geo_point_dto.dart b/manager_api_new/lib/model/geo_point_dto.dart index e03a69c..0055667 100644 --- a/manager_api_new/lib/model/geo_point_dto.dart +++ b/manager_api_new/lib/model/geo_point_dto.dart @@ -16,7 +16,8 @@ class GeoPointDTO { this.id, this.title = const [], this.description = const [], - this.images = const [], + this.contents = const [], + this.categorie, this.latitude, this.longitude, }); @@ -33,7 +34,9 @@ class GeoPointDTO { List? description; - List? images; + List? contents; + + GeoPointDTOCategorie? categorie; String? latitude; @@ -44,7 +47,8 @@ class GeoPointDTO { other.id == id && other.title == title && other.description == description && - other.images == images && + other.contents == contents && + other.categorie == categorie && other.latitude == latitude && other.longitude == longitude; @@ -54,12 +58,13 @@ class GeoPointDTO { (id == null ? 0 : id!.hashCode) + (title == null ? 0 : title!.hashCode) + (description == null ? 0 : description!.hashCode) + - (images == null ? 0 : images!.hashCode) + + (contents == null ? 0 : contents!.hashCode) + + (categorie == null ? 0 : categorie!.hashCode) + (latitude == null ? 0 : latitude!.hashCode) + (longitude == null ? 0 : longitude!.hashCode); @override - String toString() => 'GeoPointDTO[id=$id, title=$title, description=$description, images=$images, latitude=$latitude, longitude=$longitude]'; + String toString() => 'GeoPointDTO[id=$id, title=$title, description=$description, contents=$contents, categorie=$categorie, latitude=$latitude, longitude=$longitude]'; Map toJson() { final json = {}; @@ -78,10 +83,15 @@ class GeoPointDTO { } else { json[r'description'] = null; } - if (this.images != null) { - json[r'images'] = this.images; + if (this.contents != null) { + json[r'contents'] = this.contents; } else { - json[r'images'] = null; + json[r'contents'] = null; + } + if (this.categorie != null) { + json[r'categorie'] = this.categorie; + } else { + json[r'categorie'] = null; } if (this.latitude != null) { json[r'latitude'] = this.latitude; @@ -118,7 +128,8 @@ class GeoPointDTO { id: mapValueOfType(json, r'id'), title: TranslationDTO.listFromJson(json[r'title']), description: TranslationDTO.listFromJson(json[r'description']), - images: ImageGeoPoint.listFromJson(json[r'images']), + contents: ContentGeoPoint.listFromJson(json[r'contents']), + categorie: GeoPointDTOCategorie.fromJson(json[r'categorie']), latitude: mapValueOfType(json, r'latitude'), longitude: mapValueOfType(json, r'longitude'), ); diff --git a/manager_api_new/lib/model/geo_point_dto_categorie.dart b/manager_api_new/lib/model/geo_point_dto_categorie.dart new file mode 100644 index 0000000..184646a --- /dev/null +++ b/manager_api_new/lib/model/geo_point_dto_categorie.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 GeoPointDTOCategorie { + /// Returns a new [GeoPointDTOCategorie] instance. + GeoPointDTOCategorie({ + this.name, + this.icon, + }); + + String? name; + + String? icon; + + @override + bool operator ==(Object other) => identical(this, other) || other is GeoPointDTOCategorie && + other.name == name && + other.icon == icon; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (name == null ? 0 : name!.hashCode) + + (icon == null ? 0 : icon!.hashCode); + + @override + String toString() => 'GeoPointDTOCategorie[name=$name, icon=$icon]'; + + Map toJson() { + final json = {}; + if (this.name != null) { + json[r'name'] = this.name; + } else { + json[r'name'] = null; + } + if (this.icon != null) { + json[r'icon'] = this.icon; + } else { + json[r'icon'] = null; + } + return json; + } + + /// Returns a new [GeoPointDTOCategorie] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GeoPointDTOCategorie? 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 "GeoPointDTOCategorie[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "GeoPointDTOCategorie[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GeoPointDTOCategorie( + name: mapValueOfType(json, r'name'), + icon: mapValueOfType(json, r'icon'), + ); + } + 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 = GeoPointDTOCategorie.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 = GeoPointDTOCategorie.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GeoPointDTOCategorie-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] = GeoPointDTOCategorie.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/image_dto.dart b/manager_api_new/lib/model/image_dto.dart index 0a55eed..b567355 100644 --- a/manager_api_new/lib/model/image_dto.dart +++ b/manager_api_new/lib/model/image_dto.dart @@ -18,6 +18,7 @@ class ImageDTO { this.resourceId, this.source_, this.order, + this.type, }); List? title; @@ -36,13 +37,22 @@ class ImageDTO { /// int? order; + /// + /// 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. + /// + ResourceType? type; + @override bool operator ==(Object other) => identical(this, other) || other is ImageDTO && other.title == title && other.description == description && other.resourceId == resourceId && other.source_ == source_ && - other.order == order; + other.order == order && + other.type == type; @override int get hashCode => @@ -51,10 +61,11 @@ class ImageDTO { (description == null ? 0 : description!.hashCode) + (resourceId == null ? 0 : resourceId!.hashCode) + (source_ == null ? 0 : source_!.hashCode) + - (order == null ? 0 : order!.hashCode); + (order == null ? 0 : order!.hashCode) + + (type == null ? 0 : type!.hashCode); @override - String toString() => 'ImageDTO[title=$title, description=$description, resourceId=$resourceId, source_=$source_, order=$order]'; + String toString() => 'ImageDTO[title=$title, description=$description, resourceId=$resourceId, source_=$source_, order=$order, type=$type]'; Map toJson() { final json = {}; @@ -83,6 +94,11 @@ class ImageDTO { } else { json[r'order'] = null; } + if (this.type != null) { + json[r'type'] = this.type; + } else { + json[r'type'] = null; + } return json; } @@ -110,6 +126,7 @@ class ImageDTO { resourceId: mapValueOfType(json, r'resourceId'), source_: mapValueOfType(json, r'source'), order: mapValueOfType(json, r'order'), + type: ResourceType.fromJson(json[r'type']), ); } return null; diff --git a/manager_api_new/lib/model/level_dto.dart b/manager_api_new/lib/model/level_dto.dart index 3332644..ae154d9 100644 --- a/manager_api_new/lib/model/level_dto.dart +++ b/manager_api_new/lib/model/level_dto.dart @@ -15,30 +15,41 @@ class LevelDTO { LevelDTO({ this.label = const [], this.resourceId, - this.source_, + this.resourceType, + this.resourceUrl, }); List? label; String? resourceId; - String? source_; + /// + /// 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. + /// + ResourceType? resourceType; + + String? resourceUrl; @override bool operator ==(Object other) => identical(this, other) || other is LevelDTO && other.label == label && other.resourceId == resourceId && - other.source_ == source_; + other.resourceType == resourceType && + other.resourceUrl == resourceUrl; @override int get hashCode => // ignore: unnecessary_parenthesis (label == null ? 0 : label!.hashCode) + (resourceId == null ? 0 : resourceId!.hashCode) + - (source_ == null ? 0 : source_!.hashCode); + (resourceType == null ? 0 : resourceType!.hashCode) + + (resourceUrl == null ? 0 : resourceUrl!.hashCode); @override - String toString() => 'LevelDTO[label=$label, resourceId=$resourceId, source_=$source_]'; + String toString() => 'LevelDTO[label=$label, resourceId=$resourceId, resourceType=$resourceType, resourceUrl=$resourceUrl]'; Map toJson() { final json = {}; @@ -52,10 +63,15 @@ class LevelDTO { } else { json[r'resourceId'] = null; } - if (this.source_ != null) { - json[r'source'] = this.source_; + if (this.resourceType != null) { + json[r'resourceType'] = this.resourceType; } else { - json[r'source'] = null; + json[r'resourceType'] = null; + } + if (this.resourceUrl != null) { + json[r'resourceUrl'] = this.resourceUrl; + } else { + json[r'resourceUrl'] = null; } return json; } @@ -81,7 +97,8 @@ class LevelDTO { return LevelDTO( label: TranslationDTO.listFromJson(json[r'label']), resourceId: mapValueOfType(json, r'resourceId'), - source_: mapValueOfType(json, r'source'), + resourceType: ResourceType.fromJson(json[r'resourceType']), + resourceUrl: mapValueOfType(json, r'resourceUrl'), ); } return null; diff --git a/manager_api_new/lib/model/map_dto.dart b/manager_api_new/lib/model/map_dto.dart index b193330..c9614c2 100644 --- a/manager_api_new/lib/model/map_dto.dart +++ b/manager_api_new/lib/model/map_dto.dart @@ -18,6 +18,7 @@ class MapDTO { this.points = const [], this.iconResourceId, this.iconSource, + this.categories = const [], }); /// @@ -42,13 +43,16 @@ class MapDTO { String? iconSource; + List? categories; + @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.iconSource == iconSource && + other.categories == categories; @override int get hashCode => @@ -57,10 +61,11 @@ class MapDTO { (mapType == null ? 0 : mapType!.hashCode) + (points == null ? 0 : points!.hashCode) + (iconResourceId == null ? 0 : iconResourceId!.hashCode) + - (iconSource == null ? 0 : iconSource!.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]'; + String toString() => 'MapDTO[zoom=$zoom, mapType=$mapType, points=$points, iconResourceId=$iconResourceId, iconSource=$iconSource, categories=$categories]'; Map toJson() { final json = {}; @@ -89,6 +94,11 @@ class MapDTO { } else { json[r'iconSource'] = null; } + if (this.categories != null) { + json[r'categories'] = this.categories; + } else { + json[r'categories'] = null; + } return json; } @@ -116,6 +126,7 @@ class MapDTO { points: GeoPointDTO.listFromJson(json[r'points']), iconResourceId: mapValueOfType(json, r'iconResourceId'), iconSource: mapValueOfType(json, r'iconSource'), + categories: CategorieDTO.listFromJson(json[r'categories']), ); } return null; diff --git a/manager_api_new/lib/model/pdf_dto.dart b/manager_api_new/lib/model/pdf_dto.dart new file mode 100644 index 0000000..a6242cc --- /dev/null +++ b/manager_api_new/lib/model/pdf_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 PdfDTO { + /// Returns a new [PdfDTO] instance. + PdfDTO({ + this.resourceId, + this.resourceUrl, + }); + + String? resourceId; + + String? resourceUrl; + + @override + bool operator ==(Object other) => identical(this, other) || other is PdfDTO && + other.resourceId == resourceId && + other.resourceUrl == resourceUrl; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (resourceId == null ? 0 : resourceId!.hashCode) + + (resourceUrl == null ? 0 : resourceUrl!.hashCode); + + @override + String toString() => 'PdfDTO[resourceId=$resourceId, resourceUrl=$resourceUrl]'; + + Map toJson() { + final json = {}; + if (this.resourceId != null) { + json[r'resourceId'] = this.resourceId; + } else { + json[r'resourceId'] = null; + } + if (this.resourceUrl != null) { + json[r'resourceUrl'] = this.resourceUrl; + } else { + json[r'resourceUrl'] = null; + } + return json; + } + + /// Returns a new [PdfDTO] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static PdfDTO? 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 "PdfDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "PdfDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return PdfDTO( + resourceId: mapValueOfType(json, r'resourceId'), + resourceUrl: mapValueOfType(json, r'resourceUrl'), + ); + } + 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 = PdfDTO.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 = PdfDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of PdfDTO-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] = PdfDTO.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/puzzle_dto.dart b/manager_api_new/lib/model/puzzle_dto.dart new file mode 100644 index 0000000..4b89f15 --- /dev/null +++ b/manager_api_new/lib/model/puzzle_dto.dart @@ -0,0 +1,134 @@ +// +// 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 PuzzleDTO { + /// Returns a new [PuzzleDTO] instance. + PuzzleDTO({ + this.messageDebut = const [], + this.messageFin = const [], + this.image, + }); + + List? messageDebut; + + List? messageFin; + + PuzzleDTOImage? image; + + @override + bool operator ==(Object other) => identical(this, other) || other is PuzzleDTO && + other.messageDebut == messageDebut && + other.messageFin == messageFin && + other.image == image; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (messageDebut == null ? 0 : messageDebut!.hashCode) + + (messageFin == null ? 0 : messageFin!.hashCode) + + (image == null ? 0 : image!.hashCode); + + @override + String toString() => 'PuzzleDTO[messageDebut=$messageDebut, messageFin=$messageFin, image=$image]'; + + Map toJson() { + final json = {}; + if (this.messageDebut != null) { + json[r'messageDebut'] = this.messageDebut; + } else { + json[r'messageDebut'] = null; + } + if (this.messageFin != null) { + json[r'messageFin'] = this.messageFin; + } else { + json[r'messageFin'] = null; + } + if (this.image != null) { + json[r'image'] = this.image; + } else { + json[r'image'] = null; + } + return json; + } + + /// Returns a new [PuzzleDTO] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static PuzzleDTO? 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 "PuzzleDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "PuzzleDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return PuzzleDTO( + messageDebut: TranslationDTO.listFromJson(json[r'messageDebut']), + messageFin: TranslationDTO.listFromJson(json[r'messageFin']), + image: PuzzleDTOImage.fromJson(json[r'image']), + ); + } + 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 = PuzzleDTO.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 = PuzzleDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of PuzzleDTO-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] = PuzzleDTO.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/puzzle_dto_image.dart b/manager_api_new/lib/model/puzzle_dto_image.dart new file mode 100644 index 0000000..1cd92ce --- /dev/null +++ b/manager_api_new/lib/model/puzzle_dto_image.dart @@ -0,0 +1,179 @@ +// +// 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 PuzzleDTOImage { + /// Returns a new [PuzzleDTOImage] instance. + PuzzleDTOImage({ + this.title = const [], + this.description = const [], + this.resourceId, + this.resourceUrl, + this.order, + this.resourceType, + }); + + List? title; + + List? description; + + String? resourceId; + + String? resourceUrl; + + /// + /// 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. + /// + int? order; + + /// + /// 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. + /// + ResourceType? resourceType; + + @override + bool operator ==(Object other) => identical(this, other) || other is PuzzleDTOImage && + other.title == title && + other.description == description && + other.resourceId == resourceId && + other.resourceUrl == resourceUrl && + other.order == order && + other.resourceType == resourceType; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (title == null ? 0 : title!.hashCode) + + (description == null ? 0 : description!.hashCode) + + (resourceId == null ? 0 : resourceId!.hashCode) + + (resourceUrl == null ? 0 : resourceUrl!.hashCode) + + (order == null ? 0 : order!.hashCode) + + (resourceType == null ? 0 : resourceType!.hashCode); + + @override + String toString() => 'PuzzleDTOImage[title=$title, description=$description, resourceId=$resourceId, resourceUrl=$resourceUrl, order=$order, resourceType=$resourceType]'; + + Map toJson() { + final json = {}; + if (this.title != null) { + json[r'title'] = this.title; + } else { + json[r'title'] = null; + } + if (this.description != null) { + json[r'description'] = this.description; + } else { + json[r'description'] = null; + } + if (this.resourceId != null) { + json[r'resourceId'] = this.resourceId; + } else { + json[r'resourceId'] = null; + } + if (this.resourceUrl != null) { + json[r'resourceUrl'] = this.resourceUrl; + } else { + json[r'resourceUrl'] = null; + } + if (this.order != null) { + json[r'order'] = this.order; + } else { + json[r'order'] = null; + } + if (this.resourceType != null) { + json[r'resourceType'] = this.resourceType; + } else { + json[r'resourceType'] = null; + } + return json; + } + + /// Returns a new [PuzzleDTOImage] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static PuzzleDTOImage? 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 "PuzzleDTOImage[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "PuzzleDTOImage[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return PuzzleDTOImage( + title: TranslationDTO.listFromJson(json[r'title']), + description: TranslationDTO.listFromJson(json[r'description']), + resourceId: mapValueOfType(json, r'resourceId'), + resourceUrl: mapValueOfType(json, r'resourceUrl'), + order: mapValueOfType(json, r'order'), + resourceType: ResourceType.fromJson(json[r'resourceType']), + ); + } + 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 = PuzzleDTOImage.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 = PuzzleDTOImage.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of PuzzleDTOImage-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] = PuzzleDTOImage.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/question_dto.dart b/manager_api_new/lib/model/question_dto.dart index 9d52588..e2ee08c 100644 --- a/manager_api_new/lib/model/question_dto.dart +++ b/manager_api_new/lib/model/question_dto.dart @@ -16,7 +16,8 @@ class QuestionDTO { this.label = const [], this.responses = const [], this.resourceId, - this.source_, + this.resourceType, + this.resourceUrl, this.order, }); @@ -26,7 +27,15 @@ class QuestionDTO { String? resourceId; - String? source_; + /// + /// 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. + /// + ResourceType? resourceType; + + String? resourceUrl; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -41,7 +50,8 @@ class QuestionDTO { other.label == label && other.responses == responses && other.resourceId == resourceId && - other.source_ == source_ && + other.resourceType == resourceType && + other.resourceUrl == resourceUrl && other.order == order; @override @@ -50,11 +60,12 @@ class QuestionDTO { (label == null ? 0 : label!.hashCode) + (responses == null ? 0 : responses!.hashCode) + (resourceId == null ? 0 : resourceId!.hashCode) + - (source_ == null ? 0 : source_!.hashCode) + + (resourceType == null ? 0 : resourceType!.hashCode) + + (resourceUrl == null ? 0 : resourceUrl!.hashCode) + (order == null ? 0 : order!.hashCode); @override - String toString() => 'QuestionDTO[label=$label, responses=$responses, resourceId=$resourceId, source_=$source_, order=$order]'; + String toString() => 'QuestionDTO[label=$label, responses=$responses, resourceId=$resourceId, resourceType=$resourceType, resourceUrl=$resourceUrl, order=$order]'; Map toJson() { final json = {}; @@ -73,10 +84,15 @@ class QuestionDTO { } else { json[r'resourceId'] = null; } - if (this.source_ != null) { - json[r'source'] = this.source_; + if (this.resourceType != null) { + json[r'resourceType'] = this.resourceType; } else { - json[r'source'] = null; + json[r'resourceType'] = null; + } + if (this.resourceUrl != null) { + json[r'resourceUrl'] = this.resourceUrl; + } else { + json[r'resourceUrl'] = null; } if (this.order != null) { json[r'order'] = this.order; @@ -108,7 +124,8 @@ class QuestionDTO { label: TranslationDTO.listFromJson(json[r'label']), responses: ResponseDTO.listFromJson(json[r'responses']), resourceId: mapValueOfType(json, r'resourceId'), - source_: mapValueOfType(json, r'source'), + resourceType: ResourceType.fromJson(json[r'resourceType']), + resourceUrl: mapValueOfType(json, r'resourceUrl'), order: mapValueOfType(json, r'order'), ); } diff --git a/manager_api_new/lib/model/quizz_dto_bad_level.dart b/manager_api_new/lib/model/quizz_dto_bad_level.dart index af82dd0..63b674b 100644 --- a/manager_api_new/lib/model/quizz_dto_bad_level.dart +++ b/manager_api_new/lib/model/quizz_dto_bad_level.dart @@ -15,30 +15,41 @@ class QuizzDTOBadLevel { QuizzDTOBadLevel({ this.label = const [], this.resourceId, - this.source_, + this.resourceType, + this.resourceUrl, }); List? label; String? resourceId; - String? source_; + /// + /// 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. + /// + ResourceType? resourceType; + + String? resourceUrl; @override bool operator ==(Object other) => identical(this, other) || other is QuizzDTOBadLevel && other.label == label && other.resourceId == resourceId && - other.source_ == source_; + other.resourceType == resourceType && + other.resourceUrl == resourceUrl; @override int get hashCode => // ignore: unnecessary_parenthesis (label == null ? 0 : label!.hashCode) + (resourceId == null ? 0 : resourceId!.hashCode) + - (source_ == null ? 0 : source_!.hashCode); + (resourceType == null ? 0 : resourceType!.hashCode) + + (resourceUrl == null ? 0 : resourceUrl!.hashCode); @override - String toString() => 'QuizzDTOBadLevel[label=$label, resourceId=$resourceId, source_=$source_]'; + String toString() => 'QuizzDTOBadLevel[label=$label, resourceId=$resourceId, resourceType=$resourceType, resourceUrl=$resourceUrl]'; Map toJson() { final json = {}; @@ -52,10 +63,15 @@ class QuizzDTOBadLevel { } else { json[r'resourceId'] = null; } - if (this.source_ != null) { - json[r'source'] = this.source_; + if (this.resourceType != null) { + json[r'resourceType'] = this.resourceType; } else { - json[r'source'] = null; + json[r'resourceType'] = null; + } + if (this.resourceUrl != null) { + json[r'resourceUrl'] = this.resourceUrl; + } else { + json[r'resourceUrl'] = null; } return json; } @@ -81,7 +97,8 @@ class QuizzDTOBadLevel { return QuizzDTOBadLevel( label: TranslationDTO.listFromJson(json[r'label']), resourceId: mapValueOfType(json, r'resourceId'), - source_: mapValueOfType(json, r'source'), + resourceType: ResourceType.fromJson(json[r'resourceType']), + resourceUrl: mapValueOfType(json, r'resourceUrl'), ); } return null; diff --git a/manager_api_new/lib/model/resource_dto.dart b/manager_api_new/lib/model/resource_dto.dart index 551145c..028b523 100644 --- a/manager_api_new/lib/model/resource_dto.dart +++ b/manager_api_new/lib/model/resource_dto.dart @@ -16,7 +16,7 @@ class ResourceDTO { this.id, this.type, this.label, - this.data, + this.url, this.dateCreation, this.instanceId, }); @@ -33,7 +33,7 @@ class ResourceDTO { String? label; - String? data; + String? url; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -50,7 +50,7 @@ class ResourceDTO { other.id == id && other.type == type && other.label == label && - other.data == data && + other.url == url && other.dateCreation == dateCreation && other.instanceId == instanceId; @@ -60,12 +60,12 @@ class ResourceDTO { (id == null ? 0 : id!.hashCode) + (type == null ? 0 : type!.hashCode) + (label == null ? 0 : label!.hashCode) + - (data == null ? 0 : data!.hashCode) + + (url == null ? 0 : url!.hashCode) + (dateCreation == null ? 0 : dateCreation!.hashCode) + (instanceId == null ? 0 : instanceId!.hashCode); @override - String toString() => 'ResourceDTO[id=$id, type=$type, label=$label, data=$data, dateCreation=$dateCreation, instanceId=$instanceId]'; + String toString() => 'ResourceDTO[id=$id, type=$type, label=$label, url=$url, dateCreation=$dateCreation, instanceId=$instanceId]'; Map toJson() { final json = {}; @@ -84,10 +84,10 @@ class ResourceDTO { } else { json[r'label'] = null; } - if (this.data != null) { - json[r'data'] = this.data; + if (this.url != null) { + json[r'url'] = this.url; } else { - json[r'data'] = null; + json[r'url'] = null; } if (this.dateCreation != null) { json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String(); @@ -124,7 +124,7 @@ class ResourceDTO { id: mapValueOfType(json, r'id'), type: ResourceType.fromJson(json[r'type']), label: mapValueOfType(json, r'label'), - data: mapValueOfType(json, r'data'), + url: mapValueOfType(json, r'url'), dateCreation: mapDateTime(json, r'dateCreation', ''), instanceId: mapValueOfType(json, r'instanceId'), ); diff --git a/manager_api_new/lib/model/resource_type.dart b/manager_api_new/lib/model/resource_type.dart index 0ca408f..5f9b5cd 100644 --- a/manager_api_new/lib/model/resource_type.dart +++ b/manager_api_new/lib/model/resource_type.dart @@ -28,6 +28,8 @@ class ResourceType { static const ImageUrl = ResourceType._(2); static const VideoUrl = ResourceType._(3); static const Audio = ResourceType._(4); + static const Pdf = ResourceType._(5); + static const Json = ResourceType._(6); /// List of all possible values in this [enum][ResourceType]. static const values = [ @@ -35,7 +37,9 @@ class ResourceType { Video, ImageUrl, VideoUrl, - Audio + Audio, + Pdf, + Json ]; static ResourceType? fromJson(dynamic value) => ResourceTypeTypeTransformer().decode(value); @@ -80,6 +84,8 @@ class ResourceTypeTypeTransformer { case "ImageUrl": return ResourceType.ImageUrl; case "VideoUrl": return ResourceType.VideoUrl; case "Audio": return ResourceType.Audio; + case "PDF": return ResourceType.Pdf; + case "JSON": return ResourceType.Json; default: if (!allowNull) { throw ArgumentError('Unknown enum value to decode: $data'); @@ -93,6 +99,8 @@ class ResourceTypeTypeTransformer { case 2: return ResourceType.ImageUrl; case 3: return ResourceType.VideoUrl; case 4: return ResourceType.Audio; + case 5: return ResourceType.Pdf; + case 6: return ResourceType.Json; default: if (!allowNull) { throw ArgumentError('Unknown enum value to decode: $data'); diff --git a/manager_api_new/lib/model/slider_dto.dart b/manager_api_new/lib/model/slider_dto.dart index 6cf9a47..837fb7a 100644 --- a/manager_api_new/lib/model/slider_dto.dart +++ b/manager_api_new/lib/model/slider_dto.dart @@ -13,29 +13,29 @@ part of openapi.api; class SliderDTO { /// Returns a new [SliderDTO] instance. SliderDTO({ - this.images = const [], + this.contents = const [], }); - List? images; + List? contents; @override bool operator ==(Object other) => identical(this, other) || other is SliderDTO && - other.images == images; + other.contents == contents; @override int get hashCode => // ignore: unnecessary_parenthesis - (images == null ? 0 : images!.hashCode); + (contents == null ? 0 : contents!.hashCode); @override - String toString() => 'SliderDTO[images=$images]'; + String toString() => 'SliderDTO[contents=$contents]'; Map toJson() { final json = {}; - if (this.images != null) { - json[r'images'] = this.images; + if (this.contents != null) { + json[r'contents'] = this.contents; } else { - json[r'images'] = null; + json[r'contents'] = null; } return json; } @@ -59,7 +59,7 @@ class SliderDTO { }()); return SliderDTO( - images: ImageDTO.listFromJson(json[r'images']), + contents: ContentDTO.listFromJson(json[r'contents']), ); } return null; diff --git a/manager_api_new/test/agenda_dto_test.dart b/manager_api_new/test/agenda_dto_test.dart new file mode 100644 index 0000000..58e4858 --- /dev/null +++ b/manager_api_new/test/agenda_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 AgendaDTO +void main() { + // final instance = AgendaDTO(); + + group('test AgendaDTO', () { + // String resourceId + test('to test the property `resourceId`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api_new/test/categorie_dto_test.dart b/manager_api_new/test/categorie_dto_test.dart new file mode 100644 index 0000000..f17bc28 --- /dev/null +++ b/manager_api_new/test/categorie_dto_test.dart @@ -0,0 +1,32 @@ +// +// 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 CategorieDTO +void main() { + // final instance = CategorieDTO(); + + group('test CategorieDTO', () { + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String icon + test('to test the property `icon`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api_new/test/content_dto_test.dart b/manager_api_new/test/content_dto_test.dart new file mode 100644 index 0000000..ac26830 --- /dev/null +++ b/manager_api_new/test/content_dto_test.dart @@ -0,0 +1,52 @@ +// +// 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 ContentDTO +void main() { + // final instance = ContentDTO(); + + group('test ContentDTO', () { + // List title (default value: const []) + test('to test the property `title`', () async { + // TODO + }); + + // List description (default value: const []) + test('to test the property `description`', () async { + // TODO + }); + + // String resourceId + test('to test the property `resourceId`', () async { + // TODO + }); + + // String resourceUrl + test('to test the property `resourceUrl`', () async { + // TODO + }); + + // int order + test('to test the property `order`', () async { + // TODO + }); + + // ResourceType resourceType + test('to test the property `resourceType`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api_new/test/content_geo_point_test.dart b/manager_api_new/test/content_geo_point_test.dart new file mode 100644 index 0000000..3e931db --- /dev/null +++ b/manager_api_new/test/content_geo_point_test.dart @@ -0,0 +1,42 @@ +// +// 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 ContentGeoPoint +void main() { + // final instance = ContentGeoPoint(); + + group('test ContentGeoPoint', () { + // String resourceId + test('to test the property `resourceId`', () async { + // TODO + }); + + // ResourceType resourceType + test('to test the property `resourceType`', () async { + // TODO + }); + + // String resourceUrl + test('to test the property `resourceUrl`', () async { + // TODO + }); + + // String latitude + test('to test the property `latitude`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api_new/test/geo_point_dto_categorie_test.dart b/manager_api_new/test/geo_point_dto_categorie_test.dart new file mode 100644 index 0000000..5f9287f --- /dev/null +++ b/manager_api_new/test/geo_point_dto_categorie_test.dart @@ -0,0 +1,32 @@ +// +// 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 GeoPointDTOCategorie +void main() { + // final instance = GeoPointDTOCategorie(); + + group('test GeoPointDTOCategorie', () { + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String icon + test('to test the property `icon`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api_new/test/pdf_dto_test.dart b/manager_api_new/test/pdf_dto_test.dart new file mode 100644 index 0000000..394d1b6 --- /dev/null +++ b/manager_api_new/test/pdf_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 PdfDTO +void main() { + // final instance = PdfDTO(); + + group('test PdfDTO', () { + // String resourceId + test('to test the property `resourceId`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api_new/test/puzzle_dto_image_test.dart b/manager_api_new/test/puzzle_dto_image_test.dart new file mode 100644 index 0000000..20dce91 --- /dev/null +++ b/manager_api_new/test/puzzle_dto_image_test.dart @@ -0,0 +1,52 @@ +// +// 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 PuzzleDTOImage +void main() { + // final instance = PuzzleDTOImage(); + + group('test PuzzleDTOImage', () { + // List title (default value: const []) + test('to test the property `title`', () async { + // TODO + }); + + // List description (default value: const []) + test('to test the property `description`', () async { + // TODO + }); + + // String resourceId + test('to test the property `resourceId`', () async { + // TODO + }); + + // String source_ + test('to test the property `source_`', () async { + // TODO + }); + + // int order + test('to test the property `order`', () async { + // TODO + }); + + // ResourceType type + test('to test the property `type`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api_new/test/puzzle_dto_test.dart b/manager_api_new/test/puzzle_dto_test.dart new file mode 100644 index 0000000..2156351 --- /dev/null +++ b/manager_api_new/test/puzzle_dto_test.dart @@ -0,0 +1,37 @@ +// +// 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 PuzzleDTO +void main() { + // final instance = PuzzleDTO(); + + group('test PuzzleDTO', () { + // List messageDebut (default value: const []) + test('to test the property `messageDebut`', () async { + // TODO + }); + + // List messageFin (default value: const []) + test('to test the property `messageFin`', () async { + // TODO + }); + + // PuzzleDTOImage image + test('to test the property `image`', () async { + // TODO + }); + + + }); + +}