| 1234567891011121314151617181920212223 |
- from .tool.func import *
- def api_bbs_w_comment_n(db_set, bbs_num = "", post_num = "", tool = "length"):
- other_set = {}
- other_set["bbs_num"] = str(bbs_num)
- other_set["post_num"] = str(post_num)
- other_set["tool"] = tool
- other_set = json.dumps(other_set)
- if platform.system() == 'Linux':
- if platform.machine() in ["AMD64", "x86_64"]:
- data = subprocess.Popen([os.path.join(".", "route_go", "bin", "main.amd64.bin"), sys._getframe().f_code.co_name, db_set, other_set], stdout = subprocess.PIPE).communicate()[0]
- else:
- data = subprocess.Popen([os.path.join(".", "route_go", "bin", "main.arm64.bin"), sys._getframe().f_code.co_name, db_set, other_set], stdout = subprocess.PIPE).communicate()[0]
- else:
- if platform.machine() in ["AMD64", "x86_64"]:
- data = subprocess.Popen([os.path.join(".", "route_go", "bin", "main.amd64.exe"), sys._getframe().f_code.co_name, db_set, other_set], stdout = subprocess.PIPE).communicate()[0]
- else:
- data = subprocess.Popen([os.path.join(".", "route_go", "bin", "main.arm64.exe"), sys._getframe().f_code.co_name, db_set, other_set], stdout = subprocess.PIPE).communicate()[0]
- data = data.decode('utf8')
- return flask.Response(response = data, status = 200, mimetype = 'application/json')
|