Add pinCode to manager + show devices tab (fort logic)

This commit is contained in:
Thomas Fransolet 2023-12-05 14:38:47 +01:00
parent 39bc7ca20e
commit ff18f37b1b
27 changed files with 597 additions and 205 deletions

View File

@ -8,6 +8,7 @@ class ManagerAppContext with ChangeNotifier{
String? instanceId;
String? host;
String? accessToken;
int? pinCode;
Client? clientAPI;
String? currentRoute;
ConfigurationDTO? selectedConfiguration;

View File

@ -105,7 +105,7 @@ class _MapConfigState extends State<MapConfig> {
),
// Map Type
MultiSelectContainer(
label: "Type :",
label: "Type:",
initialValue: [mapType], //mapDTO.mapType.toString()
isMultiple: false,
values: map_types,

View File

@ -39,7 +39,7 @@ void showNewSection(String configurationId, AppContext appContext, BuildContext
},
),
MultiSelectContainer(
label: "Type :",
label: "Type:",
initialValue: isMobile ? ["Article"] : ["Map"],
isMultiple: false,
values: isMobile ? section_types.where((sectionType) => sectionType == "Article" || sectionType == "Quizz").toList(): isSubSection ? section_types.where((sectionType) => sectionType != "Menu" && sectionType != "Article").toList(): section_types.where((sectionType) => sectionType != "Article").toList(), // Todo get menu by enum type

View File

@ -34,8 +34,8 @@ class _DeviceElementState extends State<DeviceElement> {
return Stack(
children: [
Positioned(
top: 10,
right: 10,
top: 0,
right: 0,
child: Container(
width: 15,
height: 15,

View File

@ -1,3 +1,4 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart';
import 'package:manager_app/Components/loading_common.dart';
import 'package:manager_app/Models/managerContext.dart';
@ -19,17 +20,33 @@ class _DevicesScreenState extends State<DevicesScreen> {
Widget build(BuildContext context) {
final appContext = Provider.of<AppContext>(context);
Size size = MediaQuery.of(context).size;
ManagerAppContext managerAppContext = appContext.getContext();
return Container(
child: Align(
alignment: AlignmentDirectional.topCenter,
child: FutureBuilder(
child: Column(
children: [
if(managerAppContext.pinCode != null)
Padding(
padding: const EdgeInsets.all(10.0),
child: Align(
alignment: AlignmentDirectional.centerStart,
child: AutoSizeText(
"PinCode: " + managerAppContext.pinCode.toString(),
style: TextStyle(fontSize: 25.0, fontWeight: FontWeight.w300),
maxLines: 2,
maxFontSize: 25.0,
textAlign: TextAlign.center,
),
),
),
FutureBuilder(
future: getDevices(appContext),
builder: (context, AsyncSnapshot<dynamic> snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
return GridView.builder(
shrinkWrap: true,
gridDelegate: new SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 4),
gridDelegate: new SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 6),
itemCount: snapshot.data.length,
itemBuilder: (BuildContext context, int index) {
return Container(
@ -55,6 +72,8 @@ class _DevicesScreenState extends State<DevicesScreen> {
}
}
),
],
),
),
);
}

View File

@ -15,10 +15,15 @@ import 'package:manager_app/constants.dart';
import 'package:manager_app/main.dart';
import 'package:manager_api_new/api.dart';
import 'package:provider/provider.dart';
import 'package:responsive_framework/responsive_breakpoints.dart';
class Body extends StatefulWidget {
Body({Key? key}) : super(key: key);
final bool showDevice;
Body({
Key? key,
required this.showDevice
}) : super(key: key);
@override
_BodyState createState() => _BodyState();
@ -28,20 +33,34 @@ class _BodyState extends State<Body> {
bool isChecked = false;
int currentPosition = 0;
var selectedElement;
//MenuSection devices = new MenuSection(name: "Test", type: "devices", order: 0);
MenuSection configurations = new MenuSection(name: "Visites", type: "configurations", order: 0);
MenuSection resources = new MenuSection(name: "Ressources", type: "resources", order: 1);
late MenuSection devices;
late MenuSection configurations;
late MenuSection resources;
Menu menu = new Menu(title: "MyMuseum");
@override
void initState() {
devices = new MenuSection(name: "Appareils", type: "devices", order: 0);
configurations = new MenuSection(name: "Visites", type: "configurations", order: widget.showDevice ? 1 : 0);
resources = new MenuSection(name: "Ressources", type: "resources", order: widget.showDevice ? 2 : 1);
//tabsToShow.add(new Tab(text: "Vidéo en ligne"));
super.initState();
}
@override
Widget build(BuildContext context) {
final appContext = Provider.of<AppContext>(context);
Size size = MediaQuery.of(context).size;
menu.sections = <MenuSection>[];
//menu.sections.add(devices);
if(widget.showDevice) // pour ne pas perturber francoise
{
menu.sections!.add(devices);
}
menu.sections!.add(configurations);
menu.sections!.add(resources);
@ -50,6 +69,7 @@ class _BodyState extends State<Body> {
return Background(
child: Row(
children: [
if(!ResponsiveBreakpoints.of(context).equals(TABLET))
// MENU
Container(
width: size.width * 0.15,
@ -165,7 +185,7 @@ class _BodyState extends State<Body> {
),
// Main Container
Container(
width: size.width * 0.85,
width: !ResponsiveBreakpoints.of(context).equals(TABLET) ? size.width * 0.85 : size.width,
child: Padding(
padding: const EdgeInsets.all(0.0),
child: selectedElement),
@ -185,13 +205,11 @@ class _BodyState extends State<Body> {
padding: const EdgeInsets.all(8.0),
child: DevicesScreen()
);
break;
case 'configurations' :
return Padding(
padding: const EdgeInsets.all(8.0),
child: ConfigurationsScreen()
);
break;
case 'resources' :
return Padding(
padding: const EdgeInsets.all(8.0),
@ -203,9 +221,7 @@ class _BodyState extends State<Body> {
]
)
);
break;
default:
return Text('Hellow default');
break;
}
}

View File

@ -1,8 +1,11 @@
import 'package:flutter/material.dart';
import 'package:manager_app/Models/managerContext.dart';
import 'package:manager_app/Models/menu.dart';
import 'package:manager_app/Models/menuSection.dart';
import 'package:manager_app/Screens/Main/components/body.dart';
import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart';
import 'package:provider/provider.dart';
import 'package:responsive_framework/responsive_breakpoints.dart';
class MainScreen extends StatefulWidget {
@ -15,26 +18,33 @@ class MainScreen extends StatefulWidget {
class _MainScreenState extends State<MainScreen> {
@override
Widget build(BuildContext context) {
if(ResponsiveBreakpoints.of(context).equals(DESKTOP)) {
final appContext = Provider.of<AppContext>(context);
ManagerAppContext managerAppContext = appContext.getContext();
print(managerAppContext.instanceId);
var isFortSt = managerAppContext.instanceId == "633ee379d9405f32f166f047";
if(!ResponsiveBreakpoints.of(context).equals(TABLET) || isFortSt) {
return Scaffold(
body: Body(),
body: Body(showDevice: !isFortSt),
);
} else {
return Scaffold(
appBar: AppBar(title: Text("MyMuseum - Manager tablet and mobile mode"), backgroundColor: kPrimaryColor),
appBar: AppBar(title: Text("MyMuseum", style: new TextStyle(color: kPrimaryColor, fontSize: 30, fontWeight: FontWeight.w400, fontFamily: "Helvetica")), backgroundColor: kSecond.withOpacity(0.3), iconTheme: IconThemeData(color: kPrimaryColor)),
drawer: Drawer(
child: getMenu()
),
body: Body(),
body: Body(showDevice: isFortSt),
);
}
}
getMenu() {
//MenuSection devices = new MenuSection(name: "Test", type: "devices", order: 0);
MenuSection configurations = new MenuSection(name: "Visites", type: "configurations", order: 0);
MenuSection resources = new MenuSection(name: "Ressources", type: "resources", order: 1);
MenuSection devices = new MenuSection(name: "Appareils", type: "devices", order: 0);
MenuSection configurations = new MenuSection(name: "Visites", type: "configurations", order: 1);
MenuSection resources = new MenuSection(name: "Ressources", type: "resources", order: 2);
Menu menu = new Menu(title: "MyMuseum");
@ -48,6 +58,12 @@ class _MainScreenState extends State<MainScreen> {
),
child: Text(menu.title),
),
ListTile(
title: Text(devices.name),
onTap: () {
// TODO Navigate to configurations screen (by route if possible)
},
),
ListTile(
title: Text(configurations.name),
onTap: () {

View File

@ -72,7 +72,7 @@ class _ResourceBodyGridState extends State<ResourceBodyGrid> {
Padding(
padding: const EdgeInsets.all(8.0),
child: MultiSelectContainer(
label: "Type :",
label: "Type:",
initialValue: filterTypes,
values: currentFilterTypes,
isMultiple: true,

View File

@ -38,6 +38,7 @@ class _LoginScreenState extends State<LoginScreen> {
String pageTitle = "MyMuseum";
String? token;
String? instanceId;
int? pinCode;
Storage localStorage = window.localStorage;
void authenticateTRY(AppContext appContext, bool fromClick) async {
@ -63,6 +64,7 @@ class _LoginScreenState extends State<LoginScreen> {
var accessToken = this.token;
var instanceId = this.instanceId;
var pinCode = this.pinCode;
print("accessToken");
print(accessToken);
if(accessToken == null) {
@ -79,6 +81,7 @@ class _LoginScreenState extends State<LoginScreen> {
if(token != null) {
accessToken = token.accessToken!;
instanceId = token.instanceId!;
pinCode = token.pinCode;
showNotification(
kSuccess, kWhite, 'Connexion réussie', context, null);
@ -92,8 +95,10 @@ class _LoginScreenState extends State<LoginScreen> {
!localStorage.containsKey("token")) {
localStorage.addEntries({"email": email}.entries);
localStorage.addEntries({"token": token.accessToken!}.entries);
localStorage.addEntries(
{"instanceId": token.instanceId!}.entries);
localStorage.addEntries({"instanceId": token.instanceId!}.entries);
if(token.pinCode != null) {
localStorage.addEntries({"pinCode": token.pinCode!.toString()}.entries);
}
}
} else {
localStorage.clear();
@ -113,6 +118,7 @@ class _LoginScreenState extends State<LoginScreen> {
managerAppContext.email = email;
managerAppContext.host = host;
managerAppContext.instanceId = instanceId;
managerAppContext.pinCode = pinCode;
managerAppContext.accessToken = accessToken;
managerAppContext.clientAPI = clientAPI;
setAccessToken(accessToken);
@ -184,6 +190,9 @@ class _LoginScreenState extends State<LoginScreen> {
if(localStorage.containsKey("instanceId")) {
this.instanceId = localStorage.entries.where((element) => element.key == "instanceId").first.value;
}
if(localStorage.containsKey("pinCode")) {
this.pinCode = int.tryParse(localStorage.entries.where((element) => element.key == "pinCode").first.value);
}
}
super.initState();
}

View File

@ -112,6 +112,39 @@ paths:
type: string
security:
- bearer: []
/api/Configuration/byPin:
get:
tags:
- Configuration
operationId: Configuration_GetConfigurationsByPinCode
parameters:
- name: pinCode
in: query
schema:
type: integer
format: int32
x-position: 1
responses:
'200':
description: ''
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/ConfigurationDTO'
'404':
description: ''
content:
application/json:
schema:
type: string
'500':
description: ''
content:
application/json:
schema:
type: string
/api/Configuration/{id}:
get:
tags:
@ -670,6 +703,37 @@ paths:
type: string
security:
- bearer: []
/api/Instance/byPin:
get:
tags:
- Instance
operationId: Instance_GetInstanceByPinCode
parameters:
- name: pinCode
in: query
schema:
type: integer
format: int32
x-position: 1
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/InstanceDTO'
'404':
description: ''
content:
application/json:
schema:
type: string
'500':
description: ''
content:
application/json:
schema:
type: string
/api/Resource:
get:
tags:
@ -1211,24 +1275,19 @@ paths:
type: string
security:
- bearer: []
/api/Section/beacons/{id}:
/api/Section/beacons/{instanceId}:
get:
tags:
- Section
operationId: Section_GetAllBeaconsForInstance
parameters:
- name: instanceId
in: query
schema:
type: string
nullable: true
x-position: 1
- name: id
in: path
required: true
schema:
type: string
x-position: 2
nullable: true
x-position: 1
responses:
'200':
description: ''
@ -1704,6 +1763,9 @@ components:
nullable: true
items:
type: string
pinCode:
type: integer
format: int32
TranslationDTO:
type: object
additionalProperties: false
@ -1928,6 +1990,10 @@ components:
dateCreation:
type: string
format: date-time
pinCode:
type: integer
format: int32
nullable: true
InstanceDTO:
type: object
additionalProperties: false
@ -1941,6 +2007,10 @@ components:
dateCreation:
type: string
format: date-time
pinCode:
type: integer
format: int32
nullable: true
MapDTO:
type: object
additionalProperties: false
@ -2251,6 +2321,10 @@ components:
instanceId:
type: string
nullable: true
pinCode:
type: integer
format: int32
nullable: true
LoginDTO:
type: object
additionalProperties: false

View File

@ -70,6 +70,7 @@ Class | Method | HTTP request | Description
*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* | [**configurationGetConfigurationsByPinCode**](doc\/ConfigurationApi.md#configurationgetconfigurationsbypincode) | **GET** /api/Configuration/byPin |
*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 |
@ -83,6 +84,7 @@ Class | Method | HTTP request | Description
*InstanceApi* | [**instanceDeleteInstance**](doc\/InstanceApi.md#instancedeleteinstance) | **DELETE** /api/Instance/{id} |
*InstanceApi* | [**instanceGet**](doc\/InstanceApi.md#instanceget) | **GET** /api/Instance |
*InstanceApi* | [**instanceGetDetail**](doc\/InstanceApi.md#instancegetdetail) | **GET** /api/Instance/{id} |
*InstanceApi* | [**instanceGetInstanceByPinCode**](doc\/InstanceApi.md#instancegetinstancebypincode) | **GET** /api/Instance/byPin |
*InstanceApi* | [**instanceUpdateinstance**](doc\/InstanceApi.md#instanceupdateinstance) | **PUT** /api/Instance |
*ResourceApi* | [**resourceCreate**](doc\/ResourceApi.md#resourcecreate) | **POST** /api/Resource |
*ResourceApi* | [**resourceDelete**](doc\/ResourceApi.md#resourcedelete) | **DELETE** /api/Resource/{id} |
@ -95,7 +97,7 @@ Class | Method | HTTP request | Description
*SectionApi* | [**sectionDelete**](doc\/SectionApi.md#sectiondelete) | **DELETE** /api/Section/{id} |
*SectionApi* | [**sectionDeleteAllForConfiguration**](doc\/SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} |
*SectionApi* | [**sectionGet**](doc\/SectionApi.md#sectionget) | **GET** /api/Section |
*SectionApi* | [**sectionGetAllBeaconsForInstance**](doc\/SectionApi.md#sectiongetallbeaconsforinstance) | **GET** /api/Section/beacons/{id} |
*SectionApi* | [**sectionGetAllBeaconsForInstance**](doc\/SectionApi.md#sectiongetallbeaconsforinstance) | **GET** /api/Section/beacons/{instanceId} |
*SectionApi* | [**sectionGetAllSectionSubSections**](doc\/SectionApi.md#sectiongetallsectionsubsections) | **GET** /api/Section/{id}/subsections |
*SectionApi* | [**sectionGetArticleDTO**](doc\/SectionApi.md#sectiongetarticledto) | **GET** /api/Section/ArticleDTO |
*SectionApi* | [**sectionGetDetail**](doc\/SectionApi.md#sectiongetdetail) | **GET** /api/Section/{id} |

View File

@ -13,6 +13,7 @@ Method | HTTP request | Description
[**configurationDelete**](ConfigurationApi.md#configurationdelete) | **DELETE** /api/Configuration/{id} |
[**configurationExport**](ConfigurationApi.md#configurationexport) | **GET** /api/Configuration/{id}/export |
[**configurationGet**](ConfigurationApi.md#configurationget) | **GET** /api/Configuration |
[**configurationGetConfigurationsByPinCode**](ConfigurationApi.md#configurationgetconfigurationsbypincode) | **GET** /api/Configuration/byPin |
[**configurationGetDetail**](ConfigurationApi.md#configurationgetdetail) | **GET** /api/Configuration/{id} |
[**configurationImport**](ConfigurationApi.md#configurationimport) | **POST** /api/Configuration/import |
[**configurationUpdate**](ConfigurationApi.md#configurationupdate) | **PUT** /api/Configuration |
@ -192,6 +193,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)
# **configurationGetConfigurationsByPinCode**
> List<ConfigurationDTO> configurationGetConfigurationsByPinCode(pinCode)
### Example
```dart
import 'package:manager_api_new/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = ConfigurationApi();
final pinCode = 56; // int |
try {
final result = api_instance.configurationGetConfigurationsByPinCode(pinCode);
print(result);
} catch (e) {
print('Exception when calling ConfigurationApi->configurationGetConfigurationsByPinCode: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pinCode** | **int**| | [optional]
### Return type
[**List<ConfigurationDTO>**](ConfigurationDTO.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)
# **configurationGetDetail**
> ConfigurationDTO configurationGetDetail(id)

View File

@ -22,6 +22,7 @@ Name | Type | Description | Notes
**isOffline** | **bool** | | [optional]
**instanceId** | **String** | | [optional]
**sectionIds** | **List<String>** | | [optional] [default to const []]
**pinCode** | **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)

View File

@ -22,6 +22,7 @@ Name | Type | Description | Notes
**isOffline** | **bool** | | [optional]
**instanceId** | **String** | | [optional]
**sectionIds** | **List<String>** | | [optional] [default to const []]
**pinCode** | **int** | | [optional]
**sections** | [**List<SectionDTO>**](SectionDTO.md) | | [optional] [default to const []]
**resources** | [**List<ResourceDTO>**](ResourceDTO.md) | | [optional] [default to const []]

View File

@ -11,6 +11,7 @@ Name | Type | Description | Notes
**id** | **String** | | [optional]
**name** | **String** | | [optional]
**dateCreation** | [**DateTime**](DateTime.md) | | [optional]
**pinCode** | **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)

View File

@ -13,6 +13,7 @@ Method | HTTP request | Description
[**instanceDeleteInstance**](InstanceApi.md#instancedeleteinstance) | **DELETE** /api/Instance/{id} |
[**instanceGet**](InstanceApi.md#instanceget) | **GET** /api/Instance |
[**instanceGetDetail**](InstanceApi.md#instancegetdetail) | **GET** /api/Instance/{id} |
[**instanceGetInstanceByPinCode**](InstanceApi.md#instancegetinstancebypincode) | **GET** /api/Instance/byPin |
[**instanceUpdateinstance**](InstanceApi.md#instanceupdateinstance) | **PUT** /api/Instance |
@ -184,6 +185,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)
# **instanceGetInstanceByPinCode**
> InstanceDTO instanceGetInstanceByPinCode(pinCode)
### Example
```dart
import 'package:manager_api_new/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = InstanceApi();
final pinCode = 56; // int |
try {
final result = api_instance.instanceGetInstanceByPinCode(pinCode);
print(result);
} catch (e) {
print('Exception when calling InstanceApi->instanceGetInstanceByPinCode: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pinCode** | **int**| | [optional]
### Return type
[**InstanceDTO**](InstanceDTO.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)
# **instanceUpdateinstance**
> InstanceDTO instanceUpdateinstance(instance)

View File

@ -11,6 +11,7 @@ Name | Type | Description | Notes
**id** | **String** | | [optional]
**name** | **String** | | [optional]
**dateCreation** | [**DateTime**](DateTime.md) | | [optional]
**pinCode** | **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)

View File

@ -13,7 +13,7 @@ Method | HTTP request | Description
[**sectionDelete**](SectionApi.md#sectiondelete) | **DELETE** /api/Section/{id} |
[**sectionDeleteAllForConfiguration**](SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} |
[**sectionGet**](SectionApi.md#sectionget) | **GET** /api/Section |
[**sectionGetAllBeaconsForInstance**](SectionApi.md#sectiongetallbeaconsforinstance) | **GET** /api/Section/beacons/{id} |
[**sectionGetAllBeaconsForInstance**](SectionApi.md#sectiongetallbeaconsforinstance) | **GET** /api/Section/beacons/{instanceId} |
[**sectionGetAllSectionSubSections**](SectionApi.md#sectiongetallsectionsubsections) | **GET** /api/Section/{id}/subsections |
[**sectionGetArticleDTO**](SectionApi.md#sectiongetarticledto) | **GET** /api/Section/ArticleDTO |
[**sectionGetDetail**](SectionApi.md#sectiongetdetail) | **GET** /api/Section/{id} |
@ -202,7 +202,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)
# **sectionGetAllBeaconsForInstance**
> List<SectionDTO> sectionGetAllBeaconsForInstance(id, instanceId)
> List<SectionDTO> sectionGetAllBeaconsForInstance(instanceId)
@ -213,11 +213,10 @@ import 'package:manager_api_new/api.dart';
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = SectionApi();
final id = id_example; // String |
final instanceId = instanceId_example; // String |
try {
final result = api_instance.sectionGetAllBeaconsForInstance(id, instanceId);
final result = api_instance.sectionGetAllBeaconsForInstance(instanceId);
print(result);
} catch (e) {
print('Exception when calling SectionApi->sectionGetAllBeaconsForInstance: $e\n');
@ -228,8 +227,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **String**| |
**instanceId** | **String**| | [optional]
**instanceId** | **String**| |
### Return type

View File

@ -15,6 +15,7 @@ Name | Type | Description | Notes
**expiresIn** | **int** | | [optional]
**expiration** | [**DateTime**](DateTime.md) | | [optional]
**instanceId** | **String** | | [optional]
**pinCode** | **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)

View File

@ -219,6 +219,60 @@ class ConfigurationApi {
return null;
}
/// Performs an HTTP 'GET /api/Configuration/byPin' operation and returns the [Response].
/// Parameters:
///
/// * [int] pinCode:
Future<Response> configurationGetConfigurationsByPinCodeWithHttpInfo({ int? pinCode, }) async {
// ignore: prefer_const_declarations
final path = r'/api/Configuration/byPin';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (pinCode != null) {
queryParams.addAll(_queryParams('', 'pinCode', pinCode));
}
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [int] pinCode:
Future<List<ConfigurationDTO>?> configurationGetConfigurationsByPinCode({ int? pinCode, }) async {
final response = await configurationGetConfigurationsByPinCodeWithHttpInfo( pinCode: pinCode, );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<ConfigurationDTO>') as List)
.cast<ConfigurationDTO>()
.toList();
}
return null;
}
/// Performs an HTTP 'GET /api/Configuration/{id}' operation and returns the [Response].
/// Parameters:
///

View File

@ -203,6 +203,57 @@ class InstanceApi {
return null;
}
/// Performs an HTTP 'GET /api/Instance/byPin' operation and returns the [Response].
/// Parameters:
///
/// * [int] pinCode:
Future<Response> instanceGetInstanceByPinCodeWithHttpInfo({ int? pinCode, }) async {
// ignore: prefer_const_declarations
final path = r'/api/Instance/byPin';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (pinCode != null) {
queryParams.addAll(_queryParams('', 'pinCode', pinCode));
}
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [int] pinCode:
Future<InstanceDTO?> instanceGetInstanceByPinCode({ int? pinCode, }) async {
final response = await instanceGetInstanceByPinCodeWithHttpInfo( pinCode: pinCode, );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'InstanceDTO',) as InstanceDTO;
}
return null;
}
/// Performs an HTTP 'PUT /api/Instance' operation and returns the [Response].
/// Parameters:
///

View File

@ -213,16 +213,14 @@ class SectionApi {
return null;
}
/// Performs an HTTP 'GET /api/Section/beacons/{id}' operation and returns the [Response].
/// Performs an HTTP 'GET /api/Section/beacons/{instanceId}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
///
/// * [String] instanceId:
Future<Response> sectionGetAllBeaconsForInstanceWithHttpInfo(String id, { String? instanceId, }) async {
/// * [String] instanceId (required):
Future<Response> sectionGetAllBeaconsForInstanceWithHttpInfo(String instanceId,) async {
// ignore: prefer_const_declarations
final path = r'/api/Section/beacons/{id}'
.replaceAll('{id}', id);
final path = r'/api/Section/beacons/{instanceId}'
.replaceAll('{instanceId}', instanceId);
// ignore: prefer_final_locals
Object? postBody;
@ -231,10 +229,6 @@ class SectionApi {
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (instanceId != null) {
queryParams.addAll(_queryParams('', 'instanceId', instanceId));
}
const contentTypes = <String>[];
@ -251,11 +245,9 @@ class SectionApi {
/// Parameters:
///
/// * [String] id (required):
///
/// * [String] instanceId:
Future<List<SectionDTO>?> sectionGetAllBeaconsForInstance(String id, { String? instanceId, }) async {
final response = await sectionGetAllBeaconsForInstanceWithHttpInfo(id, instanceId: instanceId, );
/// * [String] instanceId (required):
Future<List<SectionDTO>?> sectionGetAllBeaconsForInstance(String instanceId,) async {
final response = await sectionGetAllBeaconsForInstanceWithHttpInfo(instanceId,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}

View File

@ -27,6 +27,7 @@ class ConfigurationDTO {
this.isOffline,
this.instanceId,
this.sectionIds = const [],
this.pinCode,
});
String? id;
@ -81,6 +82,14 @@ class ConfigurationDTO {
List<String>? sectionIds;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
int? pinCode;
@override
bool operator ==(Object other) => identical(this, other) || other is ConfigurationDTO &&
other.id == id &&
@ -96,7 +105,8 @@ class ConfigurationDTO {
other.isTablet == isTablet &&
other.isOffline == isOffline &&
other.instanceId == instanceId &&
other.sectionIds == sectionIds;
other.sectionIds == sectionIds &&
other.pinCode == pinCode;
@override
int get hashCode =>
@ -114,10 +124,11 @@ class ConfigurationDTO {
(isTablet == null ? 0 : isTablet!.hashCode) +
(isOffline == null ? 0 : isOffline!.hashCode) +
(instanceId == null ? 0 : instanceId!.hashCode) +
(sectionIds == null ? 0 : sectionIds!.hashCode);
(sectionIds == null ? 0 : sectionIds!.hashCode) +
(pinCode == null ? 0 : pinCode!.hashCode);
@override
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, instanceId=$instanceId, sectionIds=$sectionIds]';
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, instanceId=$instanceId, sectionIds=$sectionIds, pinCode=$pinCode]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@ -191,6 +202,11 @@ class ConfigurationDTO {
} else {
json[r'sectionIds'] = null;
}
if (this.pinCode != null) {
json[r'pinCode'] = this.pinCode;
} else {
json[r'pinCode'] = null;
}
return json;
}
@ -231,6 +247,7 @@ class ConfigurationDTO {
sectionIds: json[r'sectionIds'] is List
? (json[r'sectionIds'] as List).cast<String>()
: const [],
pinCode: mapValueOfType<int>(json, r'pinCode'),
);
}
return null;

View File

@ -27,6 +27,7 @@ class ExportConfigurationDTO {
this.isOffline,
this.instanceId,
this.sectionIds = const [],
this.pinCode,
this.sections = const [],
this.resources = const [],
});
@ -83,6 +84,14 @@ class ExportConfigurationDTO {
List<String>? sectionIds;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
int? pinCode;
List<SectionDTO>? sections;
List<ResourceDTO>? resources;
@ -103,6 +112,7 @@ class ExportConfigurationDTO {
other.isOffline == isOffline &&
other.instanceId == instanceId &&
other.sectionIds == sectionIds &&
other.pinCode == pinCode &&
other.sections == sections &&
other.resources == resources;
@ -123,11 +133,12 @@ class ExportConfigurationDTO {
(isOffline == null ? 0 : isOffline!.hashCode) +
(instanceId == null ? 0 : instanceId!.hashCode) +
(sectionIds == null ? 0 : sectionIds!.hashCode) +
(pinCode == null ? 0 : pinCode!.hashCode) +
(sections == null ? 0 : sections!.hashCode) +
(resources == null ? 0 : resources!.hashCode);
@override
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, instanceId=$instanceId, sectionIds=$sectionIds, 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, instanceId=$instanceId, sectionIds=$sectionIds, pinCode=$pinCode, sections=$sections, resources=$resources]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@ -201,6 +212,11 @@ class ExportConfigurationDTO {
} else {
json[r'sectionIds'] = null;
}
if (this.pinCode != null) {
json[r'pinCode'] = this.pinCode;
} else {
json[r'pinCode'] = null;
}
if (this.sections != null) {
json[r'sections'] = this.sections;
} else {
@ -251,6 +267,7 @@ class ExportConfigurationDTO {
sectionIds: json[r'sectionIds'] is List
? (json[r'sectionIds'] as List).cast<String>()
: const [],
pinCode: mapValueOfType<int>(json, r'pinCode'),
sections: SectionDTO.listFromJson(json[r'sections']),
resources: ResourceDTO.listFromJson(json[r'resources']),
);

View File

@ -16,6 +16,7 @@ class Instance {
this.id,
this.name,
this.dateCreation,
this.pinCode,
});
String? id;
@ -30,21 +31,25 @@ class Instance {
///
DateTime? dateCreation;
int? pinCode;
@override
bool operator ==(Object other) => identical(this, other) || other is Instance &&
other.id == id &&
other.name == name &&
other.dateCreation == dateCreation;
other.dateCreation == dateCreation &&
other.pinCode == pinCode;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(id == null ? 0 : id!.hashCode) +
(name == null ? 0 : name!.hashCode) +
(dateCreation == null ? 0 : dateCreation!.hashCode);
(dateCreation == null ? 0 : dateCreation!.hashCode) +
(pinCode == null ? 0 : pinCode!.hashCode);
@override
String toString() => 'Instance[id=$id, name=$name, dateCreation=$dateCreation]';
String toString() => 'Instance[id=$id, name=$name, dateCreation=$dateCreation, pinCode=$pinCode]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@ -63,6 +68,11 @@ class Instance {
} else {
json[r'dateCreation'] = null;
}
if (this.pinCode != null) {
json[r'pinCode'] = this.pinCode;
} else {
json[r'pinCode'] = null;
}
return json;
}
@ -88,6 +98,7 @@ class Instance {
id: mapValueOfType<String>(json, r'id'),
name: mapValueOfType<String>(json, r'name'),
dateCreation: mapDateTime(json, r'dateCreation', ''),
pinCode: mapValueOfType<int>(json, r'pinCode'),
);
}
return null;

View File

@ -16,6 +16,7 @@ class InstanceDTO {
this.id,
this.name,
this.dateCreation,
this.pinCode,
});
String? id;
@ -30,21 +31,25 @@ class InstanceDTO {
///
DateTime? dateCreation;
int? pinCode;
@override
bool operator ==(Object other) => identical(this, other) || other is InstanceDTO &&
other.id == id &&
other.name == name &&
other.dateCreation == dateCreation;
other.dateCreation == dateCreation &&
other.pinCode == pinCode;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(id == null ? 0 : id!.hashCode) +
(name == null ? 0 : name!.hashCode) +
(dateCreation == null ? 0 : dateCreation!.hashCode);
(dateCreation == null ? 0 : dateCreation!.hashCode) +
(pinCode == null ? 0 : pinCode!.hashCode);
@override
String toString() => 'InstanceDTO[id=$id, name=$name, dateCreation=$dateCreation]';
String toString() => 'InstanceDTO[id=$id, name=$name, dateCreation=$dateCreation, pinCode=$pinCode]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@ -63,6 +68,11 @@ class InstanceDTO {
} else {
json[r'dateCreation'] = null;
}
if (this.pinCode != null) {
json[r'pinCode'] = this.pinCode;
} else {
json[r'pinCode'] = null;
}
return json;
}
@ -88,6 +98,7 @@ class InstanceDTO {
id: mapValueOfType<String>(json, r'id'),
name: mapValueOfType<String>(json, r'name'),
dateCreation: mapDateTime(json, r'dateCreation', ''),
pinCode: mapValueOfType<int>(json, r'pinCode'),
);
}
return null;

View File

@ -20,6 +20,7 @@ class TokenDTO {
this.expiresIn,
this.expiration,
this.instanceId,
this.pinCode,
});
String? accessToken;
@ -48,6 +49,8 @@ class TokenDTO {
String? instanceId;
int? pinCode;
@override
bool operator ==(Object other) => identical(this, other) || other is TokenDTO &&
other.accessToken == accessToken &&
@ -56,7 +59,8 @@ class TokenDTO {
other.tokenType == tokenType &&
other.expiresIn == expiresIn &&
other.expiration == expiration &&
other.instanceId == instanceId;
other.instanceId == instanceId &&
other.pinCode == pinCode;
@override
int get hashCode =>
@ -67,10 +71,11 @@ class TokenDTO {
(tokenType == null ? 0 : tokenType!.hashCode) +
(expiresIn == null ? 0 : expiresIn!.hashCode) +
(expiration == null ? 0 : expiration!.hashCode) +
(instanceId == null ? 0 : instanceId!.hashCode);
(instanceId == null ? 0 : instanceId!.hashCode) +
(pinCode == null ? 0 : pinCode!.hashCode);
@override
String toString() => 'TokenDTO[accessToken=$accessToken, refreshToken=$refreshToken, scope=$scope, tokenType=$tokenType, expiresIn=$expiresIn, expiration=$expiration, instanceId=$instanceId]';
String toString() => 'TokenDTO[accessToken=$accessToken, refreshToken=$refreshToken, scope=$scope, tokenType=$tokenType, expiresIn=$expiresIn, expiration=$expiration, instanceId=$instanceId, pinCode=$pinCode]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@ -109,6 +114,11 @@ class TokenDTO {
} else {
json[r'instanceId'] = null;
}
if (this.pinCode != null) {
json[r'pinCode'] = this.pinCode;
} else {
json[r'pinCode'] = null;
}
return json;
}
@ -138,6 +148,7 @@ class TokenDTO {
expiresIn: mapValueOfType<int>(json, r'expires_in'),
expiration: mapDateTime(json, r'expiration', ''),
instanceId: mapValueOfType<String>(json, r'instanceId'),
pinCode: mapValueOfType<int>(json, r'pinCode'),
);
}
return null;