mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-27 02:24:55 +00:00
fixes bugs and add project id staging
This commit is contained in:
@ -51,14 +51,11 @@ class DevicesAPI {
|
||||
static Future<Map<String, dynamic>> controlDevice(
|
||||
DeviceControlModel controlModel, String deviceId) async {
|
||||
try {
|
||||
print('object-*/-*/-*/${controlModel.toJson()}');
|
||||
final response = await _httpService.post(
|
||||
path: ApiEndpoints.controlDevice.replaceAll('{deviceUuid}', deviceId),
|
||||
body: controlModel.toJson(),
|
||||
showServerMessage: true,
|
||||
expectedResponseModel: (json) {
|
||||
print('object-*/-*/-*/${json}');
|
||||
|
||||
return json;
|
||||
},
|
||||
);
|
||||
@ -191,7 +188,6 @@ class DevicesAPI {
|
||||
path: ApiEndpoints.deviceByUuid.replaceAll('{deviceUuid}', deviceId),
|
||||
showServerMessage: false,
|
||||
expectedResponseModel: (json) {
|
||||
print('object-*-*-*${json}');
|
||||
return json;
|
||||
});
|
||||
return response;
|
||||
@ -229,7 +225,7 @@ class DevicesAPI {
|
||||
.replaceAll('{communityUuid}', communityUuid)
|
||||
.replaceAll('{spaceUuid}', spaceUuid)
|
||||
.replaceAll('{subSpaceUuid}', roomId)
|
||||
.replaceAll('{projectUuid}', TempConst.projectId);
|
||||
.replaceAll('{projectUuid}', TempConst.projectIdDev);
|
||||
|
||||
final response = await _httpService.get(
|
||||
path: path,
|
||||
@ -569,21 +565,16 @@ class DevicesAPI {
|
||||
required String communityUuid,
|
||||
required String spaceUuid,
|
||||
}) async {
|
||||
print('communityUuid=$communityUuid');
|
||||
print('spaceUuid=$spaceUuid');
|
||||
print('projectUuid=${TempConst.projectId}');
|
||||
|
||||
try {
|
||||
final String path = ApiEndpoints.getAllDevices
|
||||
.replaceAll('{communityUuid}', communityUuid)
|
||||
.replaceAll('{spaceUuid}', spaceUuid)
|
||||
.replaceAll('{projectUuid}', TempConst.projectId);
|
||||
.replaceAll('{projectUuid}', TempConst.projectIdDev);
|
||||
|
||||
final response = await _httpService.get(
|
||||
path: path,
|
||||
showServerMessage: false,
|
||||
expectedResponseModel: (json) {
|
||||
print('response-*/-*/$json');
|
||||
final data = json['data'];
|
||||
|
||||
if (data == null || data.isEmpty) {
|
||||
|
||||
@ -150,7 +150,7 @@ class HomeCreation {
|
||||
final fullPath = ApiEndpoints.addSubSpace
|
||||
.replaceAll('{communityUuid}', communityId)
|
||||
.replaceAll('{spaceUuid}', spaceId)
|
||||
.replaceAll('{projectUuid}', TempConst.projectId);
|
||||
.replaceAll('{projectUuid}', TempConst.projectIdDev);
|
||||
final response = await _httpService.post(
|
||||
path: fullPath,
|
||||
body: body,
|
||||
|
||||
@ -40,7 +40,7 @@ class HomeManagementAPI {
|
||||
final path = ApiEndpoints.spaceDevices
|
||||
.replaceAll('{communityUuid}', communityUuid)
|
||||
.replaceAll('{spaceUuid}', spaceUuid)
|
||||
.replaceAll('{projectUuid}', TempConst.projectId);
|
||||
.replaceAll('{projectUuid}', TempConst.projectIdDev);
|
||||
|
||||
await _httpService.get(
|
||||
path: path,
|
||||
@ -67,6 +67,7 @@ class HomeManagementAPI {
|
||||
try {
|
||||
final response = await _httpService.post(
|
||||
path: ApiEndpoints.assignDeviceToRoom
|
||||
.replaceAll('{projectUuid}', TempConst.projectIdDev)
|
||||
.replaceAll('{communityUuid}', communityId)
|
||||
.replaceAll('{spaceUuid}', spaceId)
|
||||
.replaceAll('{subSpaceUuid}', subSpaceId)
|
||||
@ -90,7 +91,7 @@ class HomeManagementAPI {
|
||||
.replaceAll('{spaceUuid}', spaceId)
|
||||
.replaceAll('{subSpaceUuid}', subSpaceId)
|
||||
.replaceAll('{deviceUuid}', deviceId)
|
||||
.replaceAll('{projectUuid}', TempConst.projectId),
|
||||
.replaceAll('{projectUuid}', TempConst.projectIdDev),
|
||||
expectedResponseModel: (json) {
|
||||
return json;
|
||||
},
|
||||
|
||||
@ -57,7 +57,7 @@ class SceneApi {
|
||||
path: ApiEndpoints.getUnitScenes
|
||||
.replaceAll('{spaceUuid}', unitId)
|
||||
.replaceAll('{communityUuid}', communityId)
|
||||
.replaceAll('{projectUuid}', TempConst.projectId),
|
||||
.replaceAll('{projectUuid}', TempConst.projectIdDev),
|
||||
queryParameters: {'showInHomePage': showInDevice},
|
||||
showServerMessage: false,
|
||||
expectedResponseModel: (json) {
|
||||
|
||||
@ -38,7 +38,7 @@ class SpacesAPI {
|
||||
final path = ApiEndpoints.listSubspace
|
||||
.replaceFirst('{communityUuid}', communityId)
|
||||
.replaceFirst('{spaceUuid}', spaceId)
|
||||
.replaceAll('{projectUuid}', TempConst.projectId);
|
||||
.replaceAll('{projectUuid}', TempConst.projectIdDev);
|
||||
|
||||
final response = await _httpService.get(
|
||||
path: path,
|
||||
@ -71,7 +71,7 @@ class SpacesAPI {
|
||||
path: ApiEndpoints.invitationCode
|
||||
.replaceAll('{unitUuid}', unitId)
|
||||
.replaceAll('{communityUuid}', communityId)
|
||||
.replaceAll('{projectUuid}', TempConst.projectId),
|
||||
.replaceAll('{projectUuid}', TempConst.projectIdDev),
|
||||
showServerMessage: false,
|
||||
expectedResponseModel: (json) {
|
||||
if (json != null && json['data'] != null) {
|
||||
|
||||
Reference in New Issue
Block a user