From 358a035408e4a851272e8739c52ed39adc26bbac Mon Sep 17 00:00:00 2001 From: Fransolet Thomas Date: Sat, 19 Mar 2022 01:18:27 +0100 Subject: [PATCH] Add Quizz handle ! --- lib/Components/color_picker.dart | 4 +- lib/Components/fetch_section_icon.dart | 3 + lib/Components/message_notification.dart | 15 +- lib/Components/rounded_button.dart | 8 +- .../SubSection/Map/geopoint_image_list.dart | 2 +- .../Section/SubSection/Map/map_config.dart | 2 +- .../Section/SubSection/Menu/menu_config.dart | 2 +- .../Quizz/new_update_question_quizz.dart | 201 + .../Quizz/new_update_response_quizz.dart | 178 + .../Quizz/new_update_score_quizz.dart | 166 + .../SubSection/Quizz/quizz_answer_list.dart | 244 + .../SubSection/Quizz/quizz_config.dart | 380 ++ .../SubSection/Slider/slider_config.dart | 2 +- .../Section/section_detail_screen.dart | 29 +- .../configuration_detail_screen.dart | 6 +- .../Configurations/configurations_screen.dart | 2 +- .../Configurations/section_reorderList.dart | 2 +- lib/Screens/Resources/resource_body_grid.dart | 4 +- lib/Screens/login_screen.dart | 22 +- lib/constants.dart | 2 +- manager_api/.openapi-generator/FILES | 10 +- manager_api/README.md | 7 +- manager_api/doc/AuthenticationApi.md | 2 +- manager_api/doc/ConfigurationApi.md | 2 +- manager_api/doc/DeviceApi.md | 2 +- manager_api/doc/LevelDTO.md | 17 + manager_api/doc/QuestionDTO.md | 19 + manager_api/doc/QuizzDTO.md | 19 + manager_api/doc/ResourceApi.md | 2 +- manager_api/doc/ResponseDTO.md | 17 + manager_api/doc/SectionApi.md | 42 +- manager_api/doc/UserApi.md | 2 +- manager_api/lib/api.dart | 4 + manager_api/lib/api/section_api.dart | 52 + manager_api/lib/api_client.dart | 10 +- manager_api/lib/model/level_dto.dart | 89 + manager_api/lib/model/question_dto.dart | 107 + manager_api/lib/model/quizz_dto.dart | 107 + manager_api/lib/model/response_dto.dart | 89 + manager_api/lib/model/section_type.dart | 3 + manager_api/swagger.yaml | 4828 +++++++++++------ manager_api/swagger.yaml.bak | 1885 +++++++ manager_api/test/level_dto_test.dart | 36 + manager_api/test/question_dto_test.dart | 41 + manager_api/test/quizz_dto_test.dart | 46 + manager_api/test/response_dto_test.dart | 31 + pubspec.lock | 13 +- 47 files changed, 6910 insertions(+), 1846 deletions(-) create mode 100644 lib/Screens/Configurations/Section/SubSection/Quizz/new_update_question_quizz.dart create mode 100644 lib/Screens/Configurations/Section/SubSection/Quizz/new_update_response_quizz.dart create mode 100644 lib/Screens/Configurations/Section/SubSection/Quizz/new_update_score_quizz.dart create mode 100644 lib/Screens/Configurations/Section/SubSection/Quizz/quizz_answer_list.dart create mode 100644 lib/Screens/Configurations/Section/SubSection/Quizz/quizz_config.dart create mode 100644 manager_api/doc/LevelDTO.md create mode 100644 manager_api/doc/QuestionDTO.md create mode 100644 manager_api/doc/QuizzDTO.md create mode 100644 manager_api/doc/ResponseDTO.md create mode 100644 manager_api/lib/model/level_dto.dart create mode 100644 manager_api/lib/model/question_dto.dart create mode 100644 manager_api/lib/model/quizz_dto.dart create mode 100644 manager_api/lib/model/response_dto.dart create mode 100644 manager_api/swagger.yaml.bak create mode 100644 manager_api/test/level_dto_test.dart create mode 100644 manager_api/test/question_dto_test.dart create mode 100644 manager_api/test/quizz_dto_test.dart create mode 100644 manager_api/test/response_dto_test.dart diff --git a/lib/Components/color_picker.dart b/lib/Components/color_picker.dart index 8263667..5e11dd1 100644 --- a/lib/Components/color_picker.dart +++ b/lib/Components/color_picker.dart @@ -2,6 +2,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_colorpicker/flutter_colorpicker.dart'; import 'package:manager_app/Components/rounded_button.dart'; +import '../constants.dart'; + showColorPicker (Color currentColor, Function onSelect, BuildContext context) { Color pickerColor = currentColor; @@ -39,7 +41,7 @@ showColorPicker (Color currentColor, Function onSelect, BuildContext context) { child: RoundedButton( text: "Valider", icon: Icons.check, - color: Colors.lightGreen, + color: kSuccess, press: () { onSelect(pickerColor); Navigator.of(context).pop(); diff --git a/lib/Components/fetch_section_icon.dart b/lib/Components/fetch_section_icon.dart index 0614237..ee09dd2 100644 --- a/lib/Components/fetch_section_icon.dart +++ b/lib/Components/fetch_section_icon.dart @@ -18,6 +18,9 @@ IconData getSectionIcon(elementType) { case SectionType.menu: return Icons.apps_sharp; break; + case SectionType.quizz: + return Icons.question_answer; + break; } return Icons.menu; } \ No newline at end of file diff --git a/lib/Components/message_notification.dart b/lib/Components/message_notification.dart index 5e738a4..3cca683 100644 --- a/lib/Components/message_notification.dart +++ b/lib/Components/message_notification.dart @@ -10,12 +10,17 @@ showNotification (Color backgroundColor, Color textColor, String text, BuildCont borderRadius: BorderRadius.circular(10.0), ), padding: const EdgeInsets.symmetric( - horizontal: 8.0, // Inner padding for SnackBar content. + horizontal: 10.0, // Inner padding for SnackBar content. ), - content: Text( - text, - textAlign: TextAlign.center, - style: TextStyle(color: textColor), + content: Container( + height: 32.5, + child: Center( + child: Text( + text, + textAlign: TextAlign.center, + style: TextStyle(color: textColor), + ), + ), ) ); ScaffoldMessenger.of(context).showSnackBar(snackBar); diff --git a/lib/Components/rounded_button.dart b/lib/Components/rounded_button.dart index af9a6ae..610d433 100644 --- a/lib/Components/rounded_button.dart +++ b/lib/Components/rounded_button.dart @@ -7,6 +7,8 @@ class RoundedButton extends StatelessWidget { final IconData icon; final Color color, textColor; final double fontSize; + final int vertical; + final int horizontal; const RoundedButton({ Key key, @@ -15,7 +17,9 @@ class RoundedButton extends StatelessWidget { this.icon, this.color = kPrimaryColor, this.textColor = kWhite, - this.fontSize + this.fontSize, + this.vertical, + this.horizontal }) : super(key: key); @override @@ -23,7 +27,7 @@ class RoundedButton extends StatelessWidget { //Size size = MediaQuery.of(context).size; return TextButton( style: ButtonStyle( - padding: MaterialStateProperty.resolveWith((states) => EdgeInsets.symmetric(vertical: 25, horizontal: icon == null ? 85 : 30)), + padding: MaterialStateProperty.resolveWith((states) => EdgeInsets.symmetric(vertical: this.vertical != null ? this.vertical : 25, horizontal: this.horizontal != null ? this.horizontal : (icon == null ? 85 : 30))), backgroundColor: MaterialStateColor.resolveWith((states) => color), shape: MaterialStateProperty.all( RoundedRectangleBorder( 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 ddea924..54c031d 100644 --- a/lib/Screens/Configurations/Section/SubSection/Map/geopoint_image_list.dart +++ b/lib/Screens/Configurations/Section/SubSection/Map/geopoint_image_list.dart @@ -115,7 +115,7 @@ class _GeoPointImageListState extends State { size: 30.0, ), decoration: BoxDecoration( - color: Colors.lightGreen, + color: kSuccess, shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(20.0), boxShadow: [ diff --git a/lib/Screens/Configurations/Section/SubSection/Map/map_config.dart b/lib/Screens/Configurations/Section/SubSection/Map/map_config.dart index d99f44d..1e18f69 100644 --- a/lib/Screens/Configurations/Section/SubSection/Map/map_config.dart +++ b/lib/Screens/Configurations/Section/SubSection/Map/map_config.dart @@ -159,7 +159,7 @@ class _MapConfigState extends State { size: 30.0, ), decoration: BoxDecoration( - color: Colors.lightGreen, + color: kSuccess, shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(20.0), boxShadow: [ diff --git a/lib/Screens/Configurations/Section/SubSection/Menu/menu_config.dart b/lib/Screens/Configurations/Section/SubSection/Menu/menu_config.dart index e3ba19a..9472c20 100644 --- a/lib/Screens/Configurations/Section/SubSection/Menu/menu_config.dart +++ b/lib/Screens/Configurations/Section/SubSection/Menu/menu_config.dart @@ -130,7 +130,7 @@ class _MenuConfigState extends State { size: 30.0, ), decoration: BoxDecoration( - color: Colors.lightGreen, + color: kSuccess, shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(20.0), boxShadow: [ 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 new file mode 100644 index 0000000..b633b5b --- /dev/null +++ b/lib/Screens/Configurations/Section/SubSection/Quizz/new_update_question_quizz.dart @@ -0,0 +1,201 @@ +import 'package:auto_size_text/auto_size_text.dart'; +import 'package:manager_app/Components/image_input_container.dart'; +import 'package:flutter/material.dart'; +import 'package:manager_app/Components/message_notification.dart'; +import 'package:manager_app/Components/rounded_button.dart'; +import 'package:manager_app/Components/text_form_input_container.dart'; +import 'package:manager_app/Models/managerContext.dart'; +import 'package:manager_app/Screens/Configurations/Section/SubSection/Quizz/quizz_answer_list.dart'; +import 'package:manager_app/app_context.dart'; +import 'package:manager_app/constants.dart'; +import 'package:managerapi/api.dart'; + +Future showNewOrUpdateQuestionQuizz(QuestionDTO inputQuestionDTO, AppContext appContext, BuildContext context, String text) async { + QuestionDTO questionDTO = new QuestionDTO(); + + if (inputQuestionDTO != null) { + questionDTO = inputQuestionDTO; + } else { + questionDTO.label = []; + + ManagerAppContext managerAppContext = appContext.getContext(); + managerAppContext.selectedConfiguration.languages.forEach((element) { + var translationMessageDTO = new TranslationDTO(); + translationMessageDTO.language = element; + translationMessageDTO.value = ""; + + questionDTO.label.add(translationMessageDTO); + }); + } + + if(questionDTO.responses == null) { + questionDTO.responses = []; + } + + Size size = MediaQuery.of(context).size; + var result = await showDialog( + builder: (BuildContext dialogContext) => AlertDialog( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.all(Radius.circular(20.0)) + ), + content: Container( + width: size.width *0.5, + child: SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text(text, style: new TextStyle(fontSize: 25, fontWeight: FontWeight.w400)), + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Center( + child: ImageInputContainer( + label: "Image :", + initialValue: questionDTO.resourceId, + color: kPrimaryColor, + onChanged: (ResourceDTO resource) { + var result = resource; + questionDTO.source_ = result.type == ResourceType.imageUrl ? result.data : appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ result.id; + questionDTO.resourceId = result.id; + }, + isSmall: true + ), + ), + Container( + //color: Colors.orangeAccent, + height: size.height * 0.15, + width: double.infinity, + child: ListView( + scrollDirection: Axis.horizontal, + children: getTranslations(dialogContext, appContext, questionDTO), + ), + ), + Container( + height: size.height * 0.33, + decoration: BoxDecoration( + color: kWhite, + //color: Colors.green, + shape: BoxShape.rectangle, + border: Border.all(width: 1.5, color: kSecond), + borderRadius: BorderRadius.circular(10.0), + boxShadow: [ + BoxShadow( + color: kSecond, + spreadRadius: 0.5, + blurRadius: 5, + offset: Offset(0, 1.5), // changes position of shadow + ), + ], + ), + child: QuizzResponseList( + responses: questionDTO.responses, + onChanged: (List responsesOutput) { + questionDTO.responses = responsesOutput; + }, + ), + ), + ], + ), + ], + ), + ), + ), + actions: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Align( + alignment: AlignmentDirectional.bottomEnd, + child: Container( + width: 175, + height: 70, + child: RoundedButton( + text: "Annuler", + icon: Icons.undo, + color: kSecond, + press: () { + Navigator.pop(dialogContext); + }, + fontSize: 20, + ), + ), + ), + Align( + alignment: AlignmentDirectional.bottomEnd, + child: Container( + width: inputQuestionDTO != null ? 220: 150, + height: 70, + child: RoundedButton( + text: inputQuestionDTO != null ? "Sauvegarder" : "Créer", + icon: Icons.check, + color: kPrimaryColor, + textColor: kWhite, + press: () { + if(!questionDTO.label.any((label) => label.value == null || label.value.trim() == "")) { + Navigator.pop(dialogContext, questionDTO); + } else { + showNotification(kPrimaryColor, kWhite, "La traduction n'est pas complète", context, null); + } + }, + fontSize: 20, + ), + ), + ), + ], + ), + ], + ), context: context + ); + return result; +} + +getTranslations(BuildContext context, AppContext appContext, QuestionDTO questionDTO) { + List translations = []; + ManagerAppContext managerAppContext = appContext.getContext(); + for(var language in managerAppContext.selectedConfiguration.languages) { + translations.add( + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context).size.width *0.05, + height: MediaQuery.of(context).size.height *0.2, + decoration: BoxDecoration( + border: Border( + right: BorderSide(width: 1.5, color: kSecond), + ), + ), + child: Center(child: AutoSizeText(language.toUpperCase())) + ), + Padding( + padding: const EdgeInsets.only(left: 8.0), + child: Container( + child: SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + TextFormInputContainer( + label: "Question:", + color: kWhite, + isTitle: false, + initialValue: questionDTO.label.where((element) => element.language == language).first.value, + onChanged: (value) { + questionDTO.label.where((element) => element.language == language).first.value = value; + }, + ), + ], + ), + ), + ), + ) + ], + ), + ) + ); + } + return translations; +} + diff --git a/lib/Screens/Configurations/Section/SubSection/Quizz/new_update_response_quizz.dart b/lib/Screens/Configurations/Section/SubSection/Quizz/new_update_response_quizz.dart new file mode 100644 index 0000000..e25e3e8 --- /dev/null +++ b/lib/Screens/Configurations/Section/SubSection/Quizz/new_update_response_quizz.dart @@ -0,0 +1,178 @@ +import 'package:auto_size_text/auto_size_text.dart'; +import 'package:manager_app/Components/image_input_container.dart'; +import 'package:flutter/material.dart'; +import 'package:manager_app/Components/message_notification.dart'; +import 'package:manager_app/Components/rounded_button.dart'; +import 'package:manager_app/Components/text_form_input_container.dart'; +import 'package:manager_app/Models/managerContext.dart'; +import 'package:manager_app/app_context.dart'; +import 'package:manager_app/constants.dart'; +import 'package:managerapi/api.dart'; + +Future showNewOrUpdateResponseQuizz(ResponseDTO inputResponseDTO, AppContext appContext, BuildContext context, String text) async { + ResponseDTO responseDTO = new ResponseDTO(); + + if (inputResponseDTO != null) { + responseDTO = inputResponseDTO; + } else { + responseDTO.label = []; + + ManagerAppContext managerAppContext = appContext.getContext(); + managerAppContext.selectedConfiguration.languages.forEach((element) { + var translationMessageDTO = new TranslationDTO(); + translationMessageDTO.language = element; + translationMessageDTO.value = ""; + + responseDTO.label.add(translationMessageDTO); + }); + } + + Size size = MediaQuery.of(context).size; + var result = await showDialog( + builder: (BuildContext dialogContext) => AlertDialog( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.all(Radius.circular(20.0)) + ), + content: Container( + width: size.width *0.5, + child: SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text(text, style: new TextStyle(fontSize: 25, fontWeight: FontWeight.w400)), + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + height: size.height * 0.25, + width: double.infinity, + child: ListView( + scrollDirection: Axis.horizontal, + children: getTranslations(dialogContext, appContext, responseDTO), + ), + ), + ], + ), + /*Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Align( + alignment: AlignmentDirectional.centerStart, + child: Text("La réponse est valide:", style: TextStyle(fontSize: 25, fontWeight: FontWeight.w300)) + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Checkbox( + value: responseDTO.isGood, + checkColor: Colors.white, + activeColor: kPrimaryColor, + onChanged: (bool value) { + responseDTO.isGood = !responseDTO.isGood; + }, + ), + ), + ], + ),*/ + ], + ), + ), + ), + actions: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Align( + alignment: AlignmentDirectional.bottomEnd, + child: Container( + width: 175, + height: 70, + child: RoundedButton( + text: "Annuler", + icon: Icons.undo, + color: kSecond, + press: () { + Navigator.pop(dialogContext); + }, + fontSize: 20, + ), + ), + ), + Align( + alignment: AlignmentDirectional.bottomEnd, + child: Container( + width: inputResponseDTO != null ? 220: 150, + height: 70, + child: RoundedButton( + text: inputResponseDTO != null ? "Sauvegarder" : "Créer", + icon: Icons.check, + color: kPrimaryColor, + textColor: kWhite, + press: () { + if(!responseDTO.label.any((label) => label.value == null || label.value.trim() == "")) { + Navigator.pop(dialogContext, responseDTO); + } else { + showNotification(kPrimaryColor, kWhite, "La traduction n'est pas complète", context, null); + } + }, + fontSize: 20, + ), + ), + ), + ], + ), + ], + ), context: context + ); + return result; +} + +getTranslations(BuildContext context, AppContext appContext, ResponseDTO responseDTO) { + List translations = []; + ManagerAppContext managerAppContext = appContext.getContext(); + for(var language in managerAppContext.selectedConfiguration.languages) { + translations.add( + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context).size.width *0.05, + height: MediaQuery.of(context).size.height *0.2, + decoration: BoxDecoration( + border: Border( + right: BorderSide(width: 1.5, color: kSecond), + ), + ), + child: Center(child: AutoSizeText(language.toUpperCase())) + ), + Padding( + padding: const EdgeInsets.only(left: 8.0), + child: Container( + child: SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + TextFormInputContainer( + label: "Réponse:", + color: kWhite, + isTitle: true, + initialValue: responseDTO.label.where((element) => element.language == language).first.value, + onChanged: (value) { + responseDTO.label.where((element) => element.language == language).first.value = value; + }, + ), + ], + ), + ), + ), + ) + ], + ), + ) + ); + } + return translations; +} + 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 new file mode 100644 index 0000000..4870c56 --- /dev/null +++ b/lib/Screens/Configurations/Section/SubSection/Quizz/new_update_score_quizz.dart @@ -0,0 +1,166 @@ +import 'package:auto_size_text/auto_size_text.dart'; +import 'package:manager_app/Components/image_input_container.dart'; +import 'package:flutter/material.dart'; +import 'package:manager_app/Components/rounded_button.dart'; +import 'package:manager_app/Components/text_form_input_container.dart'; +import 'package:manager_app/Models/managerContext.dart'; +import 'package:manager_app/app_context.dart'; +import 'package:manager_app/constants.dart'; +import 'package:managerapi/api.dart'; + +Future showNewOrUpdateScoreQuizz(LevelDTO inputLevelDTO, AppContext appContext, BuildContext context, String text) async { + LevelDTO levelDTO = new LevelDTO(); + + if (inputLevelDTO != null) { + levelDTO = inputLevelDTO; + } else { + levelDTO.label = []; + + ManagerAppContext managerAppContext = appContext.getContext(); + managerAppContext.selectedConfiguration.languages.forEach((element) { + var translationMessageDTO = new TranslationDTO(); + translationMessageDTO.language = element; + translationMessageDTO.value = ""; + + levelDTO.label.add(translationMessageDTO); + }); + } + + Size size = MediaQuery.of(context).size; + var result = await showDialog( + builder: (BuildContext dialogContext) => AlertDialog( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.all(Radius.circular(20.0)) + ), + content: Container( + width: size.width *0.5, + child: SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text(text, style: new TextStyle(fontSize: 25, fontWeight: FontWeight.w400)), + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Center( + child: ImageInputContainer( + label: "Image :", + initialValue: levelDTO.resourceId, + color: kPrimaryColor, + onChanged: (ResourceDTO resource) { + var result = resource; + levelDTO.source_ = result.type == ResourceType.imageUrl ? result.data : appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ result.id; + levelDTO.resourceId = result.id; + }, + isSmall: true + ), + ), + Container( + height: size.height * 0.33, + width: double.infinity, + child: ListView( + scrollDirection: Axis.horizontal, + children: getTranslations(dialogContext, appContext, levelDTO), + ), + ), + ], + ), + ], + ), + ), + ), + actions: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Align( + alignment: AlignmentDirectional.bottomEnd, + child: Container( + width: 175, + height: 70, + child: RoundedButton( + text: "Annuler", + icon: Icons.undo, + color: kSecond, + press: () { + Navigator.pop(dialogContext); + }, + fontSize: 20, + ), + ), + ), + Align( + alignment: AlignmentDirectional.bottomEnd, + child: Container( + width: inputLevelDTO != null ? 220: 150, + height: 70, + child: RoundedButton( + text: inputLevelDTO != null ? "Sauvegarder" : "Créer", + icon: Icons.check, + color: kPrimaryColor, + textColor: kWhite, + press: () { + Navigator.pop(dialogContext, levelDTO); + }, + fontSize: 20, + ), + ), + ), + ], + ), + ], + ), context: context + ); + return result; +} + +getTranslations(BuildContext context, AppContext appContext, LevelDTO levelDTO) { + List translations = []; + ManagerAppContext managerAppContext = appContext.getContext(); + for(var language in managerAppContext.selectedConfiguration.languages) { + translations.add( + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context).size.width *0.05, + height: MediaQuery.of(context).size.height *0.2, + decoration: BoxDecoration( + border: Border( + right: BorderSide(width: 1.5, color: kSecond), + ), + ), + child: Center(child: AutoSizeText(language.toUpperCase())) + ), + Padding( + padding: const EdgeInsets.only(left: 8.0), + child: Container( + child: SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + TextFormInputContainer( + label: "Message:", + color: kWhite, + isTitle: false, + initialValue: levelDTO.label.where((element) => element.language == language).first.value, + onChanged: (value) { + levelDTO.label.where((element) => element.language == language).first.value = value; + }, + ), + ], + ), + ), + ), + ) + ], + ), + ) + ); + } + return translations; +} + diff --git a/lib/Screens/Configurations/Section/SubSection/Quizz/quizz_answer_list.dart b/lib/Screens/Configurations/Section/SubSection/Quizz/quizz_answer_list.dart new file mode 100644 index 0000000..0b04efe --- /dev/null +++ b/lib/Screens/Configurations/Section/SubSection/Quizz/quizz_answer_list.dart @@ -0,0 +1,244 @@ +import 'package:auto_size_text/auto_size_text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:manager_app/app_context.dart'; +import 'package:manager_app/constants.dart'; +import 'package:managerapi/api.dart'; +import 'package:provider/provider.dart'; + +import 'new_update_response_quizz.dart'; + +class QuizzResponseList extends StatefulWidget { + final List responses; + final ValueChanged> onChanged; + const QuizzResponseList({ + Key key, + this.responses, + this.onChanged, + }) : super(key: key); + + @override + _QuizzResponseListState createState() => _QuizzResponseListState(); +} + +class _QuizzResponseListState extends State { + List responsesMiddle; + + @override + void initState() { + super.initState(); + responsesMiddle = new List.from(widget.responses); + } + + void _onReorder(int oldIndex, int newIndex) { + setState( + () { + if (newIndex > oldIndex) { + newIndex -= 1; + } + final ResponseDTO item = responsesMiddle.removeAt(oldIndex); + responsesMiddle.insert(newIndex, item); + + var i = 0; + responsesMiddle.forEach((response) { + response.order = i; + i++; + }); + widget.onChanged(responsesMiddle); + }, + ); + } + + @override + Widget build(BuildContext context) { + final appContext = Provider.of(context); + Size size = MediaQuery.of(context).size; + + return Stack( + children: [ + Padding( + padding: const EdgeInsets.only(left: 15.0, right: 15.0, bottom: 15.0, top: 32.5), + child: ReorderableListView.builder( + shrinkWrap: true, + padding: const EdgeInsets.only(right: 125), + itemBuilder: (BuildContext context, int index) { + return Container( + key: ValueKey(index), + decoration: boxDecoration(), + padding: const EdgeInsets.all(2), + margin: EdgeInsets.symmetric(vertical: 3, horizontal: 3), + child: getElement(index, responsesMiddle[index], size, appContext), + ); + }, + itemCount: responsesMiddle.length, + onReorder: _onReorder + ), + ), + Positioned( + top: 10, + left: 10, + child: Text( + "Réponses", + style: TextStyle(fontSize: 15, fontWeight: FontWeight.w500), + ), + ), + if(responsesMiddle.length < 4) + Positioned( + bottom: 10, + right: 10, + child: InkWell( + onTap: () async { + var result = await showNewOrUpdateResponseQuizz(null, appContext, context, "Réponse"); + if (result != null) + { + setState(() { + result.order = responsesMiddle.length; + result.isGood = false; + responsesMiddle.add(result); + widget.onChanged(responsesMiddle); + }); + } + }, + child: Container( + height: MediaQuery.of(context).size.width * 0.04, + width: MediaQuery.of(context).size.width * 0.04, + child: Icon( + Icons.add, + color: kTextLightColor, + size: 30.0, + ), + decoration: BoxDecoration( + color: kSuccess, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(20.0), + boxShadow: [ + BoxShadow( + color: kSecond, + spreadRadius: 0.5, + blurRadius: 5, + offset: Offset(0, 1.5), // changes position of shadow + ), + ], + ), + ), + ), + ) + ], + ); + } + + getElement(int index, ResponseDTO response, Size size, AppContext appContext) { + return Stack( + children: [ + Container( + width: size.width *0.8, + height: 50, + child: Row( + children: [ + Center( + child: Padding( + padding: const EdgeInsets.all(2.0), + child: AutoSizeText( + response.label == null ? "" : response.label[0].value, + style: new TextStyle(fontSize: 15), + maxLines: 2, + textAlign: TextAlign.center, + ), + ), + ), + ], + ), + ), + Positioned( + right: 35, + bottom: 3, + child: Row( + children: [ + Tooltip( + message: "Si coché, la réponse est valide", + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Checkbox( + value: response.isGood, + checkColor: Colors.white, + activeColor: kPrimaryColor, + onChanged: (bool value) { + setState(() { + response.isGood = !response.isGood; + widget.onChanged(responsesMiddle); + }); + }, + ), + ), + ), + Tooltip( + message: "Modifier", + child: InkWell( + onTap: () async { + var result = await showNewOrUpdateResponseQuizz( + response, + appContext, + context, + "Modifier la réponse" + ); + + if (result != null) { + setState(() { + responsesMiddle[response.order] = result; + widget.onChanged(responsesMiddle); + }); + } + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Icon( + Icons.edit, + color: kPrimaryColor, + size: 25.0, + ), + ) + ), + ), + Tooltip( + message: "Supprimer", + child: InkWell( + onTap: () { + setState(() { + responsesMiddle.removeAt(response.order); + widget.onChanged(responsesMiddle); + }); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Icon( + Icons.delete, + color: kPrimaryColor, + size: 25.0, + ), + ) + ), + ), + ], + ) + ), + ], + ); + } +} + +boxDecoration() { + return BoxDecoration( + color: kBackgroundColor, + shape: BoxShape.rectangle, + border: Border.all(width: 1.5, color: kSecond), + borderRadius: BorderRadius.circular(10.0), + boxShadow: [ + BoxShadow( + color: kSecond, + spreadRadius: 0.5, + blurRadius: 5, + offset: Offset(0, 1.5), // changes position of shadow + ), + ], + ); +} diff --git a/lib/Screens/Configurations/Section/SubSection/Quizz/quizz_config.dart b/lib/Screens/Configurations/Section/SubSection/Quizz/quizz_config.dart new file mode 100644 index 0000000..f01da78 --- /dev/null +++ b/lib/Screens/Configurations/Section/SubSection/Quizz/quizz_config.dart @@ -0,0 +1,380 @@ +import 'package:auto_size_text/auto_size_text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:manager_app/Components/rounded_button.dart'; +import 'package:manager_app/app_context.dart'; +import 'package:manager_app/constants.dart'; +import 'package:managerapi/api.dart'; +import 'dart:convert'; + +import 'package:provider/provider.dart'; + +import 'new_update_question_quizz.dart'; +import 'new_update_score_quizz.dart'; + +class QuizzConfig extends StatefulWidget { + final String color; + final String label; + final String initialValue; + final ValueChanged onChanged; + const QuizzConfig({ + Key key, + this.color, + this.label, + this.initialValue, + this.onChanged, + }) : super(key: key); + + @override + _QuizzConfigState createState() => _QuizzConfigState(); +} + +class _QuizzConfigState extends State { + QuizzDTO quizzDTO; + + @override + void initState() { + super.initState(); + quizzDTO = QuizzDTO.fromJson(json.decode(widget.initialValue)); + List test = new List.from(quizzDTO.questions); + quizzDTO.questions = test; + quizzDTO.questions.sort((a, b) => a.order.compareTo(b.order)); + } + + @override + Widget build(BuildContext context) { + final appContext = Provider.of(context); + Size size = MediaQuery.of(context).size; + + void _onReorder(int oldIndex, int newIndex) { + setState( + () { + if (newIndex > oldIndex) { + newIndex -= 1; + } + final QuestionDTO item = quizzDTO.questions.removeAt(oldIndex); + quizzDTO.questions.insert(newIndex, item); + + var i = 0; + quizzDTO.questions.forEach((question) { + question.order = i; + i++; + }); + + widget.onChanged(jsonEncode(quizzDTO).toString()); + }, + ); + } + + return + SingleChildScrollView( + child: Column( + children: [ + Container( + height: size.height * 0.1, + width: double.infinity, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + // Bad + Container( + height: 50, + child: RoundedButton( + text: "Mauvais score", + color: kPrimaryColor, + textColor: kWhite, + icon: Icons.message, + press: () async { + var result = await showNewOrUpdateScoreQuizz(quizzDTO.badLevel, appContext, context, "Message pour un mauvais score"); + if (result != null) + { + setState(() { + print("BAAAD"); + quizzDTO.badLevel = result; + print(quizzDTO.badLevel); + widget.onChanged(jsonEncode(quizzDTO).toString()); + }); + } + }, + fontSize: 20, + horizontal: 10, + vertical: 10 + ), + ), + // Medium + Container( + height: 50, + child: RoundedButton( + text: "Moyen score", + color: kPrimaryColor, + textColor: kWhite, + icon: Icons.message, + press: () async { + var result = await showNewOrUpdateScoreQuizz(quizzDTO.mediumLevel, appContext, context, "Message pour un moyen score"); + if (result != null) + { + setState(() { + quizzDTO.mediumLevel = result; + widget.onChanged(jsonEncode(quizzDTO).toString()); + }); + } + }, + fontSize: 20, + horizontal: 10, + vertical: 10 + ), + ), + // Good + Container( + height: 50, + child: RoundedButton( + text: "Bon score", + color: kPrimaryColor, + textColor: kWhite, + icon: Icons.message, + press: () async { + var result = await showNewOrUpdateScoreQuizz(quizzDTO.goodLevel, appContext, context, "Message pour un bon score"); + if (result != null) + { + setState(() { + quizzDTO.goodLevel = result; + widget.onChanged(jsonEncode(quizzDTO).toString()); + }); + } + }, + fontSize: 20, + horizontal: 10, + vertical: 10 + ), + ), + // Great + Container( + height: 50, + child: RoundedButton( + text: "Excellent score", + color: kPrimaryColor, + textColor: kWhite, + icon: Icons.message, + press: () async { + var result = await showNewOrUpdateScoreQuizz(quizzDTO.greatLevel, appContext, context, "Message pour un excellent score"); + if (result != null) + { + setState(() { + quizzDTO.greatLevel = result; + widget.onChanged(jsonEncode(quizzDTO).toString()); + }); + } + }, + fontSize: 20, + horizontal: 10, + vertical: 10 + ), + ), + ], + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(25), + border: Border.all(width: 1.5, color: kSecond) + ), + child: Stack( + children: [ + Padding( + padding: const EdgeInsets.only(top: 40, left: 10, right: 10, bottom: 10), + child: Container( + height: quizzDTO.questions.length == 0 ? 75 : null, + child: ReorderableListView.builder( + shrinkWrap: true, + padding: const EdgeInsets.only(right: 125), + itemBuilder: (BuildContext context, int index) { + return Container( + key: ValueKey(index), + decoration: boxDecoration(), + padding: const EdgeInsets.all(2), + margin: EdgeInsets.symmetric(vertical: 3, horizontal: 3), + child: getElement(index, quizzDTO.questions[index], size, appContext), + ); + }, + itemCount: quizzDTO.questions.length, + onReorder: _onReorder + ), + ) + ), + Positioned( + top: 10, + left: 10, + child: Text( + "Questions", + style: TextStyle(fontSize: 15, fontWeight: FontWeight.w500), + ), + ), + Positioned( + bottom: 10, + right: 10, + child: InkWell( + onTap: () async { + print("new question"); + QuestionDTO result = await showNewOrUpdateQuestionQuizz(null, appContext, context, "Question"); + if (result != null) + { + setState(() { + result.order = quizzDTO.questions.length; + quizzDTO.questions.add(result); + widget.onChanged(jsonEncode(quizzDTO).toString()); + }); + } + }, + child: Container( + height: MediaQuery.of(context).size.width * 0.04, + width: MediaQuery.of(context).size.width * 0.04, + child: Icon( + Icons.add, + color: kTextLightColor, + size: 30.0, + ), + decoration: BoxDecoration( + color: kSuccess, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(20.0), + boxShadow: [ + BoxShadow( + color: kSecond, + spreadRadius: 0.5, + blurRadius: 5, + offset: Offset(0, 1.5), // changes position of shadow + ), + ], + ), + ), + ), + ) + ]), + ), + ), + ], + ), + ); + } + + getElement(int index, QuestionDTO question, Size size, AppContext appContext) { + return Stack( + children: [ + Container( + width: size.width *0.8, + height: 75, + child: Row( + children: [ + if(question.source_ != null) Container( + height: 60, + width: 60, + decoration: imageBoxDecoration(question, appContext), + margin: EdgeInsets.symmetric(horizontal: 10), + ), + Center( + child: Padding( + padding: const EdgeInsets.all(2.0), + child: AutoSizeText( + question.label == null ? "" : question.label[0].value, + style: new TextStyle(fontSize: 15), + maxLines: 2, + textAlign: TextAlign.center, + ), + ), + ), + ], + ), + ), + Positioned( + right: 35, + bottom: 18, + child: Row( + children: [ + Tooltip( + message: "Modifier", + child: InkWell( + onTap: () async { + var result = await showNewOrUpdateQuestionQuizz( + question, + appContext, + context, + "Modifier la question" + ); + + if (result != null) { + setState(() { + quizzDTO.questions[question.order] = result; + widget.onChanged(jsonEncode(quizzDTO).toString()); + }); + } + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Icon( + Icons.edit, + color: kPrimaryColor, + size: 25.0, + ), + ) + ), + ), + Tooltip( + message: "Supprimer", + child: InkWell( + onTap: () { + setState(() { + quizzDTO.questions.removeAt(question.order); + widget.onChanged(jsonEncode(quizzDTO).toString()); + }); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Icon( + Icons.delete, + color: kPrimaryColor, + size: 25.0, + ), + ) + ), + ), + ], + ) + ), + ], + ); + } +} + +boxDecoration() { + return BoxDecoration( + color: kBackgroundColor, + shape: BoxShape.rectangle, + border: Border.all(width: 1.5, color: kSecond), + borderRadius: BorderRadius.circular(10.0), + boxShadow: [ + BoxShadow( + color: kSecond, + spreadRadius: 0.5, + blurRadius: 5, + offset: Offset(0, 1.5), // changes position of shadow + ), + ], + ); +} + +imageBoxDecoration(QuestionDTO questionDTO, appContext) { + return BoxDecoration( + color: kBackgroundColor, + shape: BoxShape.rectangle, + border: Border.all(width: 1.5, color: kSecond), + borderRadius: BorderRadius.circular(10.0), + image: questionDTO.source_ != null ? new DecorationImage( + fit: BoxFit.cover, + image: new NetworkImage( + questionDTO.source_, + ), + ) : null, + ); +} \ No newline at end of file diff --git a/lib/Screens/Configurations/Section/SubSection/Slider/slider_config.dart b/lib/Screens/Configurations/Section/SubSection/Slider/slider_config.dart index 6134801..25d41ed 100644 --- a/lib/Screens/Configurations/Section/SubSection/Slider/slider_config.dart +++ b/lib/Screens/Configurations/Section/SubSection/Slider/slider_config.dart @@ -117,7 +117,7 @@ class _SliderConfigState extends State { size: 30.0, ), decoration: BoxDecoration( - color: Colors.lightGreen, + color: kSuccess, shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(20.0), boxShadow: [ diff --git a/lib/Screens/Configurations/Section/section_detail_screen.dart b/lib/Screens/Configurations/Section/section_detail_screen.dart index a340f27..6336147 100644 --- a/lib/Screens/Configurations/Section/section_detail_screen.dart +++ b/lib/Screens/Configurations/Section/section_detail_screen.dart @@ -18,6 +18,7 @@ import 'package:intl/intl.dart'; import 'SubSection/Map/map_config.dart'; import 'SubSection/Menu/menu_config.dart'; +import 'SubSection/Quizz/quizz_config.dart'; import 'SubSection/Slider/slider_config.dart'; class SectionDetailScreen extends StatefulWidget { @@ -67,17 +68,18 @@ class _SectionDetailScreenState extends State { Widget bodySection(SectionDTO sectionDTO, Size size, AppContext appContext, BuildContext context) { return Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, + //mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Container( - //height: size.height *0.13, + //color: Colors.orangeAccent, + height: 75, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Align( alignment: AlignmentDirectional.bottomStart, child: Padding( - padding: const EdgeInsets.all(10.0), + padding: const EdgeInsets.all(3.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -104,7 +106,7 @@ class _SectionDetailScreenState extends State { ) ), Padding( - padding: const EdgeInsets.all(10.0), + padding: const EdgeInsets.all(5.0), child: Align( alignment: AlignmentDirectional.centerEnd, child: InkWell( @@ -127,8 +129,9 @@ class _SectionDetailScreenState extends State { ), ), // TITLE Container( + //color: Colors.blue, child: Padding( - padding: const EdgeInsets.all(10.0), + padding: const EdgeInsets.all(5.0), child: Container( child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, @@ -201,19 +204,20 @@ class _SectionDetailScreenState extends State { ), ),// FIELDS SECTION Container( - height: size.height * 0.305, //width: size.width * 0.8, + height: size.height * 0.45, child: Padding( padding: const EdgeInsets.all(10.0), child: sectionDTO != null ? getSpecificData(sectionDTO, appContext) : null, ), decoration: BoxDecoration( + //color: Colors.lightGreen, borderRadius: BorderRadius.circular(30), border: Border.all(width: 1.5, color: kSecond) ), ), SizedBox( - height: size.height*0.1, + height: size.height*0.05, ) ], ); @@ -257,7 +261,7 @@ class _SectionDetailScreenState extends State { child: RoundedButton( text: "Sauvegarder", icon: Icons.done, - color: Colors.lightGreen, + color: kSuccess, textColor: Colors.white, fontSize: 15, press: () { @@ -342,6 +346,15 @@ class _SectionDetailScreenState extends State { sectionDTO.data = data; }, ); + case SectionType.quizz: + return QuizzConfig( + initialValue: sectionDTO.data, + onChanged: (String data) { + print("Received info in parent - quizz"); + print(data); + sectionDTO.data = data; + }, + ); } } } diff --git a/lib/Screens/Configurations/configuration_detail_screen.dart b/lib/Screens/Configurations/configuration_detail_screen.dart index 06ece49..397ac71 100644 --- a/lib/Screens/Configurations/configuration_detail_screen.dart +++ b/lib/Screens/Configurations/configuration_detail_screen.dart @@ -257,7 +257,7 @@ class _ConfigurationDetailScreenState extends State { child: RoundedButton( text: "Supprimer", icon: Icons.delete, - color: Colors.red, + color: kPrimaryColor, textColor: Colors.white, fontSize: 15, press: () { @@ -270,7 +270,7 @@ class _ConfigurationDetailScreenState extends State { child: RoundedButton( text: "Sauvegarder", icon: Icons.done, - color: Colors.lightGreen, + color: kSuccess, textColor: Colors.white, fontSize: 15, press: () { @@ -349,7 +349,7 @@ class _ConfigurationDetailScreenState extends State { boxDecoration(dynamic element) { return BoxDecoration( - color: element.id == null ? Colors.lightGreen : kTextLightColor, + color: element.id == null ? kSuccess : kTextLightColor, shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(25.0), boxShadow: [ diff --git a/lib/Screens/Configurations/configurations_screen.dart b/lib/Screens/Configurations/configurations_screen.dart index 8f0ce78..f43854f 100644 --- a/lib/Screens/Configurations/configurations_screen.dart +++ b/lib/Screens/Configurations/configurations_screen.dart @@ -144,7 +144,7 @@ Future> getConfigurations(dynamic appContext) async { boxDecoration(ConfigurationDTO configurationDTO) { return BoxDecoration( - color: configurationDTO.id == null ? Colors.lightGreen : kTextLightColor, + color: configurationDTO.id == null ? kSuccess : kTextLightColor, shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(25.0), boxShadow: [ diff --git a/lib/Screens/Configurations/section_reorderList.dart b/lib/Screens/Configurations/section_reorderList.dart index 67c7aa0..bc4158b 100644 --- a/lib/Screens/Configurations/section_reorderList.dart +++ b/lib/Screens/Configurations/section_reorderList.dart @@ -109,7 +109,7 @@ class _SectionReorderListState extends State { size: 30.0, ), decoration: BoxDecoration( - color: Colors.lightGreen, + color: kSuccess, shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(20.0), boxShadow: [ diff --git a/lib/Screens/Resources/resource_body_grid.dart b/lib/Screens/Resources/resource_body_grid.dart index 9d34092..c14f863 100644 --- a/lib/Screens/Resources/resource_body_grid.dart +++ b/lib/Screens/Resources/resource_body_grid.dart @@ -91,7 +91,7 @@ class _ResourceBodyGridState extends State { height: size.height *0.08, width: size.height *0.08, decoration: BoxDecoration( - color: Colors.lightGreen, + color: kSuccess, shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(25.0), boxShadow: [ @@ -211,7 +211,7 @@ class _ResourceBodyGridState extends State { boxDecoration(dynamic resourceDetailDTO, appContext) { return BoxDecoration( - color: resourceDetailDTO.id == null ? Colors.lightGreen : kBackgroundColor, + color: resourceDetailDTO.id == null ? kSuccess : kBackgroundColor, shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(30.0), image: resourceDetailDTO.id != null && resourceDetailDTO.type != ResourceType.videoUrl ? new DecorationImage( diff --git a/lib/Screens/login_screen.dart b/lib/Screens/login_screen.dart index 4796a27..0ab1053 100644 --- a/lib/Screens/login_screen.dart +++ b/lib/Screens/login_screen.dart @@ -60,7 +60,7 @@ class _LoginScreenState extends State { FileHelper().writeSession(updatedSession); } - showNotification(Colors.lightGreen, kWhite, 'Connexion réussie', context, null); + showNotification(kSuccess, kWhite, 'Connexion réussie', context, null); ManagerAppContext managerAppContext = appContext.getContext(); // Set the appContext @@ -176,15 +176,17 @@ class _LoginScreenState extends State { crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ - Checkbox( - checkColor: kTextLightColor, - activeColor: kPrimaryColor, - value: this.isRememberMe, - onChanged: (bool value) { - setState(() { - this.isRememberMe = value; - }); - }, + Container( + child: Checkbox( + checkColor: kTextLightColor, + activeColor: kPrimaryColor, + value: this.isRememberMe, + onChanged: (bool value) { + setState(() { + this.isRememberMe = value; + }); + }, + ), ), Text("Se souvenir de moi", style: TextStyle(fontSize: 15, fontWeight: FontWeight.w500),), ], diff --git a/lib/constants.dart b/lib/constants.dart index f20c9f3..1d2b714 100644 --- a/lib/constants.dart +++ b/lib/constants.dart @@ -13,7 +13,7 @@ const kWhite = Color(0xFFFFFFFF); const kBlack = Color(0xFF000000); const kSuccess = Color(0xFF8bc34a); -const List section_types = ["Map", "Slider", "Video", "Web", "Menu"]; +const List section_types = ["Map", "Slider", "Video", "Web", "Menu", "Quizz"]; const List map_types = ["none", "normal", "satellite", "terrain", "hybrid"]; const List languages = ["FR", "NL", "EN", "DE"]; const List resource_types = ["image", "image url", "video url"]; // "video", diff --git a/manager_api/.openapi-generator/FILES b/manager_api/.openapi-generator/FILES index 9e91dd4..2ee0d73 100644 --- a/manager_api/.openapi-generator/FILES +++ b/manager_api/.openapi-generator/FILES @@ -13,14 +13,18 @@ doc/ExportConfigurationDTOAllOf.md doc/GeoPointDTO.md doc/ImageDTO.md doc/ImageGeoPoint.md +doc/LevelDTO.md doc/LoginDTO.md doc/MapDTO.md doc/MapTypeApp.md doc/MenuDTO.md doc/PlayerMessageDTO.md +doc/QuestionDTO.md +doc/QuizzDTO.md doc/ResourceApi.md doc/ResourceDTO.md doc/ResourceType.md +doc/ResponseDTO.md doc/SectionApi.md doc/SectionDTO.md doc/SectionType.md @@ -57,13 +61,17 @@ 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/level_dto.dart lib/model/login_dto.dart lib/model/map_dto.dart lib/model/map_type_app.dart lib/model/menu_dto.dart lib/model/player_message_dto.dart +lib/model/question_dto.dart +lib/model/quizz_dto.dart lib/model/resource_dto.dart lib/model/resource_type.dart +lib/model/response_dto.dart lib/model/section_dto.dart lib/model/section_type.dart lib/model/slider_dto.dart @@ -74,5 +82,3 @@ lib/model/user_detail_dto.dart lib/model/video_dto.dart lib/model/web_dto.dart pubspec.yaml -test/export_configuration_dto_all_of_test.dart -test/export_configuration_dto_test.dart diff --git a/manager_api/README.md b/manager_api/README.md index cbc1dd4..2fc4960 100644 --- a/manager_api/README.md +++ b/manager_api/README.md @@ -60,7 +60,7 @@ try { ## Documentation for API Endpoints -All URIs are relative to *http://192.168.31.96* +All URIs are relative to *http://localhost:5000* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- @@ -95,6 +95,7 @@ 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* | [**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 | *SectionApi* | [**sectionGetWebDTO**](doc\/SectionApi.md#sectiongetwebdto) | **GET** /api/Section/WebDTO | @@ -119,13 +120,17 @@ Class | Method | HTTP request | Description - [GeoPointDTO](doc\/GeoPointDTO.md) - [ImageDTO](doc\/ImageDTO.md) - [ImageGeoPoint](doc\/ImageGeoPoint.md) + - [LevelDTO](doc\/LevelDTO.md) - [LoginDTO](doc\/LoginDTO.md) - [MapDTO](doc\/MapDTO.md) - [MapTypeApp](doc\/MapTypeApp.md) - [MenuDTO](doc\/MenuDTO.md) - [PlayerMessageDTO](doc\/PlayerMessageDTO.md) + - [QuestionDTO](doc\/QuestionDTO.md) + - [QuizzDTO](doc\/QuizzDTO.md) - [ResourceDTO](doc\/ResourceDTO.md) - [ResourceType](doc\/ResourceType.md) + - [ResponseDTO](doc\/ResponseDTO.md) - [SectionDTO](doc\/SectionDTO.md) - [SectionType](doc\/SectionType.md) - [SliderDTO](doc\/SliderDTO.md) diff --git a/manager_api/doc/AuthenticationApi.md b/manager_api/doc/AuthenticationApi.md index 464f981..b304348 100644 --- a/manager_api/doc/AuthenticationApi.md +++ b/manager_api/doc/AuthenticationApi.md @@ -5,7 +5,7 @@ import 'package:managerapi/api.dart'; ``` -All URIs are relative to *http://192.168.31.96* +All URIs are relative to *http://localhost:5000* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/manager_api/doc/ConfigurationApi.md b/manager_api/doc/ConfigurationApi.md index 437bf84..8b51ef5 100644 --- a/manager_api/doc/ConfigurationApi.md +++ b/manager_api/doc/ConfigurationApi.md @@ -5,7 +5,7 @@ import 'package:managerapi/api.dart'; ``` -All URIs are relative to *http://192.168.31.96* +All URIs are relative to *http://localhost:5000* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/manager_api/doc/DeviceApi.md b/manager_api/doc/DeviceApi.md index 96e70af..42130e9 100644 --- a/manager_api/doc/DeviceApi.md +++ b/manager_api/doc/DeviceApi.md @@ -5,7 +5,7 @@ import 'package:managerapi/api.dart'; ``` -All URIs are relative to *http://192.168.31.96* +All URIs are relative to *http://localhost:5000* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/manager_api/doc/LevelDTO.md b/manager_api/doc/LevelDTO.md new file mode 100644 index 0000000..af91156 --- /dev/null +++ b/manager_api/doc/LevelDTO.md @@ -0,0 +1,17 @@ +# managerapi.model.LevelDTO + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**resourceId** | **String** | | [optional] +**source_** | **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/doc/QuestionDTO.md b/manager_api/doc/QuestionDTO.md new file mode 100644 index 0000000..1827076 --- /dev/null +++ b/manager_api/doc/QuestionDTO.md @@ -0,0 +1,19 @@ +# managerapi.model.QuestionDTO + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +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] +**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/doc/QuizzDTO.md b/manager_api/doc/QuizzDTO.md new file mode 100644 index 0000000..953a3d7 --- /dev/null +++ b/manager_api/doc/QuizzDTO.md @@ -0,0 +1,19 @@ +# managerapi.model.QuizzDTO + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**questions** | [**List**](QuestionDTO.md) | | [optional] [default to const []] +**badLevel** | [**OneOfLevelDTO**](OneOfLevelDTO.md) | | [optional] +**mediumLevel** | [**OneOfLevelDTO**](OneOfLevelDTO.md) | | [optional] +**goodLevel** | [**OneOfLevelDTO**](OneOfLevelDTO.md) | | [optional] +**greatLevel** | [**OneOfLevelDTO**](OneOfLevelDTO.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/doc/ResourceApi.md b/manager_api/doc/ResourceApi.md index 455ec34..34d7e5e 100644 --- a/manager_api/doc/ResourceApi.md +++ b/manager_api/doc/ResourceApi.md @@ -5,7 +5,7 @@ import 'package:managerapi/api.dart'; ``` -All URIs are relative to *http://192.168.31.96* +All URIs are relative to *http://localhost:5000* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/manager_api/doc/ResponseDTO.md b/manager_api/doc/ResponseDTO.md new file mode 100644 index 0000000..4b5334a --- /dev/null +++ b/manager_api/doc/ResponseDTO.md @@ -0,0 +1,17 @@ +# managerapi.model.ResponseDTO + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**isGood** | **bool** | | [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/doc/SectionApi.md b/manager_api/doc/SectionApi.md index aecedef..7ede72a 100644 --- a/manager_api/doc/SectionApi.md +++ b/manager_api/doc/SectionApi.md @@ -5,7 +5,7 @@ import 'package:managerapi/api.dart'; ``` -All URIs are relative to *http://192.168.31.96* +All URIs are relative to *http://localhost:5000* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -18,6 +18,7 @@ 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 | +[**sectionGetQuizzDTO**](SectionApi.md#sectiongetquizzdto) | **GET** /api/Section/QuizzDTO | [**sectionGetSliderDTO**](SectionApi.md#sectiongetsliderdto) | **GET** /api/Section/SliderDTO | [**sectionGetVideoDTO**](SectionApi.md#sectiongetvideodto) | **GET** /api/Section/VideoDTO | [**sectionGetWebDTO**](SectionApi.md#sectiongetwebdto) | **GET** /api/Section/WebDTO | @@ -401,6 +402,45 @@ 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) +# **sectionGetQuizzDTO** +> QuizzDTO sectionGetQuizzDTO() + + + +### Example +```dart +import 'package:managerapi/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.sectionGetQuizzDTO(); + print(result); +} catch (e) { + print('Exception when calling SectionApi->sectionGetQuizzDTO: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**QuizzDTO**](QuizzDTO.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) + # **sectionGetSliderDTO** > SliderDTO sectionGetSliderDTO() diff --git a/manager_api/doc/UserApi.md b/manager_api/doc/UserApi.md index 65b7df2..42edc96 100644 --- a/manager_api/doc/UserApi.md +++ b/manager_api/doc/UserApi.md @@ -5,7 +5,7 @@ import 'package:managerapi/api.dart'; ``` -All URIs are relative to *http://192.168.31.96* +All URIs are relative to *http://localhost:5000* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/manager_api/lib/api.dart b/manager_api/lib/api.dart index 13f6dd1..942b8c8 100644 --- a/manager_api/lib/api.dart +++ b/manager_api/lib/api.dart @@ -43,13 +43,17 @@ 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/level_dto.dart'; part 'model/login_dto.dart'; part 'model/map_dto.dart'; part 'model/map_type_app.dart'; part 'model/menu_dto.dart'; part 'model/player_message_dto.dart'; +part 'model/question_dto.dart'; +part 'model/quizz_dto.dart'; part 'model/resource_dto.dart'; part 'model/resource_type.dart'; +part 'model/response_dto.dart'; part 'model/section_dto.dart'; part 'model/section_type.dart'; part 'model/slider_dto.dart'; diff --git a/manager_api/lib/api/section_api.dart b/manager_api/lib/api/section_api.dart index caace06..1b2ff7f 100644 --- a/manager_api/lib/api/section_api.dart +++ b/manager_api/lib/api/section_api.dart @@ -560,6 +560,58 @@ class SectionApi { return Future.value(null); } + /// Performs an HTTP 'GET /api/Section/QuizzDTO' operation and returns the [Response]. + Future sectionGetQuizzDTOWithHttpInfo() async { + final path = r'/api/Section/QuizzDTO'; + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + Future sectionGetQuizzDTO() async { + final response = await sectionGetQuizzDTOWithHttpInfo(); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'QuizzDTO') as QuizzDTO; + } + return Future.value(null); + } + /// Performs an HTTP 'GET /api/Section/SliderDTO' operation and returns the [Response]. Future sectionGetSliderDTOWithHttpInfo() async { final path = r'/api/Section/SliderDTO'; diff --git a/manager_api/lib/api_client.dart b/manager_api/lib/api_client.dart index 834e473..ed69aa5 100644 --- a/manager_api/lib/api_client.dart +++ b/manager_api/lib/api_client.dart @@ -10,7 +10,7 @@ part of openapi.api; class ApiClient { - ApiClient({this.basePath = 'http://192.168.31.96'}) { + ApiClient({this.basePath = 'http://localhost:5000'}) { // Setup authentications (key: authentication name, value: authentication). _authentications[r'bearer'] = OAuth(); } @@ -174,6 +174,8 @@ class ApiClient { return ImageDTO.fromJson(value); case 'ImageGeoPoint': return ImageGeoPoint.fromJson(value); + case 'LevelDTO': + return LevelDTO.fromJson(value); case 'LoginDTO': return LoginDTO.fromJson(value); case 'MapDTO': @@ -185,11 +187,17 @@ class ApiClient { return MenuDTO.fromJson(value); case 'PlayerMessageDTO': return PlayerMessageDTO.fromJson(value); + case 'QuestionDTO': + return QuestionDTO.fromJson(value); + case 'QuizzDTO': + return QuizzDTO.fromJson(value); case 'ResourceDTO': return ResourceDTO.fromJson(value); case 'ResourceType': return ResourceTypeTypeTransformer().decode(value); + case 'ResponseDTO': + return ResponseDTO.fromJson(value); case 'SectionDTO': return SectionDTO.fromJson(value); case 'SectionType': diff --git a/manager_api/lib/model/level_dto.dart b/manager_api/lib/model/level_dto.dart new file mode 100644 index 0000000..c9a5f17 --- /dev/null +++ b/manager_api/lib/model/level_dto.dart @@ -0,0 +1,89 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class LevelDTO { + /// Returns a new [LevelDTO] instance. + LevelDTO({ + this.label, + this.resourceId, + this.source_, + }); + + List label; + + String resourceId; + + String source_; + + @override + bool operator ==(Object other) => identical(this, other) || other is LevelDTO && + other.label == label && + other.resourceId == resourceId && + other.source_ == source_; + + @override + int get hashCode => + (label == null ? 0 : label.hashCode) + + (resourceId == null ? 0 : resourceId.hashCode) + + (source_ == null ? 0 : source_.hashCode); + + @override + String toString() => 'LevelDTO[label=$label, resourceId=$resourceId, source_=$source_]'; + + Map toJson() { + final json = {}; + if (label != null) { + json[r'label'] = label; + } + if (resourceId != null) { + json[r'resourceId'] = resourceId; + } + if (source_ != null) { + json[r'source'] = source_; + } + return json; + } + + /// Returns a new [LevelDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static LevelDTO fromJson(Map json) => json == null + ? null + : LevelDTO( + label: TranslationDTO.listFromJson(json[r'label']), + resourceId: json[r'resourceId'], + source_: json[r'source'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => LevelDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = LevelDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of LevelDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = LevelDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api/lib/model/question_dto.dart b/manager_api/lib/model/question_dto.dart new file mode 100644 index 0000000..0584111 --- /dev/null +++ b/manager_api/lib/model/question_dto.dart @@ -0,0 +1,107 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class QuestionDTO { + /// Returns a new [QuestionDTO] instance. + QuestionDTO({ + this.label, + this.responses, + this.resourceId, + this.source_, + this.order, + }); + + List label; + + List responses; + + String resourceId; + + String source_; + + int order; + + @override + bool operator ==(Object other) => identical(this, other) || other is QuestionDTO && + other.label == label && + other.responses == responses && + other.resourceId == resourceId && + other.source_ == source_ && + other.order == order; + + @override + int get hashCode => + (label == null ? 0 : label.hashCode) + + (responses == null ? 0 : responses.hashCode) + + (resourceId == null ? 0 : resourceId.hashCode) + + (source_ == null ? 0 : source_.hashCode) + + (order == null ? 0 : order.hashCode); + + @override + String toString() => 'QuestionDTO[label=$label, responses=$responses, resourceId=$resourceId, source_=$source_, order=$order]'; + + Map toJson() { + final json = {}; + if (label != null) { + json[r'label'] = label; + } + if (responses != null) { + json[r'responses'] = responses; + } + if (resourceId != null) { + json[r'resourceId'] = resourceId; + } + if (source_ != null) { + json[r'source'] = source_; + } + if (order != null) { + json[r'order'] = order; + } + return json; + } + + /// Returns a new [QuestionDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static QuestionDTO fromJson(Map json) => json == null + ? null + : QuestionDTO( + label: TranslationDTO.listFromJson(json[r'label']), + responses: ResponseDTO.listFromJson(json[r'responses']), + resourceId: json[r'resourceId'], + source_: json[r'source'], + order: json[r'order'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => QuestionDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = QuestionDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of QuestionDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = QuestionDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api/lib/model/quizz_dto.dart b/manager_api/lib/model/quizz_dto.dart new file mode 100644 index 0000000..20c22f2 --- /dev/null +++ b/manager_api/lib/model/quizz_dto.dart @@ -0,0 +1,107 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class QuizzDTO { + /// Returns a new [QuizzDTO] instance. + QuizzDTO({ + this.questions, + this.badLevel, + this.mediumLevel, + this.goodLevel, + this.greatLevel, + }); + + List questions; + + LevelDTO badLevel; + + LevelDTO mediumLevel; + + LevelDTO goodLevel; + + LevelDTO greatLevel; + + @override + bool operator ==(Object other) => identical(this, other) || other is QuizzDTO && + other.questions == questions && + other.badLevel == badLevel && + other.mediumLevel == mediumLevel && + other.goodLevel == goodLevel && + other.greatLevel == greatLevel; + + @override + int get hashCode => + (questions == null ? 0 : questions.hashCode) + + (badLevel == null ? 0 : badLevel.hashCode) + + (mediumLevel == null ? 0 : mediumLevel.hashCode) + + (goodLevel == null ? 0 : goodLevel.hashCode) + + (greatLevel == null ? 0 : greatLevel.hashCode); + + @override + String toString() => 'QuizzDTO[questions=$questions, badLevel=$badLevel, mediumLevel=$mediumLevel, goodLevel=$goodLevel, greatLevel=$greatLevel]'; + + Map toJson() { + final json = {}; + if (questions != null) { + json[r'questions'] = questions; + } + if (badLevel != null) { + json[r'bad_level'] = badLevel; + } + if (mediumLevel != null) { + json[r'medium_level'] = mediumLevel; + } + if (goodLevel != null) { + json[r'good_level'] = goodLevel; + } + if (greatLevel != null) { + json[r'great_level'] = greatLevel; + } + return json; + } + + /// Returns a new [QuizzDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static QuizzDTO fromJson(Map json) => json == null + ? null + : QuizzDTO( + questions: QuestionDTO.listFromJson(json[r'questions']), + badLevel: LevelDTO.fromJson(json[r'bad_level']), + mediumLevel: LevelDTO.fromJson(json[r'medium_level']), + goodLevel: LevelDTO.fromJson(json[r'good_level']), + greatLevel: LevelDTO.fromJson(json[r'great_level']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => QuizzDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = QuizzDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of QuizzDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = QuizzDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api/lib/model/response_dto.dart b/manager_api/lib/model/response_dto.dart new file mode 100644 index 0000000..1415493 --- /dev/null +++ b/manager_api/lib/model/response_dto.dart @@ -0,0 +1,89 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class ResponseDTO { + /// Returns a new [ResponseDTO] instance. + ResponseDTO({ + this.label, + this.isGood, + this.order, + }); + + List label; + + bool isGood; + + int order; + + @override + bool operator ==(Object other) => identical(this, other) || other is ResponseDTO && + other.label == label && + other.isGood == isGood && + other.order == order; + + @override + int get hashCode => + (label == null ? 0 : label.hashCode) + + (isGood == null ? 0 : isGood.hashCode) + + (order == null ? 0 : order.hashCode); + + @override + String toString() => 'ResponseDTO[label=$label, isGood=$isGood, order=$order]'; + + Map toJson() { + final json = {}; + if (label != null) { + json[r'label'] = label; + } + if (isGood != null) { + json[r'isGood'] = isGood; + } + if (order != null) { + json[r'order'] = order; + } + return json; + } + + /// Returns a new [ResponseDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static ResponseDTO fromJson(Map json) => json == null + ? null + : ResponseDTO( + label: TranslationDTO.listFromJson(json[r'label']), + isGood: json[r'isGood'], + order: json[r'order'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => ResponseDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = ResponseDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of ResponseDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = ResponseDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api/lib/model/section_type.dart b/manager_api/lib/model/section_type.dart index 49d9a14..4d6cbc2 100644 --- a/manager_api/lib/model/section_type.dart +++ b/manager_api/lib/model/section_type.dart @@ -27,6 +27,7 @@ class SectionType { static const video = SectionType._(r'Video'); static const web = SectionType._(r'Web'); static const menu = SectionType._(r'Menu'); + static const quizz = SectionType._(r'Quizz'); /// List of all possible values in this [enum][SectionType]. static const values = [ @@ -35,6 +36,7 @@ class SectionType { video, web, menu, + quizz, ]; static SectionType fromJson(dynamic value) => @@ -72,6 +74,7 @@ class SectionTypeTypeTransformer { case r'Video': return SectionType.video; case r'Web': return SectionType.web; case r'Menu': return SectionType.menu; + case r'Quizz': return SectionType.quizz; default: if (allowNull == false) { throw ArgumentError('Unknown enum value to decode: $data'); diff --git a/manager_api/swagger.yaml b/manager_api/swagger.yaml index fb333d9..1344d5b 100644 --- a/manager_api/swagger.yaml +++ b/manager_api/swagger.yaml @@ -1,1795 +1,3033 @@ -x-generator: NSwag v13.10.8.0 (NJsonSchema v10.3.11.0 (Newtonsoft.Json v10.0.0.0)) -openapi: 3.0.0 -info: - title: Manager Service - description: API Manager Service - version: Version Alpha -servers: - - url: http://192.168.31.96 -paths: - /api/Configuration: - get: - tags: - - Configuration - operationId: Configuration_Get - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/ConfigurationDTO' - '500': - description: '' - content: - application/json: - schema: - type: string - post: - tags: - - Configuration - operationId: Configuration_Create - requestBody: - x-name: newConfiguration - content: - application/json: - schema: - $ref: '#/components/schemas/ConfigurationDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ConfigurationDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '409': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - put: - tags: - - Configuration - operationId: Configuration_Update - requestBody: - x-name: updatedConfiguration - content: - application/json: - schema: - $ref: '#/components/schemas/ConfigurationDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ConfigurationDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Configuration/{id}: - get: - tags: - - Configuration - operationId: Configuration_GetDetail - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ConfigurationDTO' - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - delete: - tags: - - Configuration - operationId: Configuration_Delete - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '202': - description: '' - content: - application/json: - schema: - type: string - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Configuration/{id}/export: - get: - tags: - - Configuration - operationId: Configuration_Export - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ExportConfigurationDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Configuration/import: - post: - tags: - - Configuration - operationId: Configuration_Import - requestBody: - x-name: exportConfiguration - content: - application/json: - schema: - $ref: '#/components/schemas/ExportConfigurationDTO' - required: true - x-position: 1 - responses: - '202': - description: '' - content: - application/json: - schema: - type: string - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '409': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Device: - get: - tags: - - Device - operationId: Device_Get - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/DeviceDTO' - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - post: - tags: - - Device - operationId: Device_Create - requestBody: - x-name: newDevice - content: - application/json: - schema: - $ref: '#/components/schemas/DeviceDetailDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/DeviceDetailDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '409': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - put: - tags: - - Device - operationId: Device_Update - requestBody: - x-name: updatedDevice - content: - application/json: - schema: - $ref: '#/components/schemas/DeviceDetailDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/DeviceDetailDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Device/{id}/detail: - get: - tags: - - Device - operationId: Device_GetDetail - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/DeviceDetailDTO' - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - /api/Device/mainInfos: - put: - tags: - - Device - operationId: Device_UpdateMainInfos - requestBody: - x-name: deviceIn - content: - application/json: - schema: - $ref: '#/components/schemas/DeviceDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/DeviceDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Device/{id}: - delete: - tags: - - Device - operationId: Device_Delete - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '202': - description: '' - content: - application/json: - schema: - type: string - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Resource: - get: - tags: - - Resource - operationId: Resource_Get - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/ResourceDTO' - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - post: - tags: - - Resource - operationId: Resource_Create - requestBody: - x-name: newResource - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '409': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - put: - tags: - - Resource - operationId: Resource_Update - requestBody: - x-name: updatedResource - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Resource/{id}/detail: - get: - tags: - - Resource - operationId: Resource_GetDetail - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDTO' - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - /api/Resource/{id}: - get: - tags: - - Resource - operationId: Resource_Show - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/octet-stream: - schema: - type: string - format: binary - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - delete: - tags: - - Resource - operationId: Resource_Delete - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '202': - description: '' - content: - application/json: - schema: - type: string - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Resource/upload: - post: - tags: - - Resource - operationId: Resource_Upload - requestBody: - content: - multipart/form-data: - schema: - properties: - label: - type: string - nullable: true - type: - type: string - nullable: true - responses: - '200': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Section: - get: - tags: - - Section - operationId: Section_Get - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/SectionDTO' - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - post: - tags: - - Section - operationId: Section_Create - requestBody: - x-name: newSection - content: - application/json: - schema: - $ref: '#/components/schemas/SectionDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/SectionDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '409': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - put: - tags: - - Section - operationId: Section_Update - requestBody: - x-name: updatedSection - content: - application/json: - schema: - $ref: '#/components/schemas/SectionDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/SectionDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Section/configuration/{id}: - get: - tags: - - Section - operationId: Section_GetFromConfiguration - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/SectionDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - delete: - tags: - - Section - operationId: Section_DeleteAllForConfiguration - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '202': - description: '' - content: - application/json: - schema: - type: string - '400': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Section/{id}/subsections: - get: - tags: - - Section - operationId: Section_GetAllSectionSubSections - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: {} - '400': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Section/{id}: - get: - tags: - - Section - operationId: Section_GetDetail - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/SectionDTO' - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - delete: - tags: - - Section - operationId: Section_Delete - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '202': - description: '' - content: - application/json: - schema: - type: string - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Section/order: - put: - tags: - - Section - operationId: Section_UpdateOrder - requestBody: - x-name: updatedSectionsOrder - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/SectionDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - type: string - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Section/MapDTO: - get: - tags: - - Section - operationId: Section_GetMapDTO - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/MapDTO' - security: - - bearer: [] - /api/Section/SliderDTO: - get: - tags: - - Section - operationId: Section_GetSliderDTO - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/SliderDTO' - security: - - bearer: [] - /api/Section/VideoDTO: - get: - tags: - - Section - operationId: Section_GetVideoDTO - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/VideoDTO' - security: - - bearer: [] - /api/Section/WebDTO: - get: - tags: - - Section - operationId: Section_GetWebDTO - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/WebDTO' - security: - - bearer: [] - /api/Section/MenuDTO: - get: - tags: - - Section - operationId: Section_GetMenuDTO - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/MenuDTO' - security: - - bearer: [] - /api/Section/PlayerMessageDTO: - get: - tags: - - Section - operationId: Section_PlayerMessageDTO - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/PlayerMessageDTO' - security: - - bearer: [] - /api/User: - get: - tags: - - User - operationId: User_Get - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/User' - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - post: - tags: - - User - operationId: User_CreateUser - requestBody: - x-name: newUser - content: - application/json: - schema: - $ref: '#/components/schemas/User' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/UserDetailDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '409': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - put: - tags: - - User - operationId: User_UpdateUser - requestBody: - x-name: updatedUser - content: - application/json: - schema: - $ref: '#/components/schemas/User' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/UserDetailDTO' - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/User/{id}: - get: - tags: - - User - operationId: User_GetDetail - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/UserDetailDTO' - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - delete: - tags: - - User - operationId: User_DeleteUser - parameters: - - name: id - in: path - required: true - schema: - type: string - nullable: true - x-position: 1 - responses: - '202': - description: '' - content: - application/json: - schema: - type: string - '400': - description: '' - content: - application/json: - schema: - type: string - '404': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - security: - - bearer: [] - /api/Authentication/Token: - post: - tags: - - Authentication - operationId: Authentication_AuthenticateWithForm - requestBody: - content: - multipart/form-data: - schema: - properties: - grant_type: - type: string - nullable: true - username: - type: string - nullable: true - password: - type: string - nullable: true - client_id: - type: string - nullable: true - client_secret: - type: string - nullable: true - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/TokenDTO' - '401': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string - /api/Authentication/Authenticate: - post: - tags: - - Authentication - operationId: Authentication_AuthenticateWithJson - requestBody: - x-name: login - content: - application/json: - schema: - $ref: '#/components/schemas/LoginDTO' - required: true - x-position: 1 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/TokenDTO' - '401': - description: '' - content: - application/json: - schema: - type: string - '500': - description: '' - content: - application/json: - schema: - type: string -components: - schemas: - ConfigurationDTO: - type: object - additionalProperties: false - properties: - id: - type: string - nullable: true - label: - type: string - nullable: true - primaryColor: - type: string - nullable: true - secondaryColor: - type: string - nullable: true - languages: - type: array - nullable: true - items: - type: string - dateCreation: - type: string - format: date-time - ExportConfigurationDTO: - allOf: - - $ref: '#/components/schemas/ConfigurationDTO' - - type: object - additionalProperties: false - properties: - sections: - type: array - nullable: true - items: - $ref: '#/components/schemas/SectionDTO' - resources: - type: array - nullable: true - items: - $ref: '#/components/schemas/ResourceDTO' - SectionDTO: - type: object - additionalProperties: false - properties: - id: - type: string - nullable: true - label: - type: string - nullable: true - title: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - description: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - imageId: - type: string - nullable: true - imageSource: - type: string - nullable: true - configurationId: - type: string - nullable: true - isSubSection: - type: boolean - parentId: - type: string - nullable: true - type: - $ref: '#/components/schemas/SectionType' - data: - type: string - nullable: true - dateCreation: - type: string - format: date-time - order: - type: integer - format: int32 - TranslationDTO: - type: object - additionalProperties: false - properties: - language: - type: string - nullable: true - value: - type: string - nullable: true - SectionType: - type: string - description: '' - x-enumNames: - - Map - - Slider - - Video - - Web - - Menu - enum: - - Map - - Slider - - Video - - Web - - Menu - ResourceDTO: - type: object - additionalProperties: false - properties: - id: - type: string - nullable: true - type: - $ref: '#/components/schemas/ResourceType' - label: - type: string - nullable: true - dateCreation: - type: string - format: date-time - data: - type: string - nullable: true - ResourceType: - type: string - description: '' - x-enumNames: - - Image - - Video - - ImageUrl - - VideoUrl - enum: - - Image - - Video - - ImageUrl - - VideoUrl - DeviceDTO: - type: object - additionalProperties: false - properties: - id: - type: string - nullable: true - identifier: - type: string - nullable: true - name: - type: string - nullable: true - ipAddressWLAN: - type: string - nullable: true - ipAddressETH: - type: string - nullable: true - configurationId: - type: string - nullable: true - configuration: - type: string - nullable: true - connected: - type: boolean - dateCreation: - type: string - format: date-time - dateUpdate: - type: string - format: date-time - DeviceDetailDTO: - allOf: - - $ref: '#/components/schemas/DeviceDTO' - - type: object - additionalProperties: false - properties: - connectionLevel: - type: string - nullable: true - lastConnectionLevel: - type: string - format: date-time - batteryLevel: - type: string - nullable: true - lastBatteryLevel: - type: string - format: date-time - MapDTO: - type: object - additionalProperties: false - properties: - zoom: - type: integer - format: int32 - mapType: - $ref: '#/components/schemas/MapTypeApp' - points: - type: array - nullable: true - items: - $ref: '#/components/schemas/GeoPointDTO' - iconResourceId: - type: string - nullable: true - iconSource: - type: string - nullable: true - MapTypeApp: - type: string - description: '' - x-enumNames: - - none - - normal - - satellite - - terrain - - hybrid - enum: - - none - - normal - - satellite - - terrain - - hybrid - GeoPointDTO: - type: object - additionalProperties: false - properties: - id: - type: integer - format: int32 - title: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - description: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - images: - type: array - nullable: true - items: - $ref: '#/components/schemas/ImageGeoPoint' - latitude: - type: string - nullable: true - longitude: - type: string - nullable: true - ImageGeoPoint: - type: object - additionalProperties: false - properties: - imageResourceId: - type: string - nullable: true - imageSource: - type: string - nullable: true - SliderDTO: - type: object - additionalProperties: false - properties: - images: - type: array - nullable: true - items: - $ref: '#/components/schemas/ImageDTO' - ImageDTO: - type: object - additionalProperties: false - properties: - title: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - description: - type: array - nullable: true - items: - $ref: '#/components/schemas/TranslationDTO' - resourceId: - type: string - nullable: true - source: - type: string - nullable: true - order: - type: integer - format: int32 - VideoDTO: - type: object - additionalProperties: false - properties: - source: - type: string - nullable: true - WebDTO: - type: object - additionalProperties: false - properties: - source: - type: string - nullable: true - MenuDTO: - type: object - additionalProperties: false - properties: - sections: - type: array - nullable: true - items: - $ref: '#/components/schemas/SectionDTO' - PlayerMessageDTO: - type: object - additionalProperties: false - properties: - configChanged: - type: boolean - isDeleted: - type: boolean - User: - type: object - additionalProperties: false - properties: - id: - type: string - nullable: true - email: - type: string - nullable: true - password: - type: string - nullable: true - firstName: - type: string - nullable: true - lastName: - type: string - nullable: true - token: - type: string - nullable: true - dateCreation: - type: string - format: date-time - UserDetailDTO: - type: object - additionalProperties: false - properties: - id: - type: string - nullable: true - email: - type: string - nullable: true - firstName: - type: string - nullable: true - lastName: - type: string - nullable: true - TokenDTO: - type: object - additionalProperties: false - properties: - access_token: - type: string - nullable: true - refresh_token: - type: string - nullable: true - scope: - type: string - nullable: true - token_type: - type: string - nullable: true - expires_in: - type: integer - format: int32 - expiration: - type: string - format: date-time - LoginDTO: - type: object - additionalProperties: false - properties: - email: - type: string - nullable: true - password: - type: string - nullable: true - securitySchemes: - bearer: - type: oauth2 - description: Manager Authentication - flows: - password: - authorizationUrl: /authentication/Token - tokenUrl: /api/authentication/Token - scopes: - Manager-api: Manager WebAPI -security: - - bearer: [] -tags: - - name: Configuration - description: Configuration management - - name: Device - description: Device management - - name: Resource - description: Resource management - - name: Section - description: Section management - - name: User - description: User management - - name: Authentication - description: Authentication management +{ + "x-generator": "NSwag v13.10.8.0 (NJsonSchema v10.3.11.0 (Newtonsoft.Json v10.0.0.0))", + "openapi": "3.0.0", + "info": { + "title": "Manager Service", + "description": "API Manager Service", + "version": "Version Alpha" + }, + "servers": [ + { + "url": "http://localhost:5000" + } + ], + "paths": { + "/api/Configuration": { + "get": { + "tags": [ + "Configuration" + ], + "operationId": "Configuration_Get", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ConfigurationDTO" + } + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "post": { + "tags": [ + "Configuration" + ], + "operationId": "Configuration_Create", + "requestBody": { + "x-name": "newConfiguration", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigurationDTO" + } + } + }, + "required": true, + "x-position": 1 + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigurationDTO" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + }, + "put": { + "tags": [ + "Configuration" + ], + "operationId": "Configuration_Update", + "requestBody": { + "x-name": "updatedConfiguration", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigurationDTO" + } + } + }, + "required": true, + "x-position": 1 + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigurationDTO" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/Configuration/{id}": { + "get": { + "tags": [ + "Configuration" + ], + "operationId": "Configuration_GetDetail", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "nullable": true + }, + "x-position": 1 + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigurationDTO" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Configuration" + ], + "operationId": "Configuration_Delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "nullable": true + }, + "x-position": 1 + } + ], + "responses": { + "202": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/Configuration/{id}/export": { + "get": { + "tags": [ + "Configuration" + ], + "operationId": "Configuration_Export", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "nullable": true + }, + "x-position": 1 + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExportConfigurationDTO" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/Configuration/import": { + "post": { + "tags": [ + "Configuration" + ], + "operationId": "Configuration_Import", + "requestBody": { + "x-name": "exportConfiguration", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExportConfigurationDTO" + } + } + }, + "required": true, + "x-position": 1 + }, + "responses": { + "202": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/Device": { + "get": { + "tags": [ + "Device" + ], + "operationId": "Device_Get", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DeviceDTO" + } + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + }, + "post": { + "tags": [ + "Device" + ], + "operationId": "Device_Create", + "requestBody": { + "x-name": "newDevice", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeviceDetailDTO" + } + } + }, + "required": true, + "x-position": 1 + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeviceDetailDTO" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "put": { + "tags": [ + "Device" + ], + "operationId": "Device_Update", + "requestBody": { + "x-name": "updatedDevice", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeviceDetailDTO" + } + } + }, + "required": true, + "x-position": 1 + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeviceDetailDTO" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/Device/{id}/detail": { + "get": { + "tags": [ + "Device" + ], + "operationId": "Device_GetDetail", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "nullable": true + }, + "x-position": 1 + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeviceDetailDTO" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/api/Device/mainInfos": { + "put": { + "tags": [ + "Device" + ], + "operationId": "Device_UpdateMainInfos", + "requestBody": { + "x-name": "deviceIn", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeviceDTO" + } + } + }, + "required": true, + "x-position": 1 + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeviceDTO" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/Device/{id}": { + "delete": { + "tags": [ + "Device" + ], + "operationId": "Device_Delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "nullable": true + }, + "x-position": 1 + } + ], + "responses": { + "202": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/Resource": { + "get": { + "tags": [ + "Resource" + ], + "operationId": "Resource_Get", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ResourceDTO" + } + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + }, + "post": { + "tags": [ + "Resource" + ], + "operationId": "Resource_Create", + "requestBody": { + "x-name": "newResource", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResourceDTO" + } + } + }, + "required": true, + "x-position": 1 + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResourceDTO" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + }, + "put": { + "tags": [ + "Resource" + ], + "operationId": "Resource_Update", + "requestBody": { + "x-name": "updatedResource", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResourceDTO" + } + } + }, + "required": true, + "x-position": 1 + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResourceDTO" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/Resource/{id}/detail": { + "get": { + "tags": [ + "Resource" + ], + "operationId": "Resource_GetDetail", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "nullable": true + }, + "x-position": 1 + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResourceDTO" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/api/Resource/{id}": { + "get": { + "tags": [ + "Resource" + ], + "operationId": "Resource_Show", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "nullable": true + }, + "x-position": 1 + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Resource" + ], + "operationId": "Resource_Delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "nullable": true + }, + "x-position": 1 + } + ], + "responses": { + "202": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/Resource/upload": { + "post": { + "tags": [ + "Resource" + ], + "operationId": "Resource_Upload", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "properties": { + "label": { + "type": "string", + "nullable": true + }, + "type": { + "type": "string", + "nullable": true + } + } + } + } + } + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/Section": { + "get": { + "tags": [ + "Section" + ], + "operationId": "Section_Get", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SectionDTO" + } + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + }, + "post": { + "tags": [ + "Section" + ], + "operationId": "Section_Create", + "requestBody": { + "x-name": "newSection", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SectionDTO" + } + } + }, + "required": true, + "x-position": 1 + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SectionDTO" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + }, + "put": { + "tags": [ + "Section" + ], + "operationId": "Section_Update", + "requestBody": { + "x-name": "updatedSection", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SectionDTO" + } + } + }, + "required": true, + "x-position": 1 + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SectionDTO" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/Section/configuration/{id}": { + "get": { + "tags": [ + "Section" + ], + "operationId": "Section_GetFromConfiguration", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "nullable": true + }, + "x-position": 1 + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SectionDTO" + } + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Section" + ], + "operationId": "Section_DeleteAllForConfiguration", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "nullable": true + }, + "x-position": 1 + } + ], + "responses": { + "202": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/Section/{id}/subsections": { + "get": { + "tags": [ + "Section" + ], + "operationId": "Section_GetAllSectionSubSections", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "nullable": true + }, + "x-position": 1 + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": {} + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/Section/{id}": { + "get": { + "tags": [ + "Section" + ], + "operationId": "Section_GetDetail", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "nullable": true + }, + "x-position": 1 + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SectionDTO" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Section" + ], + "operationId": "Section_Delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "nullable": true + }, + "x-position": 1 + } + ], + "responses": { + "202": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/Section/order": { + "put": { + "tags": [ + "Section" + ], + "operationId": "Section_UpdateOrder", + "requestBody": { + "x-name": "updatedSectionsOrder", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SectionDTO" + } + } + } + }, + "required": true, + "x-position": 1 + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/Section/MapDTO": { + "get": { + "tags": [ + "Section" + ], + "operationId": "Section_GetMapDTO", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MapDTO" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/Section/SliderDTO": { + "get": { + "tags": [ + "Section" + ], + "operationId": "Section_GetSliderDTO", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SliderDTO" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/Section/VideoDTO": { + "get": { + "tags": [ + "Section" + ], + "operationId": "Section_GetVideoDTO", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VideoDTO" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/Section/WebDTO": { + "get": { + "tags": [ + "Section" + ], + "operationId": "Section_GetWebDTO", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WebDTO" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/Section/MenuDTO": { + "get": { + "tags": [ + "Section" + ], + "operationId": "Section_GetMenuDTO", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MenuDTO" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/Section/PlayerMessageDTO": { + "get": { + "tags": [ + "Section" + ], + "operationId": "Section_PlayerMessageDTO", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PlayerMessageDTO" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/Section/QuizzDTO": { + "get": { + "tags": [ + "Section" + ], + "operationId": "Section_GetQuizzDTO", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QuizzDTO" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/User": { + "get": { + "tags": [ + "User" + ], + "operationId": "User_Get", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + }, + "post": { + "tags": [ + "User" + ], + "operationId": "User_CreateUser", + "requestBody": { + "x-name": "newUser", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + }, + "required": true, + "x-position": 1 + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserDetailDTO" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "put": { + "tags": [ + "User" + ], + "operationId": "User_UpdateUser", + "requestBody": { + "x-name": "updatedUser", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + }, + "required": true, + "x-position": 1 + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserDetailDTO" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/User/{id}": { + "get": { + "tags": [ + "User" + ], + "operationId": "User_GetDetail", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "nullable": true + }, + "x-position": 1 + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserDetailDTO" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + }, + "delete": { + "tags": [ + "User" + ], + "operationId": "User_DeleteUser", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "nullable": true + }, + "x-position": 1 + } + ], + "responses": { + "202": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/Authentication/Token": { + "post": { + "tags": [ + "Authentication" + ], + "operationId": "Authentication_AuthenticateWithForm", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "properties": { + "grant_type": { + "type": "string", + "nullable": true + }, + "username": { + "type": "string", + "nullable": true + }, + "password": { + "type": "string", + "nullable": true + }, + "client_id": { + "type": "string", + "nullable": true + }, + "client_secret": { + "type": "string", + "nullable": true + } + } + } + } + } + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TokenDTO" + } + } + } + }, + "401": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/api/Authentication/Authenticate": { + "post": { + "tags": [ + "Authentication" + ], + "operationId": "Authentication_AuthenticateWithJson", + "requestBody": { + "x-name": "login", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoginDTO" + } + } + }, + "required": true, + "x-position": 1 + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TokenDTO" + } + } + } + }, + "401": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ConfigurationDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "string", + "nullable": true + }, + "label": { + "type": "string", + "nullable": true + }, + "primaryColor": { + "type": "string", + "nullable": true + }, + "secondaryColor": { + "type": "string", + "nullable": true + }, + "languages": { + "type": "array", + "nullable": true, + "items": { + "type": "string" + } + }, + "dateCreation": { + "type": "string", + "format": "date-time" + } + } + }, + "ExportConfigurationDTO": { + "allOf": [ + { + "$ref": "#/components/schemas/ConfigurationDTO" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "sections": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/SectionDTO" + } + }, + "resources": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/ResourceDTO" + } + } + } + } + ] + }, + "SectionDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "string", + "nullable": true + }, + "label": { + "type": "string", + "nullable": true + }, + "title": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/TranslationDTO" + } + }, + "description": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/TranslationDTO" + } + }, + "imageId": { + "type": "string", + "nullable": true + }, + "imageSource": { + "type": "string", + "nullable": true + }, + "configurationId": { + "type": "string", + "nullable": true + }, + "isSubSection": { + "type": "boolean" + }, + "parentId": { + "type": "string", + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/SectionType" + }, + "data": { + "type": "string", + "nullable": true + }, + "dateCreation": { + "type": "string", + "format": "date-time" + }, + "order": { + "type": "integer", + "format": "int32" + } + } + }, + "TranslationDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "language": { + "type": "string", + "nullable": true + }, + "value": { + "type": "string", + "nullable": true + } + } + }, + "SectionType": { + "type": "string", + "description": "", + "x-enumNames": [ + "Map", + "Slider", + "Video", + "Web", + "Menu", + "Quizz" + ], + "enum": [ + "Map", + "Slider", + "Video", + "Web", + "Menu", + "Quizz" + ] + }, + "ResourceDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "string", + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/ResourceType" + }, + "label": { + "type": "string", + "nullable": true + }, + "dateCreation": { + "type": "string", + "format": "date-time" + }, + "data": { + "type": "string", + "nullable": true + } + } + }, + "ResourceType": { + "type": "string", + "description": "", + "x-enumNames": [ + "Image", + "Video", + "ImageUrl", + "VideoUrl" + ], + "enum": [ + "Image", + "Video", + "ImageUrl", + "VideoUrl" + ] + }, + "DeviceDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "string", + "nullable": true + }, + "identifier": { + "type": "string", + "nullable": true + }, + "name": { + "type": "string", + "nullable": true + }, + "ipAddressWLAN": { + "type": "string", + "nullable": true + }, + "ipAddressETH": { + "type": "string", + "nullable": true + }, + "configurationId": { + "type": "string", + "nullable": true + }, + "configuration": { + "type": "string", + "nullable": true + }, + "connected": { + "type": "boolean" + }, + "dateCreation": { + "type": "string", + "format": "date-time" + }, + "dateUpdate": { + "type": "string", + "format": "date-time" + } + } + }, + "DeviceDetailDTO": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceDTO" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "connectionLevel": { + "type": "string", + "nullable": true + }, + "lastConnectionLevel": { + "type": "string", + "format": "date-time" + }, + "batteryLevel": { + "type": "string", + "nullable": true + }, + "lastBatteryLevel": { + "type": "string", + "format": "date-time" + } + } + } + ] + }, + "MapDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "zoom": { + "type": "integer", + "format": "int32" + }, + "mapType": { + "$ref": "#/components/schemas/MapTypeApp" + }, + "points": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/GeoPointDTO" + } + }, + "iconResourceId": { + "type": "string", + "nullable": true + }, + "iconSource": { + "type": "string", + "nullable": true + } + } + }, + "MapTypeApp": { + "type": "string", + "description": "", + "x-enumNames": [ + "none", + "normal", + "satellite", + "terrain", + "hybrid" + ], + "enum": [ + "none", + "normal", + "satellite", + "terrain", + "hybrid" + ] + }, + "GeoPointDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "title": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/TranslationDTO" + } + }, + "description": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/TranslationDTO" + } + }, + "images": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/ImageGeoPoint" + } + }, + "latitude": { + "type": "string", + "nullable": true + }, + "longitude": { + "type": "string", + "nullable": true + } + } + }, + "ImageGeoPoint": { + "type": "object", + "additionalProperties": false, + "properties": { + "imageResourceId": { + "type": "string", + "nullable": true + }, + "imageSource": { + "type": "string", + "nullable": true + } + } + }, + "SliderDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "images": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/ImageDTO" + } + } + } + }, + "ImageDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "title": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/TranslationDTO" + } + }, + "description": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/TranslationDTO" + } + }, + "resourceId": { + "type": "string", + "nullable": true + }, + "source": { + "type": "string", + "nullable": true + }, + "order": { + "type": "integer", + "format": "int32" + } + } + }, + "VideoDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "source": { + "type": "string", + "nullable": true + } + } + }, + "WebDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "source": { + "type": "string", + "nullable": true + } + } + }, + "MenuDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "sections": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/SectionDTO" + } + } + } + }, + "PlayerMessageDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "configChanged": { + "type": "boolean" + }, + "isDeleted": { + "type": "boolean" + } + } + }, + "QuizzDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "questions": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/QuestionDTO" + } + }, + "bad_level": { + "nullable": true, + "oneOf": [ + { + "$ref": "#/components/schemas/LevelDTO" + } + ] + }, + "medium_level": { + "nullable": true, + "oneOf": [ + { + "$ref": "#/components/schemas/LevelDTO" + } + ] + }, + "good_level": { + "nullable": true, + "oneOf": [ + { + "$ref": "#/components/schemas/LevelDTO" + } + ] + }, + "great_level": { + "nullable": true, + "oneOf": [ + { + "$ref": "#/components/schemas/LevelDTO" + } + ] + } + } + }, + "QuestionDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "label": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/TranslationDTO" + } + }, + "responses": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/ResponseDTO" + } + }, + "resourceId": { + "type": "string", + "nullable": true + }, + "source": { + "type": "string", + "nullable": true + }, + "order": { + "type": "integer", + "format": "int32" + } + } + }, + "ResponseDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "label": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/TranslationDTO" + } + }, + "isGood": { + "type": "boolean" + }, + "order": { + "type": "integer", + "format": "int32" + } + } + }, + "LevelDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "label": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/TranslationDTO" + } + }, + "resourceId": { + "type": "string", + "nullable": true + }, + "source": { + "type": "string", + "nullable": true + } + } + }, + "User": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "string", + "nullable": true + }, + "email": { + "type": "string", + "nullable": true + }, + "password": { + "type": "string", + "nullable": true + }, + "firstName": { + "type": "string", + "nullable": true + }, + "lastName": { + "type": "string", + "nullable": true + }, + "token": { + "type": "string", + "nullable": true + }, + "dateCreation": { + "type": "string", + "format": "date-time" + } + } + }, + "UserDetailDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "string", + "nullable": true + }, + "email": { + "type": "string", + "nullable": true + }, + "firstName": { + "type": "string", + "nullable": true + }, + "lastName": { + "type": "string", + "nullable": true + } + } + }, + "TokenDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "access_token": { + "type": "string", + "nullable": true + }, + "refresh_token": { + "type": "string", + "nullable": true + }, + "scope": { + "type": "string", + "nullable": true + }, + "token_type": { + "type": "string", + "nullable": true + }, + "expires_in": { + "type": "integer", + "format": "int32" + }, + "expiration": { + "type": "string", + "format": "date-time" + } + } + }, + "LoginDTO": { + "type": "object", + "additionalProperties": false, + "properties": { + "email": { + "type": "string", + "nullable": true + }, + "password": { + "type": "string", + "nullable": true + } + } + } + }, + "securitySchemes": { + "bearer": { + "type": "oauth2", + "description": "Manager Authentication", + "flows": { + "password": { + "authorizationUrl": "/authentication/Token", + "tokenUrl": "/api/authentication/Token", + "scopes": { + "Manager-api": "Manager WebAPI" + } + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ], + "tags": [ + { + "name": "Configuration", + "description": "Configuration management" + }, + { + "name": "Device", + "description": "Device management" + }, + { + "name": "Resource", + "description": "Resource management" + }, + { + "name": "Section", + "description": "Section management" + }, + { + "name": "User", + "description": "User management" + }, + { + "name": "Authentication", + "description": "Authentication management" + } + ] +} \ No newline at end of file diff --git a/manager_api/swagger.yaml.bak b/manager_api/swagger.yaml.bak new file mode 100644 index 0000000..7b9e9d2 --- /dev/null +++ b/manager_api/swagger.yaml.bak @@ -0,0 +1,1885 @@ +x-generator: NSwag v13.10.8.0 (NJsonSchema v10.3.11.0 (Newtonsoft.Json v10.0.0.0)) +openapi: 3.0.0 +info: + title: Manager Service + description: API Manager Service + version: Version Alpha +servers: + - url: http://localhost:5000 +paths: + /api/Configuration: + get: + tags: + - Configuration + operationId: Configuration_Get + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ConfigurationDTO' + '500': + description: '' + content: + application/json: + schema: + type: string + post: + tags: + - Configuration + operationId: Configuration_Create + requestBody: + x-name: newConfiguration + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigurationDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigurationDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + put: + tags: + - Configuration + operationId: Configuration_Update + requestBody: + x-name: updatedConfiguration + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigurationDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigurationDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Configuration/{id}: + get: + tags: + - Configuration + operationId: Configuration_GetDetail + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigurationDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + delete: + tags: + - Configuration + operationId: Configuration_Delete + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Configuration/{id}/export: + get: + tags: + - Configuration + operationId: Configuration_Export + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ExportConfigurationDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Configuration/import: + post: + tags: + - Configuration + operationId: Configuration_Import + requestBody: + x-name: exportConfiguration + content: + application/json: + schema: + $ref: '#/components/schemas/ExportConfigurationDTO' + required: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Device: + get: + tags: + - Device + operationId: Device_Get + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DeviceDTO' + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + post: + tags: + - Device + operationId: Device_Create + requestBody: + x-name: newDevice + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + put: + tags: + - Device + operationId: Device_Update + requestBody: + x-name: updatedDevice + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Device/{id}/detail: + get: + tags: + - Device + operationId: Device_GetDetail + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + /api/Device/mainInfos: + put: + tags: + - Device + operationId: Device_UpdateMainInfos + requestBody: + x-name: deviceIn + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Device/{id}: + delete: + tags: + - Device + operationId: Device_Delete + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Resource: + get: + tags: + - Resource + operationId: Resource_Get + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ResourceDTO' + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + post: + tags: + - Resource + operationId: Resource_Create + requestBody: + x-name: newResource + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + put: + tags: + - Resource + operationId: Resource_Update + requestBody: + x-name: updatedResource + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Resource/{id}/detail: + get: + tags: + - Resource + operationId: Resource_GetDetail + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + /api/Resource/{id}: + get: + tags: + - Resource + operationId: Resource_Show + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + delete: + tags: + - Resource + operationId: Resource_Delete + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Resource/upload: + post: + tags: + - Resource + operationId: Resource_Upload + requestBody: + content: + multipart/form-data: + schema: + properties: + label: + type: string + nullable: true + type: + type: string + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Section: + get: + tags: + - Section + operationId: Section_Get + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SectionDTO' + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + post: + tags: + - Section + operationId: Section_Create + requestBody: + x-name: newSection + content: + application/json: + schema: + $ref: '#/components/schemas/SectionDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/SectionDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + put: + tags: + - Section + operationId: Section_Update + requestBody: + x-name: updatedSection + content: + application/json: + schema: + $ref: '#/components/schemas/SectionDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/SectionDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Section/configuration/{id}: + get: + tags: + - Section + operationId: Section_GetFromConfiguration + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SectionDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + delete: + tags: + - Section + operationId: Section_DeleteAllForConfiguration + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Section/{id}/subsections: + get: + tags: + - Section + operationId: Section_GetAllSectionSubSections + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: {} + '400': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Section/{id}: + get: + tags: + - Section + operationId: Section_GetDetail + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/SectionDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + delete: + tags: + - Section + operationId: Section_Delete + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Section/order: + put: + tags: + - Section + operationId: Section_UpdateOrder + requestBody: + x-name: updatedSectionsOrder + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SectionDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Section/MapDTO: + get: + tags: + - Section + operationId: Section_GetMapDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/MapDTO' + security: + - bearer: [] + /api/Section/SliderDTO: + get: + tags: + - Section + operationId: Section_GetSliderDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/SliderDTO' + security: + - bearer: [] + /api/Section/VideoDTO: + get: + tags: + - Section + operationId: Section_GetVideoDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/VideoDTO' + security: + - bearer: [] + /api/Section/WebDTO: + get: + tags: + - Section + operationId: Section_GetWebDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/WebDTO' + security: + - bearer: [] + /api/Section/MenuDTO: + get: + tags: + - Section + operationId: Section_GetMenuDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/MenuDTO' + security: + - bearer: [] + /api/Section/PlayerMessageDTO: + get: + tags: + - Section + operationId: Section_PlayerMessageDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/PlayerMessageDTO' + security: + - bearer: [] + /api/Section/QuizzDTO: + get: + tags: + - Section + operationId: Section_GetQuizzDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/QuizzDTO' + security: + - bearer: [] + /api/User: + get: + tags: + - User + operationId: User_Get + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + post: + tags: + - User + operationId: User_CreateUser + requestBody: + x-name: newUser + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/UserDetailDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + put: + tags: + - User + operationId: User_UpdateUser + requestBody: + x-name: updatedUser + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/UserDetailDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/User/{id}: + get: + tags: + - User + operationId: User_GetDetail + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/UserDetailDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + delete: + tags: + - User + operationId: User_DeleteUser + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Authentication/Token: + post: + tags: + - Authentication + operationId: Authentication_AuthenticateWithForm + requestBody: + content: + multipart/form-data: + schema: + properties: + grant_type: + type: string + nullable: true + username: + type: string + nullable: true + password: + type: string + nullable: true + client_id: + type: string + nullable: true + client_secret: + type: string + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/TokenDTO' + '401': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + /api/Authentication/Authenticate: + post: + tags: + - Authentication + operationId: Authentication_AuthenticateWithJson + requestBody: + x-name: login + content: + application/json: + schema: + $ref: '#/components/schemas/LoginDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/TokenDTO' + '401': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string +components: + schemas: + ConfigurationDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + label: + type: string + nullable: true + primaryColor: + type: string + nullable: true + secondaryColor: + type: string + nullable: true + languages: + type: array + nullable: true + items: + type: string + dateCreation: + type: string + format: date-time + ExportConfigurationDTO: + allOf: + - $ref: '#/components/schemas/ConfigurationDTO' + - type: object + additionalProperties: false + properties: + sections: + type: array + nullable: true + items: + $ref: '#/components/schemas/SectionDTO' + resources: + type: array + nullable: true + items: + $ref: '#/components/schemas/ResourceDTO' + SectionDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + label: + type: string + nullable: true + title: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + description: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + imageId: + type: string + nullable: true + imageSource: + type: string + nullable: true + configurationId: + type: string + nullable: true + isSubSection: + type: boolean + parentId: + type: string + nullable: true + type: + $ref: '#/components/schemas/SectionType' + data: + type: string + nullable: true + dateCreation: + type: string + format: date-time + order: + type: integer + format: int32 + TranslationDTO: + type: object + additionalProperties: false + properties: + language: + type: string + nullable: true + value: + type: string + nullable: true + SectionType: + type: string + description: '' + x-enumNames: + - Map + - Slider + - Video + - Web + - Menu + - Quizz + enum: + - Map + - Slider + - Video + - Web + - Menu + - Quizz + ResourceDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + type: + $ref: '#/components/schemas/ResourceType' + label: + type: string + nullable: true + dateCreation: + type: string + format: date-time + data: + type: string + nullable: true + ResourceType: + type: string + description: '' + x-enumNames: + - Image + - Video + - ImageUrl + - VideoUrl + enum: + - Image + - Video + - ImageUrl + - VideoUrl + DeviceDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + identifier: + type: string + nullable: true + name: + type: string + nullable: true + ipAddressWLAN: + type: string + nullable: true + ipAddressETH: + type: string + nullable: true + configurationId: + type: string + nullable: true + configuration: + type: string + nullable: true + connected: + type: boolean + dateCreation: + type: string + format: date-time + dateUpdate: + type: string + format: date-time + DeviceDetailDTO: + allOf: + - $ref: '#/components/schemas/DeviceDTO' + - type: object + additionalProperties: false + properties: + connectionLevel: + type: string + nullable: true + lastConnectionLevel: + type: string + format: date-time + batteryLevel: + type: string + nullable: true + lastBatteryLevel: + type: string + format: date-time + MapDTO: + type: object + additionalProperties: false + properties: + zoom: + type: integer + format: int32 + mapType: + $ref: '#/components/schemas/MapTypeApp' + points: + type: array + nullable: true + items: + $ref: '#/components/schemas/GeoPointDTO' + iconResourceId: + type: string + nullable: true + iconSource: + type: string + nullable: true + MapTypeApp: + type: string + description: '' + x-enumNames: + - none + - normal + - satellite + - terrain + - hybrid + enum: + - none + - normal + - satellite + - terrain + - hybrid + GeoPointDTO: + type: object + additionalProperties: false + properties: + id: + type: integer + format: int32 + title: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + description: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + images: + type: array + nullable: true + items: + $ref: '#/components/schemas/ImageGeoPoint' + latitude: + type: string + nullable: true + longitude: + type: string + nullable: true + ImageGeoPoint: + type: object + additionalProperties: false + properties: + imageResourceId: + type: string + nullable: true + imageSource: + type: string + nullable: true + SliderDTO: + type: object + additionalProperties: false + properties: + images: + type: array + nullable: true + items: + $ref: '#/components/schemas/ImageDTO' + ImageDTO: + type: object + additionalProperties: false + properties: + title: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + description: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + resourceId: + type: string + nullable: true + source: + type: string + nullable: true + order: + type: integer + format: int32 + VideoDTO: + type: object + additionalProperties: false + properties: + source: + type: string + nullable: true + WebDTO: + type: object + additionalProperties: false + properties: + source: + type: string + nullable: true + MenuDTO: + type: object + additionalProperties: false + properties: + sections: + type: array + nullable: true + items: + $ref: '#/components/schemas/SectionDTO' + PlayerMessageDTO: + type: object + additionalProperties: false + properties: + configChanged: + type: boolean + isDeleted: + type: boolean + QuizzDTO: + type: object + additionalProperties: false + properties: + questions: + type: array + nullable: true + items: + $ref: '#/components/schemas/QuestionDTO' + bad_level: + nullable: true + oneOf: + - $ref: '#/components/schemas/LevelDTO' + medium_level: + nullable: true + oneOf: + - $ref: '#/components/schemas/LevelDTO' + good_level: + nullable: true + oneOf: + - $ref: '#/components/schemas/LevelDTO' + great_level: + nullable: true + oneOf: + - $ref: '#/components/schemas/LevelDTO' + QuestionDTO: + type: object + additionalProperties: false + properties: + label: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + responses: + type: array + nullable: true + items: + $ref: '#/components/schemas/ResponseDTO' + resourceId: + type: string + nullable: true + source: + type: string + nullable: true + order: + type: integer + format: int32 + ResponseDTO: + type: object + additionalProperties: false + properties: + label: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + isGood: + type: boolean + LevelDTO: + type: object + additionalProperties: false + properties: + label: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + resourceId: + type: string + nullable: true + source: + type: string + nullable: true + User: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + email: + type: string + nullable: true + password: + type: string + nullable: true + firstName: + type: string + nullable: true + lastName: + type: string + nullable: true + token: + type: string + nullable: true + dateCreation: + type: string + format: date-time + UserDetailDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + email: + type: string + nullable: true + firstName: + type: string + nullable: true + lastName: + type: string + nullable: true + TokenDTO: + type: object + additionalProperties: false + properties: + access_token: + type: string + nullable: true + refresh_token: + type: string + nullable: true + scope: + type: string + nullable: true + token_type: + type: string + nullable: true + expires_in: + type: integer + format: int32 + expiration: + type: string + format: date-time + LoginDTO: + type: object + additionalProperties: false + properties: + email: + type: string + nullable: true + password: + type: string + nullable: true + securitySchemes: + bearer: + type: oauth2 + description: Manager Authentication + flows: + password: + authorizationUrl: /authentication/Token + tokenUrl: /api/authentication/Token + scopes: + Manager-api: Manager WebAPI +security: + - bearer: [] +tags: + - name: Configuration + description: Configuration management + - name: Device + description: Device management + - name: Resource + description: Resource management + - name: Section + description: Section management + - name: User + description: User management + - name: Authentication + description: Authentication management diff --git a/manager_api/test/level_dto_test.dart b/manager_api/test/level_dto_test.dart new file mode 100644 index 0000000..9120f3b --- /dev/null +++ b/manager_api/test/level_dto_test.dart @@ -0,0 +1,36 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for LevelDTO +void main() { + final instance = LevelDTO(); + + group('test LevelDTO', () { + // List label (default value: const []) + test('to test the property `label`', () async { + // TODO + }); + + // String resourceId + test('to test the property `resourceId`', () async { + // TODO + }); + + // String source_ + test('to test the property `source_`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api/test/question_dto_test.dart b/manager_api/test/question_dto_test.dart new file mode 100644 index 0000000..c258fb0 --- /dev/null +++ b/manager_api/test/question_dto_test.dart @@ -0,0 +1,41 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for QuestionDTO +void main() { + final instance = QuestionDTO(); + + group('test QuestionDTO', () { + // List label (default value: const []) + test('to test the property `label`', () async { + // TODO + }); + + // List responses (default value: const []) + test('to test the property `responses`', () async { + // TODO + }); + + // String resourceId + test('to test the property `resourceId`', () async { + // TODO + }); + + // String source_ + test('to test the property `source_`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api/test/quizz_dto_test.dart b/manager_api/test/quizz_dto_test.dart new file mode 100644 index 0000000..e30067d --- /dev/null +++ b/manager_api/test/quizz_dto_test.dart @@ -0,0 +1,46 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for QuizzDTO +void main() { + final instance = QuizzDTO(); + + group('test QuizzDTO', () { + // List questions (default value: const []) + test('to test the property `questions`', () async { + // TODO + }); + + // OneOfLevelDTO badLevel + test('to test the property `badLevel`', () async { + // TODO + }); + + // OneOfLevelDTO mediumLevel + test('to test the property `mediumLevel`', () async { + // TODO + }); + + // OneOfLevelDTO goodLevel + test('to test the property `goodLevel`', () async { + // TODO + }); + + // OneOfLevelDTO greatLevel + test('to test the property `greatLevel`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api/test/response_dto_test.dart b/manager_api/test/response_dto_test.dart new file mode 100644 index 0000000..6bc06d4 --- /dev/null +++ b/manager_api/test/response_dto_test.dart @@ -0,0 +1,31 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:managerapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ResponseDTO +void main() { + final instance = ResponseDTO(); + + group('test ResponseDTO', () { + // List label (default value: const []) + test('to test the property `label`', () async { + // TODO + }); + + // bool isGood + test('to test the property `isGood`', () async { + // TODO + }); + + + }); + +} diff --git a/pubspec.lock b/pubspec.lock index bb18f7c..be283af 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -198,6 +198,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" material_segmented_control: dependency: "direct main" description: @@ -314,7 +321,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.3" + version: "0.4.8" typed_data: dependency: transitive description: @@ -328,7 +335,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" video_player: dependency: "direct main" description: @@ -351,5 +358,5 @@ packages: source: hosted version: "2.0.3" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.14.0 <3.0.0" flutter: ">=2.0.0"