fixes bugs and add project id staging

This commit is contained in:
mohammad
2025-02-10 10:26:02 +03:00
parent 48733fd65e
commit 9897c19dad
14 changed files with 67 additions and 86 deletions

View File

@ -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) {