Update code from macAddress to Minor (for BeaconId).
This commit is contained in:
parent
ebf9cabcb1
commit
4f346a1641
@ -1,7 +1,7 @@
|
|||||||
import 'package:manager_api/api.dart';
|
import 'package:manager_api/api.dart';
|
||||||
|
|
||||||
class BeaconSection {
|
class BeaconSection {
|
||||||
String? macAddress;
|
int? minorBeaconId;
|
||||||
String? configurationId;
|
String? configurationId;
|
||||||
String? sectionId;
|
String? sectionId;
|
||||||
/*int? rssi;
|
/*int? rssi;
|
||||||
@ -9,11 +9,11 @@ class BeaconSection {
|
|||||||
String? proximityUUID;*/
|
String? proximityUUID;*/
|
||||||
bool? found = false;
|
bool? found = false;
|
||||||
|
|
||||||
BeaconSection({this.macAddress, this.configurationId, this.sectionId, this.found});
|
BeaconSection({this.minorBeaconId, this.configurationId, this.sectionId, this.found});
|
||||||
|
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
'macAddress': macAddress,
|
'minorBeaconId': minorBeaconId,
|
||||||
'configurationId': configurationId,
|
'configurationId': configurationId,
|
||||||
'sectionId': sectionId,
|
'sectionId': sectionId,
|
||||||
/*'rssi': rssi,
|
/*'rssi': rssi,
|
||||||
@ -25,7 +25,7 @@ class BeaconSection {
|
|||||||
|
|
||||||
factory BeaconSection.fromJson(Map<String, dynamic> json) {
|
factory BeaconSection.fromJson(Map<String, dynamic> json) {
|
||||||
return BeaconSection(
|
return BeaconSection(
|
||||||
macAddress: json['macAddress'] as String,
|
minorBeaconId: json['minorBeaconId'] as int,
|
||||||
configurationId: json['configurationId'] as String,
|
configurationId: json['configurationId'] as String,
|
||||||
sectionId: json['sectionId'] as String,
|
sectionId: json['sectionId'] as String,
|
||||||
/*rssi: json['rssi'] as int,
|
/*rssi: json['rssi'] as int,
|
||||||
@ -37,6 +37,6 @@ class BeaconSection {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'BeaconSection{macAddress: $macAddress, sectionId: $sectionId, configurationId: $configurationId, found: $found}';
|
return 'BeaconSection{minorBeaconId: $minorBeaconId, sectionId: $sectionId, configurationId: $configurationId, found: $found}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -136,7 +136,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
|
|||||||
if(visitAppContext.beaconSections == null) {
|
if(visitAppContext.beaconSections == null) {
|
||||||
List<SectionDTO>? sections = await ApiService.getAllBeacons(client, visitAppContext.instanceId!);
|
List<SectionDTO>? sections = await ApiService.getAllBeacons(client, visitAppContext.instanceId!);
|
||||||
if(sections != null && sections.isNotEmpty) {
|
if(sections != null && sections.isNotEmpty) {
|
||||||
List<BeaconSection> beaconSections = sections.map((e) => BeaconSection(macAddress: e.beaconId, configurationId: e.configurationId, sectionId: e.id)).toList();
|
List<BeaconSection> beaconSections = sections.map((e) => BeaconSection(minorBeaconId: e.beaconId, configurationId: e.configurationId, sectionId: e.id)).toList();
|
||||||
visitAppContext.beaconSections = beaconSections;
|
visitAppContext.beaconSections = beaconSections;
|
||||||
print("Got some Beacons for you");
|
print("Got some Beacons for you");
|
||||||
print(beaconSections);
|
print(beaconSections);
|
||||||
|
|||||||
@ -165,9 +165,9 @@ class _VisitPageState extends State<VisitPage> with WidgetsBindingObserver {
|
|||||||
if(result.beacons.isNotEmpty) {
|
if(result.beacons.isNotEmpty) {
|
||||||
print(result);
|
print(result);
|
||||||
print(result.beacons.map((b) => b.macAddress));
|
print(result.beacons.map((b) => b.macAddress));
|
||||||
print(visitAppContext.beaconSections!.map((bb) => bb!.macAddress));
|
print(visitAppContext.beaconSections!.map((bb) => bb!.minorBeaconId));
|
||||||
|
|
||||||
var beaconList = visitAppContext.beaconSections!.where((bs) => result.beacons.any((element) => element.macAddress == bs!.macAddress && element.accuracy < meterToBeacon));
|
var beaconList = visitAppContext.beaconSections!.where((bs) => result.beacons.any((element) => element.minor == bs!.minorBeaconId && element.accuracy < meterToBeacon));
|
||||||
|
|
||||||
if(beaconList.isNotEmpty) {
|
if(beaconList.isNotEmpty) {
|
||||||
// FILTER CONFIG
|
// FILTER CONFIG
|
||||||
|
|||||||
@ -1211,24 +1211,19 @@ paths:
|
|||||||
type: string
|
type: string
|
||||||
security:
|
security:
|
||||||
- bearer: []
|
- bearer: []
|
||||||
/api/Section/beacons/{id}:
|
/api/Section/beacons/{instanceId}:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- Section
|
- Section
|
||||||
operationId: Section_GetAllBeaconsForInstance
|
operationId: Section_GetAllBeaconsForInstance
|
||||||
parameters:
|
parameters:
|
||||||
- name: instanceId
|
- name: instanceId
|
||||||
in: query
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
nullable: true
|
|
||||||
x-position: 1
|
|
||||||
- name: id
|
|
||||||
in: path
|
in: path
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
x-position: 2
|
nullable: true
|
||||||
|
x-position: 1
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: ''
|
description: ''
|
||||||
|
|||||||
@ -95,7 +95,7 @@ Class | Method | HTTP request | Description
|
|||||||
*SectionApi* | [**sectionDelete**](doc\/SectionApi.md#sectiondelete) | **DELETE** /api/Section/{id} |
|
*SectionApi* | [**sectionDelete**](doc\/SectionApi.md#sectiondelete) | **DELETE** /api/Section/{id} |
|
||||||
*SectionApi* | [**sectionDeleteAllForConfiguration**](doc\/SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} |
|
*SectionApi* | [**sectionDeleteAllForConfiguration**](doc\/SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} |
|
||||||
*SectionApi* | [**sectionGet**](doc\/SectionApi.md#sectionget) | **GET** /api/Section |
|
*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* | [**sectionGetAllSectionSubSections**](doc\/SectionApi.md#sectiongetallsectionsubsections) | **GET** /api/Section/{id}/subsections |
|
||||||
*SectionApi* | [**sectionGetArticleDTO**](doc\/SectionApi.md#sectiongetarticledto) | **GET** /api/Section/ArticleDTO |
|
*SectionApi* | [**sectionGetArticleDTO**](doc\/SectionApi.md#sectiongetarticledto) | **GET** /api/Section/ArticleDTO |
|
||||||
*SectionApi* | [**sectionGetDetail**](doc\/SectionApi.md#sectiongetdetail) | **GET** /api/Section/{id} |
|
*SectionApi* | [**sectionGetDetail**](doc\/SectionApi.md#sectiongetdetail) | **GET** /api/Section/{id} |
|
||||||
|
|||||||
@ -13,7 +13,7 @@ Method | HTTP request | Description
|
|||||||
[**sectionDelete**](SectionApi.md#sectiondelete) | **DELETE** /api/Section/{id} |
|
[**sectionDelete**](SectionApi.md#sectiondelete) | **DELETE** /api/Section/{id} |
|
||||||
[**sectionDeleteAllForConfiguration**](SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} |
|
[**sectionDeleteAllForConfiguration**](SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} |
|
||||||
[**sectionGet**](SectionApi.md#sectionget) | **GET** /api/Section |
|
[**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 |
|
[**sectionGetAllSectionSubSections**](SectionApi.md#sectiongetallsectionsubsections) | **GET** /api/Section/{id}/subsections |
|
||||||
[**sectionGetArticleDTO**](SectionApi.md#sectiongetarticledto) | **GET** /api/Section/ArticleDTO |
|
[**sectionGetArticleDTO**](SectionApi.md#sectiongetarticledto) | **GET** /api/Section/ArticleDTO |
|
||||||
[**sectionGetDetail**](SectionApi.md#sectiongetdetail) | **GET** /api/Section/{id} |
|
[**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)
|
[[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**
|
# **sectionGetAllBeaconsForInstance**
|
||||||
> List<SectionDTO> sectionGetAllBeaconsForInstance(id, instanceId)
|
> List<SectionDTO> sectionGetAllBeaconsForInstance(instanceId)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -213,11 +213,10 @@ import 'package:manager_api/api.dart';
|
|||||||
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
final api_instance = SectionApi();
|
final api_instance = SectionApi();
|
||||||
final id = id_example; // String |
|
|
||||||
final instanceId = instanceId_example; // String |
|
final instanceId = instanceId_example; // String |
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final result = api_instance.sectionGetAllBeaconsForInstance(id, instanceId);
|
final result = api_instance.sectionGetAllBeaconsForInstance(instanceId);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Exception when calling SectionApi->sectionGetAllBeaconsForInstance: $e\n');
|
print('Exception when calling SectionApi->sectionGetAllBeaconsForInstance: $e\n');
|
||||||
@ -228,8 +227,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**id** | **String**| |
|
**instanceId** | **String**| |
|
||||||
**instanceId** | **String**| | [optional]
|
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
|
|||||||
@ -213,16 +213,14 @@ class SectionApi {
|
|||||||
return null;
|
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:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] id (required):
|
/// * [String] instanceId (required):
|
||||||
///
|
Future<Response> sectionGetAllBeaconsForInstanceWithHttpInfo(String instanceId,) async {
|
||||||
/// * [String] instanceId:
|
|
||||||
Future<Response> sectionGetAllBeaconsForInstanceWithHttpInfo(String id, { String? instanceId, }) async {
|
|
||||||
// ignore: prefer_const_declarations
|
// ignore: prefer_const_declarations
|
||||||
final path = r'/api/Section/beacons/{id}'
|
final path = r'/api/Section/beacons/{instanceId}'
|
||||||
.replaceAll('{id}', id);
|
.replaceAll('{instanceId}', instanceId);
|
||||||
|
|
||||||
// ignore: prefer_final_locals
|
// ignore: prefer_final_locals
|
||||||
Object? postBody;
|
Object? postBody;
|
||||||
@ -231,10 +229,6 @@ class SectionApi {
|
|||||||
final headerParams = <String, String>{};
|
final headerParams = <String, String>{};
|
||||||
final formParams = <String, String>{};
|
final formParams = <String, String>{};
|
||||||
|
|
||||||
if (instanceId != null) {
|
|
||||||
queryParams.addAll(_queryParams('', 'instanceId', instanceId));
|
|
||||||
}
|
|
||||||
|
|
||||||
const contentTypes = <String>[];
|
const contentTypes = <String>[];
|
||||||
|
|
||||||
|
|
||||||
@ -251,11 +245,9 @@ class SectionApi {
|
|||||||
|
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] id (required):
|
/// * [String] instanceId (required):
|
||||||
///
|
Future<List<SectionDTO>?> sectionGetAllBeaconsForInstance(String instanceId,) async {
|
||||||
/// * [String] instanceId:
|
final response = await sectionGetAllBeaconsForInstanceWithHttpInfo(instanceId,);
|
||||||
Future<List<SectionDTO>?> sectionGetAllBeaconsForInstance(String id, { String? instanceId, }) async {
|
|
||||||
final response = await sectionGetAllBeaconsForInstanceWithHttpInfo(id, instanceId: instanceId, );
|
|
||||||
if (response.statusCode >= HttpStatus.badRequest) {
|
if (response.statusCode >= HttpStatus.badRequest) {
|
||||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user