|
|
@@ -16,6 +16,7 @@ import weixin.control_auth as ca
|
|
|
import weixin.controls as ctl
|
|
|
import weixin.wzhifuSDK as wzf
|
|
|
from utils.upload_to_oss import hnoss
|
|
|
+from utils.baiduai import baidu_ai_detect_image,baidu_ai_detect_txt
|
|
|
|
|
|
|
|
|
class OpenidView(cv.BaseView):
|
|
|
@@ -1446,3 +1447,34 @@ class MatchWinlostTop5ListView(cv.AuthView):
|
|
|
except Exception as e:
|
|
|
cv.tracefail()
|
|
|
return cv.to_fail(e)
|
|
|
+
|
|
|
+
|
|
|
+class AiDetectImageView(cv.BaseView):
|
|
|
+ def post(self, request):
|
|
|
+ """
|
|
|
+ #ai图片检测(小程序)
|
|
|
+ @imgurl:"",图片地址
|
|
|
+ """
|
|
|
+ qdata = request.json
|
|
|
+ try:
|
|
|
+ imgurl = qdata.get("imgurl")
|
|
|
+ rst = baidu_ai_detect_image(imgurl)
|
|
|
+ return cv.to_suc(rst)
|
|
|
+ except Exception as e:
|
|
|
+ cv.tracefail()
|
|
|
+ return cv.to_fail(e)
|
|
|
+
|
|
|
+class AiDetectTxtView(cv.BaseView):
|
|
|
+ def post(self, request):
|
|
|
+ """
|
|
|
+ #ai文本检测(小程序)
|
|
|
+ @content:"",检测文本
|
|
|
+ """
|
|
|
+ qdata = request.json
|
|
|
+ try:
|
|
|
+ content = qdata.get("content")
|
|
|
+ rst = baidu_ai_detect_image(content)
|
|
|
+ return cv.to_suc(rst)
|
|
|
+ except Exception as e:
|
|
|
+ cv.tracefail()
|
|
|
+ return cv.to_fail(e)
|