2
0

go_api_func_ip.py 609 B

123456789101112131415161718192021222324
  1. from .tool.func import *
  2. async def api_func_ip(data = 'Test'):
  3. other_set = {}
  4. other_set["ip"] = ip_check()
  5. func_name = sys._getframe().f_code.co_name
  6. if flask.request.method == 'POST':
  7. func_name += '_post'
  8. for_a = 1
  9. while 1:
  10. data = flask.request.form.get('data_' + str(for_a), '')
  11. if data == '':
  12. break
  13. else:
  14. other_set['data_' + str(for_a)] = data
  15. for_a += 1
  16. else:
  17. other_set["data"] = data
  18. return flask.jsonify(await python_to_golang(func_name, other_set))