mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-26 15:57:16 +00:00
Type fixed
This commit is contained in:
parent
7669373002
commit
e66b7aa19a
2 changed files with 5 additions and 4 deletions
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*-coding:UTF-8 -*
|
# -*-coding:UTF-8 -*
|
||||||
|
import base64
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
@ -234,9 +235,9 @@ def get_item_as_txt(request_dict):
|
||||||
return {'status': 'error', 'reason': 'Item not found'}, 404
|
return {'status': 'error', 'reason': 'Item not found'}, 404
|
||||||
|
|
||||||
item_content = get_item_content(item_id)
|
item_content = get_item_content(item_id)
|
||||||
#encoded_item_content = item_content.encode("UTF-8")
|
encoded_item_content = item_content.encode("UTF-8")
|
||||||
#base64_output = base64.b64encode(encoded_item_content)
|
base64_output = base64.b64encode(encoded_item_content)
|
||||||
dict_item = {'id': item_id, 'content': item_content}
|
dict_item = {'id': item_id, 'content': base64_output}
|
||||||
|
|
||||||
return dict_item, 200
|
return dict_item, 200
|
||||||
|
|
||||||
|
|
|
@ -315,7 +315,7 @@ def get_item_content():
|
||||||
|
|
||||||
@restApi.route("api/v1/get/item/content/text", methods=['POST'])
|
@restApi.route("api/v1/get/item/content/text", methods=['POST'])
|
||||||
@token_required('read_only')
|
@token_required('read_only')
|
||||||
def get_item_content():
|
def get_item_content_text():
|
||||||
|
|
||||||
data = request.get_json()
|
data = request.get_json()
|
||||||
item_id = data.get('id', None)
|
item_id = data.get('id', None)
|
||||||
|
|
Loading…
Reference in a new issue