go_api_setting.py 597 B

12345678910111213141516171819202122
  1. from .tool.func import *
  2. async def api_setting(name = 'Test', method = '', data = ''):
  3. other_set = {}
  4. other_set["set_name"] = name
  5. if method == '':
  6. method = flask.request.method
  7. func_name = sys._getframe().f_code.co_name
  8. if method == 'PUT':
  9. func_name += '_put'
  10. if data == '':
  11. other_set['data'] = flask.request.form.get('data', 'Test')
  12. else:
  13. other_set['data'] = data
  14. return await python_to_golang(func_name, other_set)
  15. async def api_setting_exter(name = 'Test'):
  16. return flask.jsonify(await api_setting(name))