|
@@ -250,7 +250,7 @@ class Ruku():
|
|
res_zyk = {"data":{"html": xxx, "items": xxx}, "errcode": 0, "errmsgs": ""}
|
|
res_zyk = {"data":{"html": xxx, "items": xxx}, "errcode": 0, "errmsgs": ""}
|
|
res_xbk = {"items": xxx, "errcode": 0, "errmsg":"ok"}
|
|
res_xbk = {"items": xxx, "errcode": 0, "errmsg":"ok"}
|
|
"""
|
|
"""
|
|
- res_xbk = {"items": [], "errcode": 0, "errmsg": "ok", "callback_type": 2}
|
|
|
|
|
|
+ res_xbk = {"items": [], "errcode": 0, "errmsg": "ok", "callback_type": 2, "subject_id": self.subject}
|
|
res_zyk = {"errcode": 0, "errmsgs": "", "data": {"html": self.htmlt, "items": self.items_list}}
|
|
res_zyk = {"errcode": 0, "errmsgs": "", "data": {"html": self.htmlt, "items": self.items_list}}
|
|
# 1>>判断删除腾讯云桶内图片
|
|
# 1>>判断删除腾讯云桶内图片
|
|
if self.source not in ["teacher", "xue_guan"]: # {"xue_guan": "1", "teacher": "2", "ai": "3"}
|
|
if self.source not in ["teacher", "xue_guan"]: # {"xue_guan": "1", "teacher": "2", "ai": "3"}
|
|
@@ -260,7 +260,7 @@ class Ruku():
|
|
# 2>>mathjax渲染的svg图片提取->保存->格式转化
|
|
# 2>>mathjax渲染的svg图片提取->保存->格式转化
|
|
svg_convert_res = self.mathjx2png()
|
|
svg_convert_res = self.mathjx2png()
|
|
if type(svg_convert_res) == str:
|
|
if type(svg_convert_res) == str:
|
|
- res_xbk = {"items": [], "errcode": 1, "errmsg": svg_convert_res, "callback_type": 2}
|
|
|
|
|
|
+ res_xbk = {"items": [], "errcode": 1, "errmsg": svg_convert_res, "callback_type": 2, "subject_id": self.subject}
|
|
res_zyk = {"errcode": 1, "errmsgs": svg_convert_res, "data": {}}
|
|
res_zyk = {"errcode": 1, "errmsgs": svg_convert_res, "data": {}}
|
|
if self.callback_url:
|
|
if self.callback_url:
|
|
self.callback_user(res_xbk, self.callback_url)
|
|
self.callback_user(res_xbk, self.callback_url)
|
|
@@ -379,7 +379,7 @@ class Ruku():
|
|
if self.source != "xue_guan":
|
|
if self.source != "xue_guan":
|
|
repeat_r, repeat_time = self.repeat_check(nn, one_items, repeat_time)
|
|
repeat_r, repeat_time = self.repeat_check(nn, one_items, repeat_time)
|
|
if type(repeat_r) == str:
|
|
if type(repeat_r) == str:
|
|
- res_xbk = {"items": [], "errcode": 1, "errmsg": repeat_r, "callback_type": 2}
|
|
|
|
|
|
+ res_xbk = {"items": [], "errcode": 1, "errmsg": repeat_r, "callback_type": 2, "subject_id": self.subject}
|
|
res_zyk = {"errcode": 1, "errmsgs": repeat_r, "data": {}}
|
|
res_zyk = {"errcode": 1, "errmsgs": repeat_r, "data": {}}
|
|
self.callback_user(res_xbk, self.callback_url)
|
|
self.callback_user(res_xbk, self.callback_url)
|
|
return res_zyk
|
|
return res_zyk
|
|
@@ -418,9 +418,9 @@ class Ruku():
|
|
"paper_id": self.wordid,
|
|
"paper_id": self.wordid,
|
|
"img_upload_time": img_upload_time}, ensure_ascii=False))
|
|
"img_upload_time": img_upload_time}, ensure_ascii=False))
|
|
res_zyk = {"data": {"html": self.htmlt, "items": items_res_to_zyk}, "errcode": 0, "errmsgs": ""}
|
|
res_zyk = {"data": {"html": self.htmlt, "items": items_res_to_zyk}, "errcode": 0, "errmsgs": ""}
|
|
- res_xbk = {"items": items_res_to_xbk, "errcode": 0, "errmsg": "ok", "callback_type": 2}
|
|
|
|
|
|
+ res_xbk = {"items": items_res_to_xbk, "errcode": 0, "errmsg": "ok", "callback_type": 2, "subject_id": self.subject}
|
|
except Exception as e:
|
|
except Exception as e:
|
|
- res_xbk = {"items": [], "errcode": 1, "errmsg": "公式或图片上传腾讯云失败", "callback_type": 2}
|
|
|
|
|
|
+ res_xbk = {"items": [], "errcode": 1, "errmsg": "公式或图片上传腾讯云失败", "callback_type": 2, "subject_id": self.subject}
|
|
res_zyk = {"data":{"html": self.htmlt, "items": self.items_list}, "errcode": 1,
|
|
res_zyk = {"data":{"html": self.htmlt, "items": self.items_list}, "errcode": 1,
|
|
"errmsgs": "公式或图片上传腾讯云失败"}
|
|
"errmsgs": "公式或图片上传腾讯云失败"}
|
|
logger.info(json.dumps({"log_level": "warn",
|
|
logger.info(json.dumps({"log_level": "warn",
|
|
@@ -437,7 +437,7 @@ class Ruku():
|
|
if self.source != "xue_guan":
|
|
if self.source != "xue_guan":
|
|
repeat_r, repeat_time = self.repeat_check(nn, one_items, repeat_time)
|
|
repeat_r, repeat_time = self.repeat_check(nn, one_items, repeat_time)
|
|
if type(repeat_r) == str:
|
|
if type(repeat_r) == str:
|
|
- res_xbk = {"items": [], "errcode": 1, "errmsg": repeat_r, "callback_type": 2}
|
|
|
|
|
|
+ res_xbk = {"items": [], "errcode": 1, "errmsg": repeat_r, "callback_type": 2, "subject_id": self.subject}
|
|
res_zyk = {"errcode": 1, "errmsgs": repeat_r, "data": {}}
|
|
res_zyk = {"errcode": 1, "errmsgs": repeat_r, "data": {}}
|
|
self.callback_user(res_xbk, self.callback_url)
|
|
self.callback_user(res_xbk, self.callback_url)
|
|
return res_zyk
|
|
return res_zyk
|
|
@@ -449,7 +449,7 @@ class Ruku():
|
|
new_one_item.update(one_items)
|
|
new_one_item.update(one_items)
|
|
items_res_to_xbk.append(new_one_item)
|
|
items_res_to_xbk.append(new_one_item)
|
|
|
|
|
|
- res_xbk = {"items": items_res_to_xbk, "errcode": 0, "errmsg": "ok", "callback_type": 2}
|
|
|
|
|
|
+ res_xbk = {"items": items_res_to_xbk, "errcode": 0, "errmsg": "ok", "callback_type": 2, "subject_id": self.subject}
|
|
logger.info(json.dumps({"log_level": "info",
|
|
logger.info(json.dumps({"log_level": "info",
|
|
"paper_id": self.wordid,
|
|
"paper_id": self.wordid,
|
|
"repeat_time": repeat_time}, ensure_ascii=False))
|
|
"repeat_time": repeat_time}, ensure_ascii=False))
|
|
@@ -497,7 +497,7 @@ class Ruku():
|
|
入口函数
|
|
入口函数
|
|
:return:
|
|
:return:
|
|
"""
|
|
"""
|
|
- res_xbk = {"items": [], "errcode": 1, "errmsg": "保存失败", "callback_type": 2}
|
|
|
|
|
|
+ res_xbk = {"items": [], "errcode": 1, "errmsg": "保存失败", "callback_type": 2, "subject_id": self.subject}
|
|
try:
|
|
try:
|
|
res_zyk = self.upload_img()
|
|
res_zyk = self.upload_img()
|
|
return res_zyk
|
|
return res_zyk
|