diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index 366b903..31de6b1 100644 --- a/.flutter-plugins-dependencies +++ b/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"qr_code_scanner","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\qr_code_scanner-1.0.1\\\\","native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.3+1\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"qr_code_scanner","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\qr_code_scanner-1.0.1\\\\","native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.3+1\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.3+1\\\\","native_build":true,"dependencies":[]}],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"qr_code_scanner","dependencies":[]},{"name":"sqflite","dependencies":[]}],"date_created":"2022-09-15 16:28:18.459550","version":"3.0.3"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"qr_code_scanner","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\qr_code_scanner-1.0.1\\\\","native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.3+1\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"qr_code_scanner","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\qr_code_scanner-1.0.1\\\\","native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.3+1\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.3+1\\\\","native_build":true,"dependencies":[]}],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"qr_code_scanner","dependencies":[]},{"name":"sqflite","dependencies":[]}],"date_created":"2022-09-17 22:40:40.100790","version":"3.0.3"} \ No newline at end of file diff --git a/README.md b/README.md index 39af52c..2e05bfd 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,10 @@ This README would normally document whatever steps are necessary to get your app * How to run tests * Deployment instructions +OPENAPI Generation cmd + +flutter pub run build_runner build --delete-conflicting-outputs + ### Contribution guidelines ### * Writing tests diff --git a/lib/Helpers/DatabaseHelper.dart b/lib/Helpers/DatabaseHelper.dart index f72763d..752385d 100644 --- a/lib/Helpers/DatabaseHelper.dart +++ b/lib/Helpers/DatabaseHelper.dart @@ -71,6 +71,9 @@ class DatabaseHelper { CREATE TABLE $configurationsTable ( $columnId TEXT NOT NULL PRIMARY KEY, $columnLabel TEXT NOT NULL, + $columnTitle TEXT NOT NULL, + $columnImageId TEXT, + $columnImageSource TEXT, $columnLanguages TEXT NOT NULL, $columnDateCreation TEXT NOT NULL, $columnPrimaryColor TEXT, @@ -235,9 +238,13 @@ class DatabaseHelper { } ConfigurationDTO getConfigurationFromDB(dynamic element) { + var titles = List.from(json.decode(element['title']).map((q) => TranslationDTO.fromJson(q)).toList()); return ConfigurationDTO( id: element["id"], label: element["label"], + title: titles, + imageId: element["imageId"], + imageSource: element["imageSource"], primaryColor: element["primaryColor"], secondaryColor: element["secondaryColor"], languages: List.from(jsonDecode(element["languages"])), diff --git a/lib/Screens/Home/home.dart b/lib/Screens/Home/home.dart index 5199b8c..646e5b7 100644 --- a/lib/Screens/Home/home.dart +++ b/lib/Screens/Home/home.dart @@ -97,7 +97,7 @@ class _HomePageState extends State { child: Padding( padding: const EdgeInsets.only(top: 20, left: 10), child: AutoSizeText( - configurations[index].label!, + TranslationHelper.get(configurations[index].title, appContext), style: const TextStyle(fontSize: kMenuTitleDetailSize), maxLines: 1, ), @@ -119,6 +119,7 @@ class _HomePageState extends State { child: InkWell( onTap: () async { downloadClicked(appContext, configurations[index]); + setState(() {}); // Force refresh }, child: configurations[index].isOffline! && !alreadyDownloaded.any((c) => c == configurations[index].id) ? const Icon(Icons.download, color: Colors.white) : const Icon(Icons.refresh, color: Colors.white), @@ -232,7 +233,12 @@ class _HomePageState extends State { // Display config only downloaded - TODO // Update local DB - Configuration - await DatabaseHelper.instance.insert(DatabaseTableType.configurations, configuration.toJson()); + await DatabaseHelper.instance.insert(DatabaseTableType.configurations, configurationToMap(configuration)); + + if(configuration.imageId != null) { + ImageDTO image = ImageDTO(resourceId: configuration.imageId, source_: configuration.imageSource); + await getAndDownloadImage(appContext.clientAPI, image); + } List? sections = await getAllSections(appContext.clientAPI, configuration.id!); @@ -258,6 +264,23 @@ class _HomePageState extends State { } } + Map configurationToMap(ConfigurationDTO configuration) { + return { + 'id': configuration.id, + 'label': configuration.label, + 'title': jsonEncode(configuration.title), + 'imageId': configuration.imageId, + 'imageSource': configuration.imageSource, + 'primaryColor': configuration.primaryColor, + 'secondaryColor': configuration.secondaryColor, + 'languages': configuration.languages, + 'dateCreation': configuration.dateCreation!.toUtc().toIso8601String(), + 'isMobile': configuration.isMobile, + 'isTablet': configuration.isTablet, + 'isOffline': configuration.isOffline + }; + } + Map sectionToMap(SectionDTO section) { return { 'id': section.id, diff --git a/lib/api/swagger.yaml b/lib/api/swagger.yaml index e739b39..2dadf26 100644 --- a/lib/api/swagger.yaml +++ b/lib/api/swagger.yaml @@ -1404,6 +1404,17 @@ components: label: type: string nullable: true + title: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + imageId: + type: string + nullable: true + imageSource: + type: string + nullable: true primaryColor: type: string nullable: true @@ -1424,6 +1435,16 @@ components: type: boolean isOffline: type: boolean + TranslationDTO: + type: object + additionalProperties: false + properties: + language: + type: string + nullable: true + value: + type: string + nullable: true ExportConfigurationDTO: allOf: - $ref: '#/components/schemas/ConfigurationDTO' @@ -1485,26 +1506,9 @@ components: order: type: integer format: int32 - TranslationDTO: - type: object - additionalProperties: false - properties: - language: - type: string - nullable: true - value: - type: string - nullable: true SectionType: - type: integer - description: |- - 0 = Map - 1 = Slider - 2 = Video - 3 = Web - 4 = Menu - 5 = Quizz - 6 = Article + type: string + description: '' x-enumNames: - Map - Slider @@ -1514,13 +1518,13 @@ components: - Quizz - Article enum: - - 0 - - 1 - - 2 - - 3 - - 4 - - 5 - - 6 + - Map + - Slider + - Video + - Web + - Menu + - Quizz + - Article ResourceDTO: type: object additionalProperties: false @@ -1540,22 +1544,18 @@ components: type: string nullable: true ResourceType: - type: integer - description: |- - 0 = Image - 1 = Video - 2 = ImageUrl - 3 = VideoUrl + type: string + description: '' x-enumNames: - Image - Video - ImageUrl - VideoUrl enum: - - 0 - - 1 - - 2 - - 3 + - Image + - Video + - ImageUrl + - VideoUrl DeviceDTO: type: object additionalProperties: false @@ -1628,13 +1628,8 @@ components: type: string nullable: true MapTypeApp: - type: integer - description: |- - 0 = none - 1 = normal - 2 = satellite - 3 = terrain - 4 = hybrid + type: string + description: '' x-enumNames: - none - normal @@ -1642,11 +1637,11 @@ components: - terrain - hybrid enum: - - 0 - - 1 - - 2 - - 3 - - 4 + - none + - normal + - satellite + - terrain + - hybrid GeoPointDTO: type: object additionalProperties: false diff --git a/lib/api/swagger.yaml.bak b/lib/api/swagger.yaml.bak0 similarity index 100% rename from lib/api/swagger.yaml.bak rename to lib/api/swagger.yaml.bak0 diff --git a/lib/api/swagger.yaml.bak1 b/lib/api/swagger.yaml.bak1 new file mode 100644 index 0000000..e739b39 --- /dev/null +++ b/lib/api/swagger.yaml.bak1 @@ -0,0 +1,1949 @@ +x-generator: NSwag v13.10.8.0 (NJsonSchema v10.3.11.0 (Newtonsoft.Json v10.0.0.0)) +openapi: 3.0.0 +info: + title: Manager Service + description: API Manager Service + version: Version Alpha +servers: + - url: http://localhost:5000 +paths: + /api/Configuration: + get: + tags: + - Configuration + operationId: Configuration_Get + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ConfigurationDTO' + '500': + description: '' + content: + application/json: + schema: + type: string + post: + tags: + - Configuration + operationId: Configuration_Create + requestBody: + x-name: newConfiguration + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigurationDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigurationDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + put: + tags: + - Configuration + operationId: Configuration_Update + requestBody: + x-name: updatedConfiguration + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigurationDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigurationDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Configuration/{id}: + get: + tags: + - Configuration + operationId: Configuration_GetDetail + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigurationDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + delete: + tags: + - Configuration + operationId: Configuration_Delete + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Configuration/{id}/export: + get: + tags: + - Configuration + operationId: Configuration_Export + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + /api/Configuration/import: + post: + tags: + - Configuration + operationId: Configuration_Import + requestBody: + x-name: exportConfiguration + content: + application/json: + schema: + $ref: '#/components/schemas/ExportConfigurationDTO' + required: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Device: + get: + tags: + - Device + operationId: Device_Get + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DeviceDTO' + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + post: + tags: + - Device + operationId: Device_Create + requestBody: + x-name: newDevice + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + put: + tags: + - Device + operationId: Device_Update + requestBody: + x-name: updatedDevice + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Device/{id}/detail: + get: + tags: + - Device + operationId: Device_GetDetail + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + /api/Device/mainInfos: + put: + tags: + - Device + operationId: Device_UpdateMainInfos + requestBody: + x-name: deviceIn + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Device/{id}: + delete: + tags: + - Device + operationId: Device_Delete + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Resource: + get: + tags: + - Resource + operationId: Resource_Get + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ResourceDTO' + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + post: + tags: + - Resource + operationId: Resource_Create + requestBody: + x-name: newResource + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + put: + tags: + - Resource + operationId: Resource_Update + requestBody: + x-name: updatedResource + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Resource/{id}/detail: + get: + tags: + - Resource + operationId: Resource_GetDetail + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + /api/Resource/{id}: + get: + tags: + - Resource + operationId: Resource_Show + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + delete: + tags: + - Resource + operationId: Resource_Delete + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Resource/upload: + post: + tags: + - Resource + operationId: Resource_Upload + requestBody: + content: + multipart/form-data: + schema: + properties: + label: + type: string + nullable: true + type: + type: string + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Section: + get: + tags: + - Section + operationId: Section_Get + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SectionDTO' + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + post: + tags: + - Section + operationId: Section_Create + requestBody: + x-name: newSection + content: + application/json: + schema: + $ref: '#/components/schemas/SectionDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/SectionDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + put: + tags: + - Section + operationId: Section_Update + requestBody: + x-name: updatedSection + content: + application/json: + schema: + $ref: '#/components/schemas/SectionDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/SectionDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Section/configuration/{id}: + get: + tags: + - Section + operationId: Section_GetFromConfiguration + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SectionDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + delete: + tags: + - Section + operationId: Section_DeleteAllForConfiguration + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Section/{id}/subsections: + get: + tags: + - Section + operationId: Section_GetAllSectionSubSections + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: {} + '400': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Section/{id}: + get: + tags: + - Section + operationId: Section_GetDetail + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/SectionDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + delete: + tags: + - Section + operationId: Section_Delete + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Section/order: + put: + tags: + - Section + operationId: Section_UpdateOrder + requestBody: + x-name: updatedSectionsOrder + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SectionDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Section/MapDTO: + get: + tags: + - Section + operationId: Section_GetMapDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/MapDTO' + security: + - bearer: [] + /api/Section/SliderDTO: + get: + tags: + - Section + operationId: Section_GetSliderDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/SliderDTO' + security: + - bearer: [] + /api/Section/VideoDTO: + get: + tags: + - Section + operationId: Section_GetVideoDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/VideoDTO' + security: + - bearer: [] + /api/Section/WebDTO: + get: + tags: + - Section + operationId: Section_GetWebDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/WebDTO' + security: + - bearer: [] + /api/Section/MenuDTO: + get: + tags: + - Section + operationId: Section_GetMenuDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/MenuDTO' + security: + - bearer: [] + /api/Section/PlayerMessageDTO: + get: + tags: + - Section + operationId: Section_PlayerMessageDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/PlayerMessageDTO' + security: + - bearer: [] + /api/Section/QuizzDTO: + get: + tags: + - Section + operationId: Section_GetQuizzDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/QuizzDTO' + security: + - bearer: [] + /api/Section/ArticleDTO: + get: + tags: + - Section + operationId: Section_GetArticleDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ArticleDTO' + security: + - bearer: [] + /api/User: + get: + tags: + - User + operationId: User_Get + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + post: + tags: + - User + operationId: User_CreateUser + requestBody: + x-name: newUser + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/UserDetailDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + put: + tags: + - User + operationId: User_UpdateUser + requestBody: + x-name: updatedUser + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/UserDetailDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/User/{id}: + get: + tags: + - User + operationId: User_GetDetail + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/UserDetailDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + delete: + tags: + - User + operationId: User_DeleteUser + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Authentication/Token: + post: + tags: + - Authentication + operationId: Authentication_AuthenticateWithForm + requestBody: + content: + multipart/form-data: + schema: + properties: + grant_type: + type: string + nullable: true + username: + type: string + nullable: true + password: + type: string + nullable: true + client_id: + type: string + nullable: true + client_secret: + type: string + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/TokenDTO' + '401': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + /api/Authentication/Authenticate: + post: + tags: + - Authentication + operationId: Authentication_AuthenticateWithJson + requestBody: + x-name: login + content: + application/json: + schema: + $ref: '#/components/schemas/LoginDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/TokenDTO' + '401': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string +components: + schemas: + ConfigurationDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + label: + type: string + nullable: true + primaryColor: + type: string + nullable: true + secondaryColor: + type: string + nullable: true + languages: + type: array + nullable: true + items: + type: string + dateCreation: + type: string + format: date-time + isMobile: + type: boolean + isTablet: + type: boolean + isOffline: + type: boolean + ExportConfigurationDTO: + allOf: + - $ref: '#/components/schemas/ConfigurationDTO' + - type: object + additionalProperties: false + properties: + sections: + type: array + nullable: true + items: + $ref: '#/components/schemas/SectionDTO' + resources: + type: array + nullable: true + items: + $ref: '#/components/schemas/ResourceDTO' + SectionDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + label: + type: string + nullable: true + title: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + description: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + imageId: + type: string + nullable: true + imageSource: + type: string + nullable: true + configurationId: + type: string + nullable: true + isSubSection: + type: boolean + parentId: + type: string + nullable: true + type: + $ref: '#/components/schemas/SectionType' + data: + type: string + nullable: true + dateCreation: + type: string + format: date-time + order: + type: integer + format: int32 + TranslationDTO: + type: object + additionalProperties: false + properties: + language: + type: string + nullable: true + value: + type: string + nullable: true + SectionType: + type: integer + description: |- + 0 = Map + 1 = Slider + 2 = Video + 3 = Web + 4 = Menu + 5 = Quizz + 6 = Article + x-enumNames: + - Map + - Slider + - Video + - Web + - Menu + - Quizz + - Article + enum: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + ResourceDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + type: + $ref: '#/components/schemas/ResourceType' + label: + type: string + nullable: true + dateCreation: + type: string + format: date-time + data: + type: string + nullable: true + ResourceType: + type: integer + description: |- + 0 = Image + 1 = Video + 2 = ImageUrl + 3 = VideoUrl + x-enumNames: + - Image + - Video + - ImageUrl + - VideoUrl + enum: + - 0 + - 1 + - 2 + - 3 + DeviceDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + identifier: + type: string + nullable: true + name: + type: string + nullable: true + ipAddressWLAN: + type: string + nullable: true + ipAddressETH: + type: string + nullable: true + configurationId: + type: string + nullable: true + configuration: + type: string + nullable: true + connected: + type: boolean + dateCreation: + type: string + format: date-time + dateUpdate: + type: string + format: date-time + DeviceDetailDTO: + allOf: + - $ref: '#/components/schemas/DeviceDTO' + - type: object + additionalProperties: false + properties: + connectionLevel: + type: string + nullable: true + lastConnectionLevel: + type: string + format: date-time + batteryLevel: + type: string + nullable: true + lastBatteryLevel: + type: string + format: date-time + MapDTO: + type: object + additionalProperties: false + properties: + zoom: + type: integer + format: int32 + mapType: + $ref: '#/components/schemas/MapTypeApp' + points: + type: array + nullable: true + items: + $ref: '#/components/schemas/GeoPointDTO' + iconResourceId: + type: string + nullable: true + iconSource: + type: string + nullable: true + MapTypeApp: + type: integer + description: |- + 0 = none + 1 = normal + 2 = satellite + 3 = terrain + 4 = hybrid + x-enumNames: + - none + - normal + - satellite + - terrain + - hybrid + enum: + - 0 + - 1 + - 2 + - 3 + - 4 + GeoPointDTO: + type: object + additionalProperties: false + properties: + id: + type: integer + format: int32 + title: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + description: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + images: + type: array + nullable: true + items: + $ref: '#/components/schemas/ImageGeoPoint' + latitude: + type: string + nullable: true + longitude: + type: string + nullable: true + ImageGeoPoint: + type: object + additionalProperties: false + properties: + imageResourceId: + type: string + nullable: true + imageSource: + type: string + nullable: true + SliderDTO: + type: object + additionalProperties: false + properties: + images: + type: array + nullable: true + items: + $ref: '#/components/schemas/ImageDTO' + ImageDTO: + type: object + additionalProperties: false + properties: + title: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + description: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + resourceId: + type: string + nullable: true + source: + type: string + nullable: true + order: + type: integer + format: int32 + VideoDTO: + type: object + additionalProperties: false + properties: + source: + type: string + nullable: true + WebDTO: + type: object + additionalProperties: false + properties: + source: + type: string + nullable: true + MenuDTO: + type: object + additionalProperties: false + properties: + sections: + type: array + nullable: true + items: + $ref: '#/components/schemas/SectionDTO' + PlayerMessageDTO: + type: object + additionalProperties: false + properties: + configChanged: + type: boolean + isDeleted: + type: boolean + QuizzDTO: + type: object + additionalProperties: false + properties: + questions: + type: array + nullable: true + items: + $ref: '#/components/schemas/QuestionDTO' + bad_level: + nullable: true + oneOf: + - $ref: '#/components/schemas/LevelDTO' + medium_level: + nullable: true + oneOf: + - $ref: '#/components/schemas/LevelDTO' + good_level: + nullable: true + oneOf: + - $ref: '#/components/schemas/LevelDTO' + great_level: + nullable: true + oneOf: + - $ref: '#/components/schemas/LevelDTO' + QuestionDTO: + type: object + additionalProperties: false + properties: + label: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + responses: + type: array + nullable: true + items: + $ref: '#/components/schemas/ResponseDTO' + resourceId: + type: string + nullable: true + source: + type: string + nullable: true + order: + type: integer + format: int32 + ResponseDTO: + type: object + additionalProperties: false + properties: + label: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + isGood: + type: boolean + order: + type: integer + format: int32 + LevelDTO: + type: object + additionalProperties: false + properties: + label: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + resourceId: + type: string + nullable: true + source: + type: string + nullable: true + ArticleDTO: + type: object + additionalProperties: false + properties: + content: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + qrCode: + type: string + nullable: true + isContentTop: + type: boolean + audioId: + type: string + nullable: true + isReadAudioAuto: + type: boolean + images: + type: array + nullable: true + items: + $ref: '#/components/schemas/ImageDTO' + User: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + email: + type: string + nullable: true + password: + type: string + nullable: true + firstName: + type: string + nullable: true + lastName: + type: string + nullable: true + token: + type: string + nullable: true + dateCreation: + type: string + format: date-time + UserDetailDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + email: + type: string + nullable: true + firstName: + type: string + nullable: true + lastName: + type: string + nullable: true + TokenDTO: + type: object + additionalProperties: false + properties: + access_token: + type: string + nullable: true + refresh_token: + type: string + nullable: true + scope: + type: string + nullable: true + token_type: + type: string + nullable: true + expires_in: + type: integer + format: int32 + expiration: + type: string + format: date-time + LoginDTO: + type: object + additionalProperties: false + properties: + email: + type: string + nullable: true + password: + type: string + nullable: true + securitySchemes: + bearer: + type: oauth2 + description: Manager Authentication + flows: + password: + authorizationUrl: /authentication/Token + tokenUrl: /api/authentication/Token + scopes: + Manager-api: Manager WebAPI +security: + - bearer: [] +tags: + - name: Configuration + description: Configuration management + - name: Device + description: Device management + - name: Resource + description: Resource management + - name: Section + description: Section management + - name: User + description: User management + - name: Authentication + description: Authentication management diff --git a/manager_api/.openapi-generator/FILES b/manager_api/.openapi-generator/FILES index e3b499f..17323c5 100644 --- a/manager_api/.openapi-generator/FILES +++ b/manager_api/.openapi-generator/FILES @@ -87,40 +87,3 @@ lib/model/user_detail_dto.dart lib/model/video_dto.dart lib/model/web_dto.dart pubspec.yaml -test/article_dto_test.dart -test/authentication_api_test.dart -test/configuration_api_test.dart -test/configuration_dto_test.dart -test/device_api_test.dart -test/device_detail_dto_all_of_test.dart -test/device_detail_dto_test.dart -test/device_dto_test.dart -test/export_configuration_dto_all_of_test.dart -test/export_configuration_dto_test.dart -test/geo_point_dto_test.dart -test/image_dto_test.dart -test/image_geo_point_test.dart -test/level_dto_test.dart -test/login_dto_test.dart -test/map_dto_test.dart -test/map_type_app_test.dart -test/menu_dto_test.dart -test/player_message_dto_test.dart -test/question_dto_test.dart -test/quizz_dto_bad_level_test.dart -test/quizz_dto_test.dart -test/resource_api_test.dart -test/resource_dto_test.dart -test/resource_type_test.dart -test/response_dto_test.dart -test/section_api_test.dart -test/section_dto_test.dart -test/section_type_test.dart -test/slider_dto_test.dart -test/token_dto_test.dart -test/translation_dto_test.dart -test/user_api_test.dart -test/user_detail_dto_test.dart -test/user_test.dart -test/video_dto_test.dart -test/web_dto_test.dart diff --git a/manager_api/doc/ConfigurationDTO.md b/manager_api/doc/ConfigurationDTO.md index cd26c22..b54d692 100644 --- a/manager_api/doc/ConfigurationDTO.md +++ b/manager_api/doc/ConfigurationDTO.md @@ -10,6 +10,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **String** | | [optional] **label** | **String** | | [optional] +**title** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**imageId** | **String** | | [optional] +**imageSource** | **String** | | [optional] **primaryColor** | **String** | | [optional] **secondaryColor** | **String** | | [optional] **languages** | **List** | | [optional] [default to const []] diff --git a/manager_api/doc/ExportConfigurationDTO.md b/manager_api/doc/ExportConfigurationDTO.md index 6aced4d..db97809 100644 --- a/manager_api/doc/ExportConfigurationDTO.md +++ b/manager_api/doc/ExportConfigurationDTO.md @@ -10,6 +10,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **String** | | [optional] **label** | **String** | | [optional] +**title** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**imageId** | **String** | | [optional] +**imageSource** | **String** | | [optional] **primaryColor** | **String** | | [optional] **secondaryColor** | **String** | | [optional] **languages** | **List** | | [optional] [default to const []] diff --git a/manager_api/lib/model/configuration_dto.dart b/manager_api/lib/model/configuration_dto.dart index 313d455..4624851 100644 --- a/manager_api/lib/model/configuration_dto.dart +++ b/manager_api/lib/model/configuration_dto.dart @@ -15,6 +15,9 @@ class ConfigurationDTO { ConfigurationDTO({ this.id, this.label, + this.title = const [], + this.imageId, + this.imageSource, this.primaryColor, this.secondaryColor, this.languages = const [], @@ -28,6 +31,12 @@ class ConfigurationDTO { String? label; + List? title; + + String? imageId; + + String? imageSource; + String? primaryColor; String? secondaryColor; @@ -70,6 +79,9 @@ class ConfigurationDTO { bool operator ==(Object other) => identical(this, other) || other is ConfigurationDTO && other.id == id && other.label == label && + other.title == title && + other.imageId == imageId && + other.imageSource == imageSource && other.primaryColor == primaryColor && other.secondaryColor == secondaryColor && other.languages == languages && @@ -83,6 +95,9 @@ class ConfigurationDTO { // ignore: unnecessary_parenthesis (id == null ? 0 : id!.hashCode) + (label == null ? 0 : label!.hashCode) + + (title == null ? 0 : title!.hashCode) + + (imageId == null ? 0 : imageId!.hashCode) + + (imageSource == null ? 0 : imageSource!.hashCode) + (primaryColor == null ? 0 : primaryColor!.hashCode) + (secondaryColor == null ? 0 : secondaryColor!.hashCode) + (languages == null ? 0 : languages!.hashCode) + @@ -92,7 +107,7 @@ class ConfigurationDTO { (isOffline == null ? 0 : isOffline!.hashCode); @override - String toString() => 'ConfigurationDTO[id=$id, label=$label, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, isMobile=$isMobile, isTablet=$isTablet, isOffline=$isOffline]'; + String toString() => 'ConfigurationDTO[id=$id, label=$label, title=$title, imageId=$imageId, imageSource=$imageSource, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, isMobile=$isMobile, isTablet=$isTablet, isOffline=$isOffline]'; Map toJson() { final _json = {}; @@ -102,6 +117,15 @@ class ConfigurationDTO { if (label != null) { _json[r'label'] = label; } + if (title != null) { + _json[r'title'] = title; + } + if (imageId != null) { + _json[r'imageId'] = imageId; + } + if (imageSource != null) { + _json[r'imageSource'] = imageSource; + } if (primaryColor != null) { _json[r'primaryColor'] = primaryColor; } @@ -147,6 +171,9 @@ class ConfigurationDTO { return ConfigurationDTO( id: mapValueOfType(json, r'id'), label: mapValueOfType(json, r'label'), + title: TranslationDTO.listFromJson(json[r'title']) ?? const [], + imageId: mapValueOfType(json, r'imageId'), + imageSource: mapValueOfType(json, r'imageSource'), primaryColor: mapValueOfType(json, r'primaryColor'), secondaryColor: mapValueOfType(json, r'secondaryColor'), languages: json[r'languages'] is List diff --git a/manager_api/lib/model/export_configuration_dto.dart b/manager_api/lib/model/export_configuration_dto.dart index 5bacb17..49e4ab6 100644 --- a/manager_api/lib/model/export_configuration_dto.dart +++ b/manager_api/lib/model/export_configuration_dto.dart @@ -15,6 +15,9 @@ class ExportConfigurationDTO { ExportConfigurationDTO({ this.id, this.label, + this.title = const [], + this.imageId, + this.imageSource, this.primaryColor, this.secondaryColor, this.languages = const [], @@ -30,6 +33,12 @@ class ExportConfigurationDTO { String? label; + List? title; + + String? imageId; + + String? imageSource; + String? primaryColor; String? secondaryColor; @@ -76,6 +85,9 @@ class ExportConfigurationDTO { bool operator ==(Object other) => identical(this, other) || other is ExportConfigurationDTO && other.id == id && other.label == label && + other.title == title && + other.imageId == imageId && + other.imageSource == imageSource && other.primaryColor == primaryColor && other.secondaryColor == secondaryColor && other.languages == languages && @@ -91,6 +103,9 @@ class ExportConfigurationDTO { // ignore: unnecessary_parenthesis (id == null ? 0 : id!.hashCode) + (label == null ? 0 : label!.hashCode) + + (title == null ? 0 : title!.hashCode) + + (imageId == null ? 0 : imageId!.hashCode) + + (imageSource == null ? 0 : imageSource!.hashCode) + (primaryColor == null ? 0 : primaryColor!.hashCode) + (secondaryColor == null ? 0 : secondaryColor!.hashCode) + (languages == null ? 0 : languages!.hashCode) + @@ -102,7 +117,7 @@ class ExportConfigurationDTO { (resources == null ? 0 : resources!.hashCode); @override - String toString() => 'ExportConfigurationDTO[id=$id, label=$label, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, isMobile=$isMobile, isTablet=$isTablet, isOffline=$isOffline, sections=$sections, resources=$resources]'; + String toString() => 'ExportConfigurationDTO[id=$id, label=$label, title=$title, imageId=$imageId, imageSource=$imageSource, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, isMobile=$isMobile, isTablet=$isTablet, isOffline=$isOffline, sections=$sections, resources=$resources]'; Map toJson() { final _json = {}; @@ -112,6 +127,15 @@ class ExportConfigurationDTO { if (label != null) { _json[r'label'] = label; } + if (title != null) { + _json[r'title'] = title; + } + if (imageId != null) { + _json[r'imageId'] = imageId; + } + if (imageSource != null) { + _json[r'imageSource'] = imageSource; + } if (primaryColor != null) { _json[r'primaryColor'] = primaryColor; } @@ -163,6 +187,9 @@ class ExportConfigurationDTO { return ExportConfigurationDTO( id: mapValueOfType(json, r'id'), label: mapValueOfType(json, r'label'), + title: TranslationDTO.listFromJson(json[r'title']) ?? const [], + imageId: mapValueOfType(json, r'imageId'), + imageSource: mapValueOfType(json, r'imageSource'), primaryColor: mapValueOfType(json, r'primaryColor'), secondaryColor: mapValueOfType(json, r'secondaryColor'), languages: json[r'languages'] is List