fixed the bug and add the notes
parent
9bc743f7c9
commit
95c1dcca63
File diff suppressed because one or more lines are too long
|
@ -953,6 +953,35 @@ $ curl -i -H "Content-Type: application/TBD" -X POST -d 'file: (binary)' {{base_
|
|||
$ curl -i -X GET {{base_url}}/knowledgefiles/{id}/restore
|
||||
```
|
||||
|
||||
### Menu
|
||||
* GET Menu by ID
|
||||
```bash
|
||||
$ curl -i -X GET {{base_url}}/menus/{id}
|
||||
```
|
||||
Result
|
||||
|
||||
| Name | Data Type | Description |
|
||||
|---------------|-----------|-------------------------------------------|
|
||||
| id | integer | Menu ID |
|
||||
| name | string | Menu name |
|
||||
| path | string | Menu path |
|
||||
| parent_menu_id| integer | Parent Menu ID |
|
||||
| is_hidden | boolean | The menu status| |
|
||||
|
||||
* GET All Menus
|
||||
```bash
|
||||
$ curl -i -X GET {{base_url}}/menus
|
||||
```
|
||||
* PUT Update a Menu
|
||||
```bash
|
||||
$ curl -i -H "Content-Type: application/json" -X PUT -d '{"data":{"is_hidden": false}}' {{base_url}}/menus/{id}
|
||||
```
|
||||
* Get All Menus for web
|
||||
```bash
|
||||
$ curl -i -X GET {{base_url}}/web/menus
|
||||
```
|
||||
|
||||
|
||||
### Meter
|
||||
* GET Meter by ID
|
||||
|
||||
|
|
|
@ -94,11 +94,10 @@ class MenuItem:
|
|||
new_values = json.loads(raw_json)
|
||||
|
||||
if 'is_hidden' not in new_values['data'].keys() or \
|
||||
not isinstance(new_values['data']['is_hidden'], str) or \
|
||||
len(str.strip(new_values['data']['is_hidden'])) == 0:
|
||||
not isinstance(new_values['data']['is_hidden'], bool):
|
||||
raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST',
|
||||
description='API.INVALID_IS_HIDDEN')
|
||||
is_hidden = str.strip(new_values['data']['is_hidden'])
|
||||
is_hidden = new_values['data']['is_hidden']
|
||||
|
||||
cnx = mysql.connector.connect(**config.myems_system_db)
|
||||
cursor = cnx.cursor()
|
||||
|
|
Loading…
Reference in New Issue