diff --git a/lib/Models/ResponseSubDTO.dart b/lib/Models/ResponseSubDTO.dart new file mode 100644 index 0000000..d29a2ed --- /dev/null +++ b/lib/Models/ResponseSubDTO.dart @@ -0,0 +1,54 @@ +import 'package:managerapi/api.dart'; + +class ResponseSubDTO { + List label; + bool isGood; + int order; + + ResponseSubDTO({this.label, this.isGood, this.order}); + + + //ResponseSubDTO(List label, bool isGood, int order) : super(); + + List fromJSON(List responsesDTO) { + List responsesSubDTO = []; + for(ResponseDTO responseDTO in responsesDTO) + { + responsesSubDTO.add(new ResponseSubDTO( + label: responseDTO.label, + isGood: responseDTO.isGood, + order: responseDTO.order, + )); + } + return responsesSubDTO; + } +} + +class QuestionSubDTO { + List label; + List responsesSubDTO; + int chosen; + String resourceId; + String source_; + int order; + + QuestionSubDTO({this.label, this.responsesSubDTO, this.chosen, this.resourceId, this.source_, this.order}); + + List fromJSON(List questionsDTO) { + List questionSubDTO = []; + for(QuestionDTO questionDTO in questionsDTO) + { + questionSubDTO.add(new QuestionSubDTO( + chosen: null, + label: questionDTO.label, + responsesSubDTO: ResponseSubDTO().fromJSON(questionDTO.responses), + resourceId: questionDTO.resourceId, + source_: questionDTO.source_, + order: questionDTO.order, + )); + } + return questionSubDTO; + } +} + + diff --git a/lib/Screens/MainView/main_view.dart b/lib/Screens/MainView/main_view.dart index 03bf90d..984bfd6 100644 --- a/lib/Screens/MainView/main_view.dart +++ b/lib/Screens/MainView/main_view.dart @@ -18,6 +18,7 @@ import 'package:tablet_app/app_context.dart'; import 'package:tablet_app/constants.dart'; import 'package:auto_size_text/auto_size_text.dart'; +import '../Quizz/quizz_view.dart'; import 'language_selection.dart'; class MainViewWidget extends StatefulWidget { @@ -72,8 +73,11 @@ class _MainViewWidget extends State { case SectionType.menu : elementToShow = MenuViewWidget(section: sectionSelected); break; + case SectionType.quizz : + elementToShow = QuizzViewWidget(section: sectionSelected); + break; default: - elementToShow = Text('Hellow default'); + elementToShow = Text("Ce type n'est pas supporté"); break; } return Scaffold( diff --git a/lib/Screens/Quizz/quizz_view.dart b/lib/Screens/Quizz/quizz_view.dart new file mode 100644 index 0000000..175eb17 --- /dev/null +++ b/lib/Screens/Quizz/quizz_view.dart @@ -0,0 +1,430 @@ +import 'dart:convert'; +import 'dart:math'; +import 'package:carousel_slider/carousel_slider.dart'; +import 'package:confetti/confetti.dart'; +import 'package:flutter/gestures.dart'; +import 'package:flutter/material.dart'; +import 'package:fluttertoast/fluttertoast.dart'; +import 'package:managerapi/api.dart'; +import 'package:provider/provider.dart'; +import 'package:tablet_app/Models/ResponseSubDTO.dart'; +import 'package:tablet_app/app_context.dart'; +import 'package:tablet_app/constants.dart'; + + +class QuizzViewWidget extends StatefulWidget { + final SectionDTO section; + GlobalKey key; + QuizzViewWidget({this.section, this.key}); + + @override + _QuizzViewWidget createState() => _QuizzViewWidget(); +} + +class _QuizzViewWidget extends State { + ConfettiController _controllerCenter; + QuizzDTO quizzDTO; + List _questionsSubDTO = []; + CarouselController sliderController; + int currentIndex = 1; + bool showResult = false; + + @override + void initState() { + super.initState(); + + _controllerCenter = ConfettiController(duration: const Duration(seconds: 10)); + + sliderController = CarouselController(); + quizzDTO = QuizzDTO.fromJson(jsonDecode(widget.section.data)); + + quizzDTO.questions.sort((a, b) => a.order.compareTo(b.order)); + _questionsSubDTO = QuestionSubDTO().fromJSON(quizzDTO.questions); + + _controllerCenter.play(); + + } + + @override + void dispose() { + sliderController = null; + _controllerCenter.dispose(); + _questionsSubDTO = QuestionSubDTO().fromJSON(quizzDTO.questions); + super.dispose(); + } + + /// A custom Path to paint stars. + Path drawStar(Size size) { + // Method to convert degree to radians + double degToRad(double deg) => deg * (pi / 180.0); + + const numberOfPoints = 5; + final halfWidth = size.width / 2; + final externalRadius = halfWidth; + final internalRadius = halfWidth / 2.5; + final degreesPerStep = degToRad(360 / numberOfPoints); + final halfDegreesPerStep = degreesPerStep / 2; + /*final path = Path(); + final fullAngle = degToRad(360); + path.moveTo(size.width, halfWidth); + + for (double step = 0; step < fullAngle; step += degreesPerStep) { + path.lineTo(halfWidth + externalRadius * cos(step), + halfWidth + externalRadius * sin(step)); + path.lineTo(halfWidth + internalRadius * cos(step + halfDegreesPerStep), + halfWidth + internalRadius * sin(step + halfDegreesPerStep)); + }*/ + + var path = Path(); + path.lineTo(size.width * 0.57, size.height); + path.cubicTo(size.width * 0.56, size.height, size.width * 0.53, size.height * 0.97, size.width * 0.51, size.height * 0.96); + path.cubicTo(size.width * 0.49, size.height * 0.94, size.width * 0.47, size.height * 0.89, size.width * 0.47, size.height * 0.85); + path.cubicTo(size.width * 0.47, size.height * 0.85, size.width * 0.46, size.height * 0.84, size.width * 0.46, size.height * 0.84); + path.cubicTo(size.width * 0.46, size.height * 0.84, size.width * 0.44, size.height * 0.85, size.width * 0.44, size.height * 0.85); + path.cubicTo(size.width * 0.4, size.height * 0.88, size.width * 0.38, size.height * 0.89, size.width * 0.34, size.height * 0.91); + path.cubicTo(size.width * 0.28, size.height * 0.93, size.width * 0.22, size.height * 0.94, size.width * 0.15, size.height * 0.93); + path.cubicTo(size.width * 0.11, size.height * 0.93, size.width * 0.09, size.height * 0.93, size.width * 0.07, size.height * 0.93); + path.cubicTo(size.width * 0.02, size.height * 0.92, size.width * 0.02, size.height * 0.91, size.width * 0.03, size.height * 0.89); + path.cubicTo(size.width * 0.05, size.height * 0.84, size.width * 0.09, size.height * 0.79, size.width * 0.15, size.height * 0.76); + path.cubicTo(size.width * 0.17, size.height * 0.75, size.width * 0.19, size.height * 0.74, size.width / 5, size.height * 0.74); + path.cubicTo(size.width * 0.22, size.height * 0.73, size.width * 0.22, size.height * 0.73, size.width * 0.22, size.height * 0.73); + path.cubicTo(size.width * 0.22, size.height * 0.73, size.width * 0.22, size.height * 0.73, size.width * 0.22, size.height * 0.73); + path.cubicTo(size.width / 5, size.height * 0.73, size.width * 0.16, size.height * 0.71, size.width * 0.14, size.height * 0.7); + path.cubicTo(size.width * 0.13, size.height * 0.7, size.width * 0.12, size.height * 0.69, size.width * 0.11, size.height * 0.69); + path.cubicTo(size.width * 0.1, size.height * 0.68, size.width * 0.07, size.height * 0.66, size.width * 0.06, size.height * 0.65); + path.cubicTo(0, size.height * 0.6, -0.01, size.height * 0.54, size.width * 0.02, size.height * 0.45); + path.cubicTo(size.width * 0.03, size.height * 0.4, size.width * 0.06, size.height * 0.35, size.width * 0.1, size.height * 0.29); + path.cubicTo(size.width * 0.13, size.height / 4, size.width * 0.15, size.height * 0.23, size.width * 0.18, size.height * 0.19); + path.cubicTo(size.width * 0.24, size.height * 0.14, size.width * 0.28, size.height * 0.1, size.width * 0.35, size.height * 0.06); + path.cubicTo(size.width * 0.42, size.height * 0.01, size.width * 0.47, 0, size.width * 0.51, 0); + path.cubicTo(size.width * 0.58, size.height * 0.01, size.width * 0.66, size.height * 0.06, size.width * 0.75, size.height * 0.14); + path.cubicTo(size.width * 0.87, size.height * 0.24, size.width * 0.97, size.height * 0.37, size.width, size.height * 0.46); + path.cubicTo(size.width, size.height * 0.52, size.width, size.height * 0.56, size.width * 0.97, size.height * 0.6); + path.cubicTo(size.width * 0.95, size.height * 0.62, size.width * 0.93, size.height * 0.64, size.width * 0.9, size.height * 0.66); + path.cubicTo(size.width * 0.89, size.height * 0.67, size.width * 0.88, size.height * 0.68, size.width * 0.84, size.height * 0.7); + path.cubicTo(size.width * 0.84, size.height * 0.7, size.width * 0.83, size.height * 0.7, size.width * 0.83, size.height * 0.7); + path.cubicTo(size.width * 0.83, size.height * 0.7, size.width * 0.84, size.height * 0.71, size.width * 0.85, size.height * 0.72); + path.cubicTo(size.width * 0.9, size.height * 0.75, size.width * 0.93, size.height * 0.78, size.width * 0.97, size.height * 0.82); + path.cubicTo(size.width * 0.98, size.height * 0.84, size.width, size.height * 0.85, size.width, size.height * 0.85); + path.cubicTo(size.width, size.height * 0.86, size.width * 0.98, size.height * 0.87, size.width * 0.97, size.height * 0.87); + path.cubicTo(size.width * 0.95, size.height * 0.88, size.width * 0.85, size.height * 0.88, size.width * 0.77, size.height * 0.88); + path.cubicTo(size.width * 0.7, size.height * 0.88, size.width * 0.67, size.height * 0.88, size.width * 0.61, size.height * 0.86); + path.cubicTo(size.width * 0.6, size.height * 0.86, size.width * 0.59, size.height * 0.86, size.width * 0.59, size.height * 0.86); + path.cubicTo(size.width * 0.59, size.height * 0.86, size.width * 0.61, size.height * 0.88, size.width * 0.62, size.height * 0.9); + path.cubicTo(size.width * 0.64, size.height * 0.93, size.width * 0.65, size.height * 0.93, size.width * 0.65, size.height * 0.95); + path.cubicTo(size.width * 0.65, size.height * 0.96, size.width * 0.64, size.height * 0.97, size.width * 0.63, size.height * 0.97); + path.cubicTo(size.width * 0.62, size.height * 0.97, size.width * 0.62, size.height * 0.98, size.width * 0.62, size.height * 0.98); + path.cubicTo(size.width * 0.62, size.height, size.width * 0.61, size.height, size.width * 0.6, size.height); + path.cubicTo(size.width * 0.59, size.height, size.width * 0.58, size.height, size.width * 0.57, size.height); + path.cubicTo(size.width * 0.57, size.height, size.width * 0.57, size.height, size.width * 0.57, size.height); + path.lineTo(size.width * 0.58, size.height * 0.94); + path.cubicTo(size.width * 0.58, size.height * 0.94, size.width * 0.58, size.height * 0.94, size.width * 0.58, size.height * 0.93); + path.cubicTo(size.width * 0.57, size.height * 0.93, size.width * 0.54, size.height * 0.89, size.width * 0.54, size.height * 0.88); + path.cubicTo(size.width * 0.53, size.height * 0.88, size.width * 0.53, size.height * 0.88, size.width * 0.54, size.height * 0.89); + path.cubicTo(size.width * 0.55, size.height * 0.91, size.width * 0.56, size.height * 0.93, size.width * 0.57, size.height * 0.94); + path.cubicTo(size.width * 0.58, size.height * 0.94, size.width * 0.58, size.height * 0.94, size.width * 0.58, size.height * 0.94); + path.cubicTo(size.width * 0.58, size.height * 0.94, size.width * 0.58, size.height * 0.94, size.width * 0.58, size.height * 0.94); + path.lineTo(size.width * 0.19, size.height * 0.89); + path.cubicTo(size.width / 4, size.height * 0.89, size.width * 0.3, size.height * 0.88, size.width * 0.34, size.height * 0.86); + path.cubicTo(size.width * 0.39, size.height * 0.84, size.width * 0.43, size.height * 0.8, size.width * 0.45, size.height * 0.77); + path.cubicTo(size.width * 0.46, size.height * 0.76, size.width * 0.46, size.height * 0.75, size.width * 0.45, size.height * 0.75); + path.cubicTo(size.width * 0.44, size.height * 0.75, size.width * 0.37, size.height * 0.75, size.width / 3, size.height * 0.75); + path.cubicTo(size.width * 0.29, size.height * 0.75, size.width * 0.24, size.height * 0.77, size.width / 5, size.height * 0.79); + path.cubicTo(size.width * 0.18, size.height * 0.8, size.width * 0.15, size.height * 0.82, size.width * 0.13, size.height * 0.83); + path.cubicTo(size.width * 0.12, size.height * 0.85, size.width * 0.1, size.height * 0.87, size.width * 0.09, size.height * 0.88); + path.cubicTo(size.width * 0.09, size.height * 0.89, size.width * 0.09, size.height * 0.89, size.width * 0.11, size.height * 0.89); + path.cubicTo(size.width * 0.15, size.height * 0.9, size.width * 0.17, size.height * 0.9, size.width * 0.19, size.height * 0.89); + path.cubicTo(size.width * 0.19, size.height * 0.89, size.width * 0.19, size.height * 0.89, size.width * 0.19, size.height * 0.89); + path.lineTo(size.width * 0.87, size.height * 0.84); + path.cubicTo(size.width * 0.9, size.height * 0.84, size.width * 0.91, size.height * 0.84, size.width * 0.91, size.height * 0.84); + path.cubicTo(size.width * 0.91, size.height * 0.83, size.width * 0.9, size.height * 0.83, size.width * 0.9, size.height * 0.82); + path.cubicTo(size.width * 0.85, size.height * 0.77, size.width * 0.79, size.height * 0.73, size.width * 0.73, size.height * 0.72); + path.cubicTo(size.width * 0.71, size.height * 0.71, size.width * 0.7, size.height * 0.71, size.width * 0.67, size.height * 0.71); + path.cubicTo(size.width * 0.66, size.height * 0.71, size.width * 0.65, size.height * 0.71, size.width * 0.64, size.height * 0.71); + path.cubicTo(size.width * 0.61, size.height * 0.72, size.width * 0.57, size.height * 0.73, size.width * 0.55, size.height * 0.74); + path.cubicTo(size.width * 0.54, size.height * 0.74, size.width * 0.53, size.height * 0.75, size.width * 0.53, size.height * 0.75); + path.cubicTo(size.width * 0.53, size.height * 0.75, size.width * 0.54, size.height * 0.77, size.width * 0.54, size.height * 0.77); + path.cubicTo(size.width * 0.56, size.height * 0.8, size.width * 0.59, size.height * 0.81, size.width * 0.63, size.height * 0.82); + path.cubicTo(size.width * 0.66, size.height * 0.83, size.width * 0.7, size.height * 0.84, size.width * 0.74, size.height * 0.84); + path.cubicTo(size.width * 0.76, size.height * 0.84, size.width * 0.84, size.height * 0.84, size.width * 0.87, size.height * 0.84); + path.cubicTo(size.width * 0.87, size.height * 0.84, size.width * 0.87, size.height * 0.84, size.width * 0.87, size.height * 0.84); + path.lineTo(size.width / 2, size.height * 0.71); + path.cubicTo(size.width / 2, size.height * 0.71, size.width * 0.51, size.height * 0.71, size.width * 0.51, size.height * 0.7); + path.cubicTo(size.width * 0.55, size.height * 0.69, size.width * 0.59, size.height * 0.68, size.width * 0.63, size.height * 0.67); + path.cubicTo(size.width * 0.63, size.height * 0.67, size.width * 0.65, size.height * 0.67, size.width * 0.67, size.height * 0.67); + path.cubicTo(size.width * 0.67, size.height * 0.67, size.width * 0.71, size.height * 0.67, size.width * 0.71, size.height * 0.67); + path.cubicTo(size.width * 0.71, size.height * 0.67, size.width * 0.74, size.height * 0.68, size.width * 0.74, size.height * 0.68); + path.cubicTo(size.width * 0.74, size.height * 0.68, size.width * 0.76, size.height * 0.68, size.width * 0.76, size.height * 0.68); + path.cubicTo(size.width * 0.76, size.height * 0.68, size.width * 0.77, size.height * 0.67, size.width * 0.77, size.height * 0.67); + path.cubicTo(size.width * 0.82, size.height * 0.66, size.width * 0.87, size.height * 0.63, size.width * 0.89, size.height * 0.61); + path.cubicTo(size.width * 0.94, size.height * 0.57, size.width * 0.95, size.height * 0.51, size.width * 0.93, size.height * 0.44); + path.cubicTo(size.width * 0.88, size.height * 0.31, size.width * 0.7, size.height * 0.12, size.width * 0.56, size.height * 0.06); + path.cubicTo(size.width * 0.52, size.height * 0.04, size.width / 2, size.height * 0.04, size.width * 0.47, size.height * 0.05); + path.cubicTo(size.width * 0.4, size.height * 0.06, size.width * 0.29, size.height * 0.14, size.width / 5, size.height * 0.24); + path.cubicTo(size.width * 0.13, size.height / 3, size.width * 0.08, size.height * 0.41, size.width * 0.07, size.height * 0.49); + path.cubicTo(size.width * 0.06, size.height * 0.51, size.width * 0.06, size.height * 0.55, size.width * 0.07, size.height * 0.57); + path.cubicTo(size.width * 0.07, size.height * 0.58, size.width * 0.08, size.height * 0.59, size.width * 0.09, size.height * 0.6); + path.cubicTo(size.width * 0.1, size.height * 0.62, size.width * 0.11, size.height * 0.63, size.width * 0.12, size.height * 0.64); + path.cubicTo(size.width * 0.16, size.height * 0.67, size.width * 0.22, size.height * 0.69, size.width * 0.3, size.height * 0.7); + path.cubicTo(size.width / 3, size.height * 0.7, size.width / 3, size.height * 0.71, size.width * 0.41, size.height * 0.71); + path.cubicTo(size.width * 0.44, size.height * 0.71, size.width * 0.45, size.height * 0.71, size.width * 0.46, size.height * 0.71); + path.cubicTo(size.width * 0.48, size.height * 0.71, size.width * 0.49, size.height * 0.71, size.width / 2, size.height * 0.71); + path.cubicTo(size.width / 2, size.height * 0.71, size.width / 2, size.height * 0.71, size.width / 2, size.height * 0.71); + + return path; + } + + @override + Widget build(BuildContext context) { + Size size = MediaQuery.of(context).size; + final appContext = Provider.of(context); + + if(showResult) + return Column( + children: [ + Center( + child: Container( + width: 250, + height: 250, + color: Colors.green, + child: ConfettiWidget( + confettiController: _controllerCenter, + blastDirectionality: BlastDirectionality + .explosive, // don't specify a direction, blast randomly + shouldLoop: + true, // start again as soon as the animation is finished + colors: const [ + Colors.red, + Colors.pink, + Colors.orange, + Colors.purple + ], // manually specify the colors to be used + createParticlePath: drawStar, // define a custom shape/path. + ), + ), + ), + Text("RESULT TODO"), + ], + ); + else + return Stack( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + if(_questionsSubDTO != null && _questionsSubDTO.length > 0) + CarouselSlider( + carouselController: sliderController, + options: CarouselOptions( + onPageChanged: (int index, CarouselPageChangedReason reason) { + setState(() { + currentIndex = index + 1; + }); + }, + height: MediaQuery.of(context).size.height * 0.8, + enlargeCenterPage: true, + scrollPhysics: NeverScrollableScrollPhysics(), + reverse: false, + ), + items: _questionsSubDTO.map((i) { + return Builder( + builder: (BuildContext context) { + return Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.height, + margin: EdgeInsets.symmetric(horizontal: 5.0), + decoration: BoxDecoration( + color: kBackgroundLight, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(20.0), + image: i.source_ != null ? new DecorationImage( + fit: BoxFit.contain, + opacity: 0.35, + image: new NetworkImage( + i.source_, + ), + ): null, + boxShadow: [ + BoxShadow( + color: kBackgroundSecondGrey, + spreadRadius: 0.5, + blurRadius: 5, + offset: Offset(0, 1.5), // changes position of shadow + ), + ], + ), + child: Column( + //crossAxisAlignment: CrossAxisAlignment.center, + //mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Padding( + padding: const EdgeInsets.all(10.0), + child: Container( + //width: MediaQuery.of(context).size.width *0.65, + height: MediaQuery.of(context).size.height *0.25, + child: Stack( + children: [ + Center( + child: Container( + decoration: BoxDecoration( + color: kBackgroundLight, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(10.0), + boxShadow: [ + BoxShadow( + color: kBackgroundSecondGrey, + spreadRadius: 0.3, + blurRadius: 4, + offset: Offset(0, 2), // changes position of shadow + ), + ], + ), + width: MediaQuery.of(context).size.width *0.65, + height: MediaQuery.of(context).size.height *0.18, + child: Center( + child: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Text(i.label.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.label.firstWhere((translation) => translation.language == appContext.getContext().language).value : "", textAlign: TextAlign.center, style: TextStyle(fontSize: kDescriptionSize)), + ), + ), + ), + ) + ), + ] + ), + ), + ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.05, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.all(10.0), + child: Container( + height: MediaQuery.of(context).size.height * 0.6, + width: MediaQuery.of(context).size.width * 0.72, + //color: Colors.green, + child: Padding( + padding: const EdgeInsets.all(10.0), + child: GridView.builder( + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, + mainAxisExtent: 150, + mainAxisSpacing: 150, + crossAxisSpacing: 150, + ), + itemCount: i.responsesSubDTO.length, + itemBuilder: (BuildContext ctx, index) { + return InkWell( + onTap: () { + setState(() { + i.chosen = index; + if(currentIndex == _questionsSubDTO.length && i.chosen == index) + { + showResult = true; + _controllerCenter.play(); + } + }); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + alignment: Alignment.center, + child: Text(i.responsesSubDTO[index].label.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.responsesSubDTO[index].label.firstWhere((translation) => translation.language == appContext.getContext().language).value : "", textAlign: TextAlign.center, style: TextStyle(fontSize: kDescriptionSize)), + decoration: BoxDecoration( + color: i.chosen == index ? Colors.green : kBackgroundLight, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(10.0), + boxShadow: [ + BoxShadow( + color: kBackgroundSecondGrey, + spreadRadius: 0.3, + blurRadius: 4, + offset: Offset(0, 2), // changes position of shadow + ), + ], + ), + ), + ), + ); + }), + ), + ), + ), + ), + ], + ) + ), + ); + }, + ); + }).toList(), + ), + ], + ), + if(_questionsSubDTO != null && _questionsSubDTO.length > 1 && currentIndex != _questionsSubDTO.length) + Positioned( + top: MediaQuery.of(context).size.height * 0.35, + right: 60, + child: InkWell( + onTap: () { + if(_questionsSubDTO[currentIndex-1].chosen != null && quizzDTO.questions.length > 0) { + sliderController.nextPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn); + } else { + Fluttertoast.showToast( + msg: "Vous n'avez pas répondu à cette question", + toastLength: Toast.LENGTH_SHORT, + gravity: ToastGravity.BOTTOM, + timeInSecForIosWeb: 1, + backgroundColor: kMainRed, + textColor: Colors.white, + fontSize: 35.0 + ); + } + }, + child: Icon( + Icons.chevron_right, + size: 150, + color: kMainRed, + ), + ) + ), + if(_questionsSubDTO != null && _questionsSubDTO.length > 1 && currentIndex != 1) + Positioned( + top: MediaQuery.of(context).size.height * 0.35, + left: 60, + child: InkWell( + onTap: () { + if(currentIndex > 1) + sliderController.previousPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn); + }, + child: Icon( + Icons.chevron_left, + size: 150, + color: kMainRed, + ), + ) + ), + if(_questionsSubDTO != null && _questionsSubDTO.length > 0) + Padding( + padding: const EdgeInsets.only(bottom: 0), + child: Align( + alignment: Alignment.bottomCenter, + child: InkWell( + child: Text( + currentIndex.toString()+'/'+quizzDTO.questions.length.toString(), + style: TextStyle(fontSize: 30, fontWeight: FontWeight.w500), + ), + ) + ), + ), + if(_questionsSubDTO == null || _questionsSubDTO.length == 0) + Center(child: Text("Aucune question à afficher", style: TextStyle(fontSize: kNoneInfoOrIncorrect),)) + ] + ); + } +} \ No newline at end of file diff --git a/manager_api/.openapi-generator/FILES b/manager_api/.openapi-generator/FILES index 5767340..605784e 100644 --- a/manager_api/.openapi-generator/FILES +++ b/manager_api/.openapi-generator/FILES @@ -8,18 +8,23 @@ doc/DeviceApi.md doc/DeviceDTO.md doc/DeviceDetailDTO.md doc/DeviceDetailDTOAllOf.md +doc/ExportConfigurationDTO.md +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/ResourceDetailDTO.md doc/ResourceType.md +doc/ResponseDTO.md doc/SectionApi.md doc/SectionDTO.md doc/SectionType.md @@ -51,17 +56,22 @@ lib/model/configuration_dto.dart lib/model/device_detail_dto.dart lib/model/device_detail_dto_all_of.dart lib/model/device_dto.dart +lib/model/export_configuration_dto.dart +lib/model/export_configuration_dto_all_of.dart lib/model/geo_point_dto.dart lib/model/image_dto.dart lib/model/image_geo_point.dart +lib/model/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/resource_detail_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 @@ -72,3 +82,9 @@ 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 +test/level_dto_test.dart +test/question_dto_test.dart +test/quizz_dto_test.dart +test/response_dto_test.dart diff --git a/manager_api/README.md b/manager_api/README.md index 269c300..c06ab5c 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://192.168.31.140* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- @@ -68,8 +68,10 @@ Class | Method | HTTP request | Description *AuthenticationApi* | [**authenticationAuthenticateWithJson**](doc\/AuthenticationApi.md#authenticationauthenticatewithjson) | **POST** /api/Authentication/Authenticate | *ConfigurationApi* | [**configurationCreate**](doc\/ConfigurationApi.md#configurationcreate) | **POST** /api/Configuration | *ConfigurationApi* | [**configurationDelete**](doc\/ConfigurationApi.md#configurationdelete) | **DELETE** /api/Configuration/{id} | +*ConfigurationApi* | [**configurationExport**](doc\/ConfigurationApi.md#configurationexport) | **GET** /api/Configuration/{id}/export | *ConfigurationApi* | [**configurationGet**](doc\/ConfigurationApi.md#configurationget) | **GET** /api/Configuration | *ConfigurationApi* | [**configurationGetDetail**](doc\/ConfigurationApi.md#configurationgetdetail) | **GET** /api/Configuration/{id} | +*ConfigurationApi* | [**configurationImport**](doc\/ConfigurationApi.md#configurationimport) | **POST** /api/Configuration/import | *ConfigurationApi* | [**configurationUpdate**](doc\/ConfigurationApi.md#configurationupdate) | **PUT** /api/Configuration | *DeviceApi* | [**deviceCreate**](doc\/DeviceApi.md#devicecreate) | **POST** /api/Device | *DeviceApi* | [**deviceDelete**](doc\/DeviceApi.md#devicedelete) | **DELETE** /api/Device/{id} | @@ -93,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 | @@ -112,17 +115,22 @@ Class | Method | HTTP request | Description - [DeviceDTO](doc\/DeviceDTO.md) - [DeviceDetailDTO](doc\/DeviceDetailDTO.md) - [DeviceDetailDTOAllOf](doc\/DeviceDetailDTOAllOf.md) + - [ExportConfigurationDTO](doc\/ExportConfigurationDTO.md) + - [ExportConfigurationDTOAllOf](doc\/ExportConfigurationDTOAllOf.md) - [GeoPointDTO](doc\/GeoPointDTO.md) - [ImageDTO](doc\/ImageDTO.md) - [ImageGeoPoint](doc\/ImageGeoPoint.md) + - [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) - - [ResourceDetailDTO](doc\/ResourceDetailDTO.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..240d621 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://192.168.31.140* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/manager_api/doc/ConfigurationApi.md b/manager_api/doc/ConfigurationApi.md index 7eed9f1..9783da9 100644 --- a/manager_api/doc/ConfigurationApi.md +++ b/manager_api/doc/ConfigurationApi.md @@ -5,14 +5,16 @@ import 'package:managerapi/api.dart'; ``` -All URIs are relative to *http://192.168.31.96* +All URIs are relative to *http://192.168.31.140* Method | HTTP request | Description ------------- | ------------- | ------------- [**configurationCreate**](ConfigurationApi.md#configurationcreate) | **POST** /api/Configuration | [**configurationDelete**](ConfigurationApi.md#configurationdelete) | **DELETE** /api/Configuration/{id} | +[**configurationExport**](ConfigurationApi.md#configurationexport) | **GET** /api/Configuration/{id}/export | [**configurationGet**](ConfigurationApi.md#configurationget) | **GET** /api/Configuration | [**configurationGetDetail**](ConfigurationApi.md#configurationgetdetail) | **GET** /api/Configuration/{id} | +[**configurationImport**](ConfigurationApi.md#configurationimport) | **POST** /api/Configuration/import | [**configurationUpdate**](ConfigurationApi.md#configurationupdate) | **PUT** /api/Configuration | @@ -102,6 +104,49 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **configurationExport** +> ExportConfigurationDTO configurationExport(id) + + + +### 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 = ConfigurationApi(); +final id = id_example; // String | + +try { + final result = api_instance.configurationExport(id); + print(result); +} catch (e) { + print('Exception when calling ConfigurationApi->configurationExport: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +[**ExportConfigurationDTO**](ExportConfigurationDTO.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) + # **configurationGet** > List configurationGet() @@ -184,6 +229,49 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **configurationImport** +> String configurationImport(exportConfigurationDTO) + + + +### 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 = ConfigurationApi(); +final exportConfigurationDTO = ExportConfigurationDTO(); // ExportConfigurationDTO | + +try { + final result = api_instance.configurationImport(exportConfigurationDTO); + print(result); +} catch (e) { + print('Exception when calling ConfigurationApi->configurationImport: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **exportConfigurationDTO** | [**ExportConfigurationDTO**](ExportConfigurationDTO.md)| | + +### Return type + +**String** + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **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) + # **configurationUpdate** > ConfigurationDTO configurationUpdate(configurationDTO) diff --git a/manager_api/doc/DeviceApi.md b/manager_api/doc/DeviceApi.md index 96e70af..da2f466 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://192.168.31.140* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/manager_api/doc/ExportConfigurationDTO.md b/manager_api/doc/ExportConfigurationDTO.md new file mode 100644 index 0000000..7c7c3f9 --- /dev/null +++ b/manager_api/doc/ExportConfigurationDTO.md @@ -0,0 +1,22 @@ +# managerapi.model.ExportConfigurationDTO + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**label** | **String** | | [optional] +**primaryColor** | **String** | | [optional] +**secondaryColor** | **String** | | [optional] +**languages** | **List** | | [optional] [default to const []] +**dateCreation** | [**DateTime**](DateTime.md) | | [optional] +**sections** | [**List**](SectionDTO.md) | | [optional] [default to const []] +**resources** | [**List**](ResourceDTO.md) | | [optional] [default to const []] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api/doc/ExportConfigurationDTOAllOf.md b/manager_api/doc/ExportConfigurationDTOAllOf.md new file mode 100644 index 0000000..e369543 --- /dev/null +++ b/manager_api/doc/ExportConfigurationDTOAllOf.md @@ -0,0 +1,16 @@ +# managerapi.model.ExportConfigurationDTOAllOf + +## Load the model package +```dart +import 'package:managerapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sections** | [**List**](SectionDTO.md) | | [optional] [default to const []] +**resources** | [**List**](ResourceDTO.md) | | [optional] [default to const []] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api/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 c7a88e8..8efbe20 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://192.168.31.140* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -19,7 +19,7 @@ Method | HTTP request | Description # **resourceCreate** -> ResourceDetailDTO resourceCreate(resourceDetailDTO) +> ResourceDTO resourceCreate(resourceDTO) @@ -30,10 +30,10 @@ import 'package:managerapi/api.dart'; //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ResourceApi(); -final resourceDetailDTO = ResourceDetailDTO(); // ResourceDetailDTO | +final resourceDTO = ResourceDTO(); // ResourceDTO | try { - final result = api_instance.resourceCreate(resourceDetailDTO); + final result = api_instance.resourceCreate(resourceDTO); print(result); } catch (e) { print('Exception when calling ResourceApi->resourceCreate: $e\n'); @@ -44,11 +44,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **resourceDetailDTO** | [**ResourceDetailDTO**](ResourceDetailDTO.md)| | + **resourceDTO** | [**ResourceDTO**](ResourceDTO.md)| | ### Return type -[**ResourceDetailDTO**](ResourceDetailDTO.md) +[**ResourceDTO**](ResourceDTO.md) ### Authorization @@ -144,7 +144,7 @@ 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) # **resourceGetDetail** -> ResourceDetailDTO resourceGetDetail(id) +> ResourceDTO resourceGetDetail(id) @@ -173,7 +173,7 @@ Name | Type | Description | Notes ### Return type -[**ResourceDetailDTO**](ResourceDetailDTO.md) +[**ResourceDTO**](ResourceDTO.md) ### Authorization @@ -230,7 +230,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **resourceUpdate** -> ResourceDetailDTO resourceUpdate(resourceDetailDTO) +> ResourceDTO resourceUpdate(resourceDTO) @@ -241,10 +241,10 @@ import 'package:managerapi/api.dart'; //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ResourceApi(); -final resourceDetailDTO = ResourceDetailDTO(); // ResourceDetailDTO | +final resourceDTO = ResourceDTO(); // ResourceDTO | try { - final result = api_instance.resourceUpdate(resourceDetailDTO); + final result = api_instance.resourceUpdate(resourceDTO); print(result); } catch (e) { print('Exception when calling ResourceApi->resourceUpdate: $e\n'); @@ -255,11 +255,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **resourceDetailDTO** | [**ResourceDetailDTO**](ResourceDetailDTO.md)| | + **resourceDTO** | [**ResourceDTO**](ResourceDTO.md)| | ### Return type -[**ResourceDetailDTO**](ResourceDetailDTO.md) +[**ResourceDTO**](ResourceDTO.md) ### Authorization diff --git a/manager_api/doc/ResourceDTO.md b/manager_api/doc/ResourceDTO.md index 91f91a8..d2acd16 100644 --- a/manager_api/doc/ResourceDTO.md +++ b/manager_api/doc/ResourceDTO.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **id** | **String** | | [optional] **type** | [**ResourceType**](ResourceType.md) | | [optional] **label** | **String** | | [optional] +**dateCreation** | [**DateTime**](DateTime.md) | | [optional] **data** | **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/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..0d62dd8 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://192.168.31.140* 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..4f53b8e 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://192.168.31.140* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/manager_api/lib/api.dart b/manager_api/lib/api.dart index ad57cca..942b8c8 100644 --- a/manager_api/lib/api.dart +++ b/manager_api/lib/api.dart @@ -38,17 +38,22 @@ part 'model/configuration_dto.dart'; part 'model/device_dto.dart'; part 'model/device_detail_dto.dart'; part 'model/device_detail_dto_all_of.dart'; +part 'model/export_configuration_dto.dart'; +part 'model/export_configuration_dto_all_of.dart'; part 'model/geo_point_dto.dart'; part 'model/image_dto.dart'; part 'model/image_geo_point.dart'; +part 'model/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_detail_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/configuration_api.dart b/manager_api/lib/api/configuration_api.dart index dfa4bd8..342f0f0 100644 --- a/manager_api/lib/api/configuration_api.dart +++ b/manager_api/lib/api/configuration_api.dart @@ -142,6 +142,70 @@ class ConfigurationApi { return Future.value(null); } + /// Performs an HTTP 'GET /api/Configuration/{id}/export' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + Future configurationExportWithHttpInfo(String id) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + + final path = r'/api/Configuration/{id}/export' + .replaceAll('{' + 'id' + '}', id.toString()); + + 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, + ); + } + + /// Parameters: + /// + /// * [String] id (required): + Future configurationExport(String id) async { + final response = await configurationExportWithHttpInfo(id); + 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), 'ExportConfigurationDTO') as ExportConfigurationDTO; + } + return Future.value(null); + } + /// Performs an HTTP 'GET /api/Configuration' operation and returns the [Response]. Future configurationGetWithHttpInfo() async { final path = r'/api/Configuration'; @@ -260,6 +324,69 @@ class ConfigurationApi { return Future.value(null); } + /// Performs an HTTP 'POST /api/Configuration/import' operation and returns the [Response]. + /// Parameters: + /// + /// * [ExportConfigurationDTO] exportConfigurationDTO (required): + Future configurationImportWithHttpInfo(ExportConfigurationDTO exportConfigurationDTO) async { + // Verify required params are set. + if (exportConfigurationDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: exportConfigurationDTO'); + } + + final path = r'/api/Configuration/import'; + + Object postBody = exportConfigurationDTO; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + 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, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [ExportConfigurationDTO] exportConfigurationDTO (required): + Future configurationImport(ExportConfigurationDTO exportConfigurationDTO) async { + final response = await configurationImportWithHttpInfo(exportConfigurationDTO); + 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), 'String') as String; + } + return Future.value(null); + } + /// Performs an HTTP 'PUT /api/Configuration' operation and returns the [Response]. /// Parameters: /// diff --git a/manager_api/lib/api/resource_api.dart b/manager_api/lib/api/resource_api.dart index 60376c1..6423466 100644 --- a/manager_api/lib/api/resource_api.dart +++ b/manager_api/lib/api/resource_api.dart @@ -18,16 +18,16 @@ class ResourceApi { /// Performs an HTTP 'POST /api/Resource' operation and returns the [Response]. /// Parameters: /// - /// * [ResourceDetailDTO] resourceDetailDTO (required): - Future resourceCreateWithHttpInfo(ResourceDetailDTO resourceDetailDTO) async { + /// * [ResourceDTO] resourceDTO (required): + Future resourceCreateWithHttpInfo(ResourceDTO resourceDTO) async { // Verify required params are set. - if (resourceDetailDTO == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: resourceDetailDTO'); + if (resourceDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: resourceDTO'); } final path = r'/api/Resource'; - Object postBody = resourceDetailDTO; + Object postBody = resourceDTO; final queryParams = []; final headerParams = {}; @@ -63,9 +63,9 @@ class ResourceApi { /// Parameters: /// - /// * [ResourceDetailDTO] resourceDetailDTO (required): - Future resourceCreate(ResourceDetailDTO resourceDetailDTO) async { - final response = await resourceCreateWithHttpInfo(resourceDetailDTO); + /// * [ResourceDTO] resourceDTO (required): + Future resourceCreate(ResourceDTO resourceDTO) async { + final response = await resourceCreateWithHttpInfo(resourceDTO); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } @@ -73,9 +73,9 @@ class ResourceApi { // 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), 'ResourceDetailDTO') as ResourceDetailDTO; + return apiClient.deserialize(_decodeBodyBytes(response), 'ResourceDTO') as ResourceDTO; } - return Future.value(null); + return Future.value(null); } /// Performs an HTTP 'DELETE /api/Resource/{id}' operation and returns the [Response]. @@ -246,7 +246,7 @@ class ResourceApi { /// Parameters: /// /// * [String] id (required): - Future resourceGetDetail(String id) async { + Future resourceGetDetail(String id) async { final response = await resourceGetDetailWithHttpInfo(id); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); @@ -255,9 +255,9 @@ class ResourceApi { // 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), 'ResourceDetailDTO') as ResourceDetailDTO; + return apiClient.deserialize(_decodeBodyBytes(response), 'ResourceDTO') as ResourceDTO; } - return Future.value(null); + return Future.value(null); } /// Performs an HTTP 'GET /api/Resource/{id}' operation and returns the [Response]. @@ -327,16 +327,16 @@ class ResourceApi { /// Performs an HTTP 'PUT /api/Resource' operation and returns the [Response]. /// Parameters: /// - /// * [ResourceDetailDTO] resourceDetailDTO (required): - Future resourceUpdateWithHttpInfo(ResourceDetailDTO resourceDetailDTO) async { + /// * [ResourceDTO] resourceDTO (required): + Future resourceUpdateWithHttpInfo(ResourceDTO resourceDTO) async { // Verify required params are set. - if (resourceDetailDTO == null) { - throw ApiException(HttpStatus.badRequest, 'Missing required param: resourceDetailDTO'); + if (resourceDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: resourceDTO'); } final path = r'/api/Resource'; - Object postBody = resourceDetailDTO; + Object postBody = resourceDTO; final queryParams = []; final headerParams = {}; @@ -372,9 +372,9 @@ class ResourceApi { /// Parameters: /// - /// * [ResourceDetailDTO] resourceDetailDTO (required): - Future resourceUpdate(ResourceDetailDTO resourceDetailDTO) async { - final response = await resourceUpdateWithHttpInfo(resourceDetailDTO); + /// * [ResourceDTO] resourceDTO (required): + Future resourceUpdate(ResourceDTO resourceDTO) async { + final response = await resourceUpdateWithHttpInfo(resourceDTO); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } @@ -382,9 +382,9 @@ class ResourceApi { // 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), 'ResourceDetailDTO') as ResourceDetailDTO; + return apiClient.deserialize(_decodeBodyBytes(response), 'ResourceDTO') as ResourceDTO; } - return Future.value(null); + return Future.value(null); } /// Performs an HTTP 'POST /api/Resource/upload' operation and returns the [Response]. 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 4fe0d20..9b35f8a 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://192.168.31.140'}) { // Setup authentications (key: authentication name, value: authentication). _authentications[r'bearer'] = OAuth(); } @@ -164,12 +164,18 @@ class ApiClient { return DeviceDetailDTO.fromJson(value); case 'DeviceDetailDTOAllOf': return DeviceDetailDTOAllOf.fromJson(value); + case 'ExportConfigurationDTO': + return ExportConfigurationDTO.fromJson(value); + case 'ExportConfigurationDTOAllOf': + return ExportConfigurationDTOAllOf.fromJson(value); case 'GeoPointDTO': return GeoPointDTO.fromJson(value); case 'ImageDTO': return ImageDTO.fromJson(value); case 'ImageGeoPoint': return ImageGeoPoint.fromJson(value); + case 'LevelDTO': + return LevelDTO.fromJson(value); case 'LoginDTO': return LoginDTO.fromJson(value); case 'MapDTO': @@ -181,13 +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 'ResourceDetailDTO': - return ResourceDetailDTO.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/export_configuration_dto.dart b/manager_api/lib/model/export_configuration_dto.dart new file mode 100644 index 0000000..3e2a8a2 --- /dev/null +++ b/manager_api/lib/model/export_configuration_dto.dart @@ -0,0 +1,138 @@ +// +// 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 ExportConfigurationDTO { + /// Returns a new [ExportConfigurationDTO] instance. + ExportConfigurationDTO({ + this.id, + this.label, + this.primaryColor, + this.secondaryColor, + this.languages, + this.dateCreation, + this.sections, + this.resources, + }); + + String id; + + String label; + + String primaryColor; + + String secondaryColor; + + List languages; + + DateTime dateCreation; + + List sections; + + List resources; + + @override + bool operator ==(Object other) => identical(this, other) || other is ExportConfigurationDTO && + other.id == id && + other.label == label && + other.primaryColor == primaryColor && + other.secondaryColor == secondaryColor && + other.languages == languages && + other.dateCreation == dateCreation && + other.sections == sections && + other.resources == resources; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (label == null ? 0 : label.hashCode) + + (primaryColor == null ? 0 : primaryColor.hashCode) + + (secondaryColor == null ? 0 : secondaryColor.hashCode) + + (languages == null ? 0 : languages.hashCode) + + (dateCreation == null ? 0 : dateCreation.hashCode) + + (sections == null ? 0 : sections.hashCode) + + (resources == null ? 0 : resources.hashCode); + + @override + String toString() => 'ExportConfigurationDTO[id=$id, label=$label, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, sections=$sections, resources=$resources]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (label != null) { + json[r'label'] = label; + } + if (primaryColor != null) { + json[r'primaryColor'] = primaryColor; + } + if (secondaryColor != null) { + json[r'secondaryColor'] = secondaryColor; + } + if (languages != null) { + json[r'languages'] = languages; + } + if (dateCreation != null) { + json[r'dateCreation'] = dateCreation.toUtc().toIso8601String(); + } + if (sections != null) { + json[r'sections'] = sections; + } + if (resources != null) { + json[r'resources'] = resources; + } + return json; + } + + /// Returns a new [ExportConfigurationDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static ExportConfigurationDTO fromJson(Map json) => json == null + ? null + : ExportConfigurationDTO( + id: json[r'id'], + label: json[r'label'], + primaryColor: json[r'primaryColor'], + secondaryColor: json[r'secondaryColor'], + languages: json[r'languages'] == null + ? null + : (json[r'languages'] as List).cast(), + dateCreation: json[r'dateCreation'] == null + ? null + : DateTime.parse(json[r'dateCreation']), + sections: SectionDTO.listFromJson(json[r'sections']), + resources: ResourceDTO.listFromJson(json[r'resources']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => ExportConfigurationDTO.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] = ExportConfigurationDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of ExportConfigurationDTO-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] = ExportConfigurationDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/manager_api/lib/model/export_configuration_dto_all_of.dart b/manager_api/lib/model/export_configuration_dto_all_of.dart new file mode 100644 index 0000000..4d93a48 --- /dev/null +++ b/manager_api/lib/model/export_configuration_dto_all_of.dart @@ -0,0 +1,80 @@ +// +// 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 ExportConfigurationDTOAllOf { + /// Returns a new [ExportConfigurationDTOAllOf] instance. + ExportConfigurationDTOAllOf({ + this.sections, + this.resources, + }); + + List sections; + + List resources; + + @override + bool operator ==(Object other) => identical(this, other) || other is ExportConfigurationDTOAllOf && + other.sections == sections && + other.resources == resources; + + @override + int get hashCode => + (sections == null ? 0 : sections.hashCode) + + (resources == null ? 0 : resources.hashCode); + + @override + String toString() => 'ExportConfigurationDTOAllOf[sections=$sections, resources=$resources]'; + + Map toJson() { + final json = {}; + if (sections != null) { + json[r'sections'] = sections; + } + if (resources != null) { + json[r'resources'] = resources; + } + return json; + } + + /// Returns a new [ExportConfigurationDTOAllOf] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static ExportConfigurationDTOAllOf fromJson(Map json) => json == null + ? null + : ExportConfigurationDTOAllOf( + sections: SectionDTO.listFromJson(json[r'sections']), + resources: ResourceDTO.listFromJson(json[r'resources']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => ExportConfigurationDTOAllOf.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] = ExportConfigurationDTOAllOf.fromJson(v)); + } + return map; + } + + // maps a json object with a list of ExportConfigurationDTOAllOf-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] = ExportConfigurationDTOAllOf.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + 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/resource_dto.dart b/manager_api/lib/model/resource_dto.dart index f5d5447..81f6382 100644 --- a/manager_api/lib/model/resource_dto.dart +++ b/manager_api/lib/model/resource_dto.dart @@ -15,6 +15,7 @@ class ResourceDTO { this.id, this.type, this.label, + this.dateCreation, this.data, }); @@ -24,6 +25,8 @@ class ResourceDTO { String label; + DateTime dateCreation; + String data; @override @@ -31,6 +34,7 @@ class ResourceDTO { other.id == id && other.type == type && other.label == label && + other.dateCreation == dateCreation && other.data == data; @override @@ -38,10 +42,11 @@ class ResourceDTO { (id == null ? 0 : id.hashCode) + (type == null ? 0 : type.hashCode) + (label == null ? 0 : label.hashCode) + + (dateCreation == null ? 0 : dateCreation.hashCode) + (data == null ? 0 : data.hashCode); @override - String toString() => 'ResourceDTO[id=$id, type=$type, label=$label, data=$data]'; + String toString() => 'ResourceDTO[id=$id, type=$type, label=$label, dateCreation=$dateCreation, data=$data]'; Map toJson() { final json = {}; @@ -54,6 +59,9 @@ class ResourceDTO { if (label != null) { json[r'label'] = label; } + if (dateCreation != null) { + json[r'dateCreation'] = dateCreation.toUtc().toIso8601String(); + } if (data != null) { json[r'data'] = data; } @@ -68,6 +76,9 @@ class ResourceDTO { id: json[r'id'], type: ResourceType.fromJson(json[r'type']), label: json[r'label'], + dateCreation: json[r'dateCreation'] == null + ? null + : DateTime.parse(json[r'dateCreation']), data: json[r'data'], ); 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 e6e57ee..2d33fae 100644 --- a/manager_api/swagger.yaml +++ b/manager_api/swagger.yaml @@ -5,7 +5,7 @@ info: description: API Manager Service version: Version Alpha servers: - - url: http://192.168.31.96 + - url: http://192.168.31.140 paths: /api/Configuration: get: @@ -176,6 +176,92 @@ paths: 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: @@ -423,7 +509,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ResourceDetailDTO' + $ref: '#/components/schemas/ResourceDTO' required: true x-position: 1 responses: @@ -432,7 +518,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ResourceDetailDTO' + $ref: '#/components/schemas/ResourceDTO' '400': description: '' content: @@ -462,7 +548,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ResourceDetailDTO' + $ref: '#/components/schemas/ResourceDTO' required: true x-position: 1 responses: @@ -471,7 +557,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ResourceDetailDTO' + $ref: '#/components/schemas/ResourceDTO' '400': description: '' content: @@ -511,7 +597,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ResourceDetailDTO' + $ref: '#/components/schemas/ResourceDTO' '404': description: '' content: @@ -1032,6 +1118,20 @@ paths: $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: @@ -1305,103 +1405,22 @@ components: dateCreation: type: string format: date-time - 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: + ExportConfigurationDTO: allOf: - - $ref: '#/components/schemas/DeviceDTO' + - $ref: '#/components/schemas/ConfigurationDTO' - type: object additionalProperties: false properties: - connectionLevel: - type: string + sections: + type: array nullable: true - lastConnectionLevel: - type: string - format: date-time - batteryLevel: - type: string + items: + $ref: '#/components/schemas/SectionDTO' + resources: + type: array nullable: true - lastBatteryLevel: - type: string - format: date-time - ResourceDTO: - type: object - additionalProperties: false - properties: - id: - type: string - nullable: true - type: - $ref: '#/components/schemas/ResourceType' - label: - type: string - nullable: true - data: - type: string - nullable: true - ResourceType: - type: string - description: '' - x-enumNames: - - Image - - Video - - ImageUrl - - VideoUrl - enum: - - Image - - Video - - ImageUrl - - VideoUrl - ResourceDetailDTO: - 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 + items: + $ref: '#/components/schemas/ResourceDTO' SectionDTO: type: object additionalProperties: false @@ -1466,12 +1485,96 @@ components: - 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 @@ -1608,6 +1711,83 @@ components: 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 diff --git a/manager_api/swagger.yaml.bak b/manager_api/swagger.yaml.bak new file mode 100644 index 0000000..e6e57ee --- /dev/null +++ b/manager_api/swagger.yaml.bak @@ -0,0 +1,1708 @@ +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/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/ResourceDetailDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceDetailDTO' + '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/ResourceDetailDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceDetailDTO' + '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/ResourceDetailDTO' + '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 + 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 + ResourceDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + type: + $ref: '#/components/schemas/ResourceType' + label: + type: string + nullable: true + data: + type: string + nullable: true + ResourceType: + type: string + description: '' + x-enumNames: + - Image + - Video + - ImageUrl + - VideoUrl + enum: + - Image + - Video + - ImageUrl + - VideoUrl + ResourceDetailDTO: + 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 + 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 + 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 diff --git a/manager_api/test/export_configuration_dto_all_of_test.dart b/manager_api/test/export_configuration_dto_all_of_test.dart new file mode 100644 index 0000000..b497052 --- /dev/null +++ b/manager_api/test/export_configuration_dto_all_of_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 ExportConfigurationDTOAllOf +void main() { + final instance = ExportConfigurationDTOAllOf(); + + group('test ExportConfigurationDTOAllOf', () { + // List sections (default value: const []) + test('to test the property `sections`', () async { + // TODO + }); + + // List resources (default value: const []) + test('to test the property `resources`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api/test/export_configuration_dto_test.dart b/manager_api/test/export_configuration_dto_test.dart new file mode 100644 index 0000000..adc2fb5 --- /dev/null +++ b/manager_api/test/export_configuration_dto_test.dart @@ -0,0 +1,61 @@ +// +// 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 ExportConfigurationDTO +void main() { + final instance = ExportConfigurationDTO(); + + group('test ExportConfigurationDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String label + test('to test the property `label`', () async { + // TODO + }); + + // String primaryColor + test('to test the property `primaryColor`', () async { + // TODO + }); + + // String secondaryColor + test('to test the property `secondaryColor`', () async { + // TODO + }); + + // List languages (default value: const []) + test('to test the property `languages`', () async { + // TODO + }); + + // DateTime dateCreation + test('to test the property `dateCreation`', () async { + // TODO + }); + + // List sections (default value: const []) + test('to test the property `sections`', () async { + // TODO + }); + + // List resources (default value: const []) + test('to test the property `resources`', () async { + // TODO + }); + + + }); + +} 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..e4e2f99 --- /dev/null +++ b/manager_api/test/question_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 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 + }); + + // int order + test('to test the property `order`', () 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..e96de00 --- /dev/null +++ b/manager_api/test/response_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 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 + }); + + // int order + test('to test the property `order`', () async { + // TODO + }); + + + }); + +} diff --git a/pubspec.lock b/pubspec.lock index 3475565..abb7e32 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -57,6 +57,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.15.0" + confetti: + dependency: "direct main" + description: + name: confetti + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.0" convert: dependency: transitive description: @@ -77,14 +84,14 @@ packages: name: cupertino_icons url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "1.0.4" device_info: dependency: "direct main" description: name: device_info url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.0.3" device_info_platform_interface: dependency: transitive description: @@ -138,7 +145,7 @@ packages: name: flutter_plugin_android_lifecycle url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.0.5" flutter_test: dependency: "direct dev" description: flutter @@ -155,21 +162,21 @@ packages: name: fluttertoast url: "https://pub.dartlang.org" source: hosted - version: "8.0.8" + version: "8.0.9" google_maps_flutter: dependency: "direct main" description: name: google_maps_flutter url: "https://pub.dartlang.org" source: hosted - version: "2.0.6" + version: "2.1.3" google_maps_flutter_platform_interface: dependency: transitive description: name: google_maps_flutter_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.5" http: dependency: "direct main" description: @@ -274,7 +281,7 @@ packages: name: plugin_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.1.2" provider: dependency: "direct main" description: @@ -300,14 +307,14 @@ packages: name: sqflite url: "https://pub.dartlang.org" source: hosted - version: "2.0.0+4" + version: "2.0.2" sqflite_common: dependency: transitive description: name: sqflite_common url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.2.1" stack_trace: dependency: transitive description: @@ -384,7 +391,28 @@ packages: name: webview_flutter url: "https://pub.dartlang.org" source: hosted - version: "2.0.12" + version: "2.8.0" + webview_flutter_android: + dependency: transitive + description: + name: webview_flutter_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.8.3" + webview_flutter_platform_interface: + dependency: transitive + description: + name: webview_flutter_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.1" + webview_flutter_wkwebview: + dependency: transitive + description: + name: webview_flutter_wkwebview + url: "https://pub.dartlang.org" + source: hosted + version: "2.7.1" youtube_player_flutter: dependency: "direct main" description: @@ -393,5 +421,5 @@ packages: source: hosted version: "7.0.0+7" sdks: - dart: ">=2.14.0 <3.0.0" - flutter: ">=2.0.0" + dart: ">=2.16.0 <3.0.0" + flutter: ">=2.5.0" diff --git a/pubspec.yaml b/pubspec.yaml index 651246f..49ef52d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -37,6 +37,7 @@ dependencies: youtube_player_flutter: ^7.0.0+7 mqtt_client: ^8.1.0 photo_view: ^0.13.0 + confetti: ^0.6.0 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons.