diff --git a/myems-api/README.md b/myems-api/README.md index 9e8ae9e2..e016a91f 100644 --- a/myems-api/README.md +++ b/myems-api/README.md @@ -741,6 +741,7 @@ Result | is_output_counted | boolean | Indicates if the Equipment's energy output is counted for aggregating| | | cost_center | Object | Cost Center Object | | description | string | Equipment description | +| qrcode | string | QRCode in String | * GET All Equipments ```bash @@ -853,6 +854,7 @@ Result | is_output_counted | boolean | Indicates if the combined equipment's energy output is counted for aggregating| | | cost_center | Object | Cost Center Object | | description | string | Combined Equipment description | +| qrcode | string | QRCode in String | * GET All Equipments ```bash @@ -1874,6 +1876,7 @@ Result | contact | Object | Contact Object | | cost_center | Object | Cost Center Object | | description | string | Tenant description | +| qrcode | string | QRCode in String | * GET All Tenants ```bash diff --git a/myems-api/core/combinedequipment.py b/myems-api/core/combinedequipment.py index ac737a08..b21d33d2 100644 --- a/myems-api/core/combinedequipment.py +++ b/myems-api/core/combinedequipment.py @@ -51,7 +51,8 @@ class CombinedEquipmentCollection: "is_input_counted": bool(row['is_input_counted']), "is_output_counted": bool(row['is_output_counted']), "cost_center": cost_center, - "description": row['description']} + "description": row['description'], + "qrcode": 'combinedequipment:' + row['uuid']} result.append(meta_result) cursor.close() @@ -198,7 +199,8 @@ class CombinedEquipmentItem: "is_input_counted": bool(row['is_input_counted']), "is_output_counted": bool(row['is_output_counted']), "cost_center": cost_center, - "description": row['description']} + "description": row['description'], + "qrcode": 'combinedequipment:' + row['uuid']} resp.text = json.dumps(meta_result) diff --git a/myems-api/core/equipment.py b/myems-api/core/equipment.py index b1250f57..562904ec 100644 --- a/myems-api/core/equipment.py +++ b/myems-api/core/equipment.py @@ -51,7 +51,8 @@ class EquipmentCollection: "is_input_counted": bool(row['is_input_counted']), "is_output_counted": bool(row['is_output_counted']), "cost_center": cost_center, - "description": row['description']} + "description": row['description'], + "qrcode": 'equipment:' + row['uuid']} result.append(meta_result) cursor.close() @@ -198,7 +199,8 @@ class EquipmentItem: "is_input_counted": bool(row['is_input_counted']), "is_output_counted": bool(row['is_output_counted']), "cost_center": cost_center, - "description": row['description']} + "description": row['description'], + "qrcode": 'equipment:' + row['uuid']} resp.text = json.dumps(meta_result) diff --git a/myems-api/core/tenant.py b/myems-api/core/tenant.py index 493327df..f6c77e28 100644 --- a/myems-api/core/tenant.py +++ b/myems-api/core/tenant.py @@ -100,7 +100,8 @@ class TenantCollection: "is_in_lease": bool(row['is_in_lease']), "contact": contact, "cost_center": cost_center, - "description": row['description']} + "description": row['description'], + "qrcode": 'tenant:' + row['uuid']} result.append(meta_result) cursor.close() @@ -396,7 +397,8 @@ class TenantItem: "is_in_lease": bool(row['is_in_lease']), "contact": contact, "cost_center": cost_center, - "description": row['description']} + "description": row['description'], + "qrcode": 'tenant:' + row['uuid']} resp.text = json.dumps(meta_result)