Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
nengyuanzhang committed Jan 24, 2024
2 parents 0a9b64e + b188a69 commit 3a2e72c
Show file tree
Hide file tree
Showing 4 changed files with 413 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- added gateway export, import and clone functions to myems-api, myems-admin
- added equipment export, import and clone functions to myems-api
- added combined equipment export, import and clone functions to myems-api
- added shopfloor export, import and clone functions to myems-api
-
### Changed
### Fixed
### Removed
Expand Down
106 changes: 105 additions & 1 deletion myems-api/MyEMS.postman_collection.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"info": {
"_postman_id": "80e53049-bdd8-4303-bcf6-c90a1ec70e16",
"_postman_id": "819e9938-623f-4d5f-bae3-2c0a68ba6ff2",
"name": "MyEMS",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "10906958"
Expand Down Expand Up @@ -12219,6 +12219,110 @@
}
},
"response": []
},
{
"name": "Export a Shopfloor by ID to JSON",
"request": {
"method": "GET",
"header": [
{
"key": "User-UUID",
"value": "dcdb67d1-6116-4987-916f-6fc6cf2bc0e4",
"type": "default"
},
{
"key": "Token",
"value": "aababcb9199f5fdcd7489dbd35ea37e59508623fd2e15f574ef2a63192c4b9aa91f4f0285b875be4b26a2e239581f69875401eb86022ed9603b863cc58e828ef",
"type": "default"
},
{
"key": "API-Key",
"value": "c5ee62be2792ed4a59de1096511934288f4c192363529dafc00b3b35f81f224a5cc44c9aae46ac8966dc52f1ea0039395551bdf3f86aff6bb2b6b032834fc139",
"type": "default",
"disabled": true
}
],
"url": {
"raw": "{{base_url}}/shopfloors/1/export",
"host": [
"{{base_url}}"
],
"path": [
"shopfloors",
"1",
"export"
]
}
},
"response": []
},
{
"name": "Import a Shopfloor from JSON",
"request": {
"method": "POST",
"header": [
{
"key": "User-UUID",
"value": "dcdb67d1-6116-4987-916f-6fc6cf2bc0e4",
"type": "text"
},
{
"key": "Token",
"value": "aababcb9199f5fdcd7489dbd35ea37e59508623fd2e15f574ef2a63192c4b9aa91f4f0285b875be4b26a2e239581f69875401eb86022ed9603b863cc58e828ef",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"id\": 1,\r\n \"name\": \"车间10\",\r\n \"uuid\": \"d03837fd-9d30-44fe-9443-154f7c7e15f1\",\r\n \"area\": 99999.999,\r\n \"is_input_counted\": true,\r\n \"contact\": {\r\n \"id\": 1,\r\n \"name\": \"江工\",\r\n \"uuid\": \"5c5ce6e8-8d00-46b3-9602-4e1520a8b43f\"\r\n },\r\n \"cost_center\": {\r\n \"id\": 1,\r\n \"name\": \"成本中心\",\r\n \"uuid\": \"d97b9736-c4f9-4005-a534-6af3487303ad\"\r\n },\r\n \"description\": \"MyEMS Project\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{base_url}}/shopfloors/import",
"host": [
"{{base_url}}"
],
"path": [
"shopfloors",
"import"
]
}
},
"response": []
},
{
"name": "Clone a Shopfloor by ID",
"request": {
"method": "POST",
"header": [
{
"key": "User-UUID",
"value": "dcdb67d1-6116-4987-916f-6fc6cf2bc0e4",
"type": "text"
},
{
"key": "Token",
"value": "aababcb9199f5fdcd7489dbd35ea37e59508623fd2e15f574ef2a63192c4b9aa91f4f0285b875be4b26a2e239581f69875401eb86022ed9603b863cc58e828ef",
"type": "text"
}
],
"url": {
"raw": "{{base_url}}/shopfloors/1/clone",
"host": [
"{{base_url}}"
],
"path": [
"shopfloors",
"1",
"clone"
]
}
},
"response": []
}
]
},
Expand Down
6 changes: 6 additions & 0 deletions myems-api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,12 @@
shopfloor.ShopfloorCommandCollection())
api.add_route('/shopfloors/{id_}/commands/{cid}',
shopfloor.ShopfloorCommandItem())
api.add_route('/shopfloors/{id_}/export',
shopfloor.ShopfloorExport())
api.add_route('/shopfloors/import',
shopfloor.ShopfloorImport())
api.add_route('/shopfloors/{id_}/clone',
shopfloor.ShopfloorClone())

api.add_route('/spaces',
space.SpaceCollection())
Expand Down
Loading

0 comments on commit 3a2e72c

Please sign in to comment.