How to use error_msg method in refurb

Best Python code snippet using refurb_python

views.py

Source:views.py Github

copy

Full Screen

1from django.shortcuts import render2from django.shortcuts import HttpResponse3from my_project.service.SamePic import SamePic4from my_project.service.SimilarityPic import SimilarityPic5from my_project.service.GoodsPic import GoodsPic6from my_project.service.Auxiliary import get_file_content7import json8import os9# Create your views here.10user_list = [11 {"user":"jack", "pwd":"abc"},12 {"user":"tom", "pwd":"ABC"}13]14# 相同图类别字典15samePicCategoryDict = {16 "白种人男性":"1", "白种人女性":"2", "黄种人男性":"3", "黄种人女性":"4", "黑种人男性":"5", "黑种人女性":"6", "澳大利亚人种男性":"7", "澳大利亚人种女性":"8", "哺乳动物":"9",17 "两栖动物":"10", "昆虫":"11", "鱼类":"12", "鸟类":"13", "床上用品":"14", "厨卫用品":"15", "家用电器":"16", "家具":"17", "日常用品":"18",18 "饮料":"19", "食物":"20", "机动车":"21", "非机动车":"22", "飞机":"23", "船":"24", "航天器":"25", "自然风光":"26", "城市风光":"27",19 "旅游名胜":"28", "other":"29"20}21# 相似图类别字典22similarPicCategoryDict = {23 "白种人男性":"1", "白种人女性":"2", "黄种人男性":"3", "黄种人女性":"4", "黑种人男性":"5", "黑种人女性":"6", "澳大利亚人种男性":"7", "澳大利亚人种女性":"8", "哺乳动物":"9",24 "两栖动物":"10", "昆虫":"11", "鱼类":"12", "鸟类":"13", "床上用品":"14", "厨卫用品":"15", "家用电器":"16", "家具":"17", "日常用品":"18",25 "饮料":"19", "食物":"20", "机动车":"21", "非机动车":"22", "飞机":"23", "船":"24", "航天器":"25", "自然风光":"26", "城市风光":"27",26 "旅游名胜":"28", "other":"30"27}28# 商品图类别字典29productPicCategoryDict = {30 "女装":"1", "女鞋":"2", "男装":"3", "男鞋":"4", "内衣":"5", "母婴":"6", "手机":"7", "数码":"8", "家电":"9",31 "美妆":"10", "箱包":"11", "运动":"12", "户外":"13", "家装":"14", "家纺":"15", "居家百货":"16", "鲜花宠物":"17", "配饰":"18",32 "食品":"19", "生鲜":"20", "汽车摩托":"21", "医药":"22", "图书":"23", "通信":"24", "洗护":"25", "乐器":"26", "other":"27"33}34def index(request):35 # request.POST36 # request.GET37 # return HttpResponse('Hello world!')38 if request.method == "POST":39 username = request.POST.get("username", None)40 password = request.POST.get("password", None)41 print(username, password)42 temp = {"user":username, "pwd":password}43 user_list.append(temp)44 return render(request, "index.html",{"data":user_list})45def index_same(request):46 return render(request, "admin-same.html")47def index_similar(request):48 return render(request, "admin-similar.html")49def index_product(request):50 return render(request, "admin-product.html")51def index_same_url(request):52 return render(request, "admin-same-url.html")53def index_similar_url(request):54 return render(request, "admin-similar-url.html")55def index_product_url(request):56 return render(request, "admin-product-url.html")57# 相同图入库58def same_put_in(request):59 if request.method == "POST":60 # 获取表单传过来的图片61 image = request.FILES.get("image")62 # 获取表单传过来的图片类型63 category = request.POST.get("category", "other")64 if samePicCategoryDict.get(category):65 category_id = samePicCategoryDict[category]66 else:67 category_id = samePicCategoryDict["other"]68 filePath = '/assets/img/same/'+image.name69 # 将图片保存到img目录下面70 filePath1 = 'assets/img/same/'+image.name71 f = open(filePath1,'wb')72 f.write(image.file.getvalue())73 f.close()74 # 定义一个相同图对象75 sp = SamePic()76 sp.image = get_file_content(filePath1)77 # 文件名78 (filename, extension) = os.path.splitext(image.name)79 # 给图片增加描述80 sp.options["brief"] = "{\"name\":\""+filename+"\", \"url\":\""+filePath+"\"}"81 # 给图片增加类型82 sp.options["tags"] = category_id83 # 有图片描述的本地图片入库84 data = sp.putIn(1)85 # 判断是否是返回错误信息86 if 'error_msg' in data.keys():87 return render(request, "admin-same.html", {"error_msg": data['error_msg'], "sign": 0})88 else:89 return render(request, 'admin-same.html', {"sign": 1})90# 相同图检索91def same_check(request):92 # 判断请求方法为post93 if request.method == "POST":94 # 获取表单传过来的图片95 image = request.FILES.get("image")96 # 获取表单传过来的图片类型97 category = request.POST.get("category", None)98 if samePicCategoryDict.get(category):99 category_id = samePicCategoryDict[category]100 else:101 category_id = samePicCategoryDict["other"]102 if category:103 # 定义一个相同图对象104 print(category,category_id)105 sp = SamePic()106 sp.image = image.file.getvalue()107 # 设置可选参数108 sp.options["tags"] = category_id109 sp.options["tag_logic"] = "0"110 sp.options["pn"] = "0"111 sp.options["rn"] = "1000"112 # 本地图片检索113 data = sp.check(1)114 # 将字符串转为字典115 for image in data['result']:116 print(image['brief'])117 image['brief'] = json.loads(image['brief'])118 # 判断是否是返回错误信息119 if 'error_msg' in data.keys():120 return render(request, "admin-same.html", {"error_msg": data['error_msg'], "sign": 0})121 else:122 return render(request, "admin-gallery.html", {"data": data})123 else:124 # 定义一个相同图对象125 sp = SamePic()126 sp.image = image.file.getvalue()127 # 本地图片检索128 data = sp.check(0)129 # 将字符串转为字典130 for image in data['result']:131 print("hello",image['brief'])132 image['brief'] = json.loads(image['brief'])133 # 判断是否是返回错误信息134 if 'error_msg' in data.keys():135 return render(request, "admin-same.html", {"error_msg": data['error_msg'], "sign": 0})136 else:137 return render(request, "admin-gallery.html", {"data": data})138# 相同图更新139def same_update(request):140 # 判断请求方法为post141 if request.method == "POST":142 # 获取表单传过来的图片143 image = request.FILES.get("image")144 # 获取表单传过来的图片类型145 category = request.POST.get("category",None)146 if samePicCategoryDict.get(category):147 category_id = samePicCategoryDict[category]148 else:149 category_id = samePicCategoryDict["other"]150 if category:151 # 定义一个相同图对象152 sp = SamePic()153 sp.image = image.file.getvalue()154 # 可选参数155 # sp.options["brief"] = "{\"name\":\"周杰伦\", \"id\":\"666\"}"156 sp.options["tags"] = category_id157 # 本地图片更新158 data = sp.update(1)159 # 判断是否是返回错误信息160 if 'error_msg' in data.keys():161 return render(request, "admin-same.html", {"error_msg": data['error_msg'], "sign": 0})162 else:163 return render(request, 'admin-same.html', {"sign": 1})164 else:165 # 定义一个相同图对象166 sp = SamePic()167 sp.image = image.file.getvalue()168 # 本地图片更新169 data = sp.update(0)170 # 判断是否是返回错误信息171 if 'error_msg' in data.keys():172 return render(request, "admin-same.html", {"error_msg": data['error_msg'], "sign": 0})173 else:174 return render(request, 'admin-same.html', {"sign": 1})175# 相同图删除176def same_delete(request):177 # 判断请求方法为post178 if request.method == "POST":179 # 获取表单传过来的图片180 image = request.FILES.get("image")181 # 定义一个相同图对象182 sp = SamePic()183 sp.image = image.file.getvalue()184 # 本地图片更新185 data = sp.delete(0)186 # 判断是否是返回错误信息187 if 'error_msg' in data.keys():188 return render(request, "admin-same.html", {"error_msg": data['error_msg'], "sign": 0})189 else:190 return render(request, 'admin-same.html', {"sign": 1})191# 相似图入库192def similar_put_in(request):193 if request.method == "POST":194 # 获取表单传过来的图片195 image = request.FILES.get("image")196 # 获取表单传过来的图片类型197 category = request.POST.get("category", None)198 if similarPicCategoryDict.get(category):199 category_id = similarPicCategoryDict[category]200 else:201 category_id = similarPicCategoryDict["other"]202 filePath = '/assets/img/similar/'+image.name203 # 将图片保存到img目录下面204 filePath1 = 'assets/img/similar/'+image.name205 f = open(filePath1,'wb')206 f.write(image.file.getvalue())207 f.close()208 # 定义一个相似图对象209 sp = SimilarityPic()210 sp.image = get_file_content(filePath1)211 # 文件名212 (filename, extension) = os.path.splitext(image.name)213 # 给图片增加描述214 sp.options["brief"] = "{\"name\":\""+filename+"\", \"url\":\""+filePath+"\"}"215 # 给图片增加类型216 sp.options["tags"] = category_id217 # 有图片描述的本地图片入库218 data = sp.putIn(1)219 # 判断是否是返回错误信息220 if 'error_msg' in data.keys():221 return render(request, "admin-similar.html", {"error_msg": data['error_msg'], "sign": 0})222 else:223 return render(request, 'admin-similar.html', {"sign": 1})224# 相似图检索225def similar_check(request):226 # 判断请求方法为post227 if request.method == "POST":228 # 获取表单传过来的图片229 image = request.FILES.get("image")230 # 获取表单传过来的图片类型231 category = request.POST.get("category", None)232 if similarPicCategoryDict.get(category):233 category_id = similarPicCategoryDict[category]234 else:235 category_id = similarPicCategoryDict["other"]236 if category:237 # 定义一个相似图对象238 sp = SimilarityPic()239 sp.image = image.file.getvalue()240 # 设置可选参数241 sp.options["tags"] = category_id242 sp.options["tag_logic"] = "0"243 sp.options["pn"] = "0"244 sp.options["rn"] = "1000"245 # 本地图片检索246 data = sp.check(1)247 # 将字符串转为字典248 for image in data['result']:249 print(image['brief'])250 image['brief'] = json.loads(image['brief'])251 # 判断是否是返回错误信息252 if 'error_msg' in data.keys():253 return render(request, "admin-similar.html", {"error_msg": data['error_msg'], "sign": 0})254 else:255 return render(request, "admin-gallery.html", {"data": data})256 else:257 # 定义一个相似图对象258 sp = SimilarityPic()259 sp.image = image.file.getvalue()260 # 本地图片检索261 data = sp.check(0)262 # 将字符串转为字典263 for image in data['result']:264 print("hello", image['brief'])265 image['brief'] = json.loads(image['brief'])266 # 判断是否是返回错误信息267 if 'error_msg' in data.keys():268 return render(request, "admin-similar.html", {"error_msg": data['error_msg'], "sign": 0})269 else:270 return render(request, "admin-gallery.html", {"data": data})271# 相似图更新272def similar_update(request):273 # 判断请求方法为post274 if request.method == "POST":275 # 获取表单传过来的图片276 image = request.FILES.get("image")277 # 获取表单传过来的图片类型278 category = request.POST.get("category", None)279 if similarPicCategoryDict.get(category):280 category_id = similarPicCategoryDict[category]281 else:282 category_id = similarPicCategoryDict["other"]283 if category:284 # 定义一个相似图对象285 sp = SimilarityPic()286 sp.image = image.file.getvalue()287 # 可选参数288 # sp.options["brief"] = "{\"name\":\"周杰伦\", \"id\":\"666\"}"289 sp.options["tags"] = category_id290 # 本地图片更新291 data = sp.update(1)292 # 判断是否是返回错误信息293 if 'error_msg' in data.keys():294 return render(request, "admin-similar.html", {"error_msg": data['error_msg'], "sign": 0})295 else:296 return render(request, 'admin-similar.html', {"sign": 1})297 else:298 # 定义一个相似图对象299 sp = SimilarityPic()300 sp.image = image.file.getvalue()301 # 本地图片更新302 data = sp.update(0)303 # 判断是否是返回错误信息304 if 'error_msg' in data.keys():305 return render(request, "admin-similar.html", {"error_msg": data['error_msg'], "sign": 0})306 else:307 return render(request, 'admin-similar.html', {"sign": 1})308# 相似图删除309def similar_delete(request):310 # 判断请求方法为post311 if request.method == "POST":312 # 获取表单传过来的图片313 image = request.FILES.get("image")314 # 定义一个相似图对象315 sp = SimilarityPic()316 sp.image = image.file.getvalue()317 # 本地图片更新318 data = sp.delete(0)319 # 判断是否是返回错误信息320 if 'error_msg' in data.keys():321 return render(request, "admin-similar.html", {"error_msg": data['error_msg'], "sign": 0})322 else:323 return render(request, 'admin-similar.html', {"sign": 1})324# 商品图入库325def product_put_in(request):326 if request.method == "POST":327 # 获取表单传过来的图片328 image = request.FILES.get("image")329 # 获取表达传过来的图片类型330 category = request.POST.get("category", None)331 if productPicCategoryDict.get(category):332 category_id = productPicCategoryDict[category]333 else:334 category_id = productPicCategoryDict["other"]335 filePath = '/assets/img/product/'+image.name336 # 将图片保存到img目录下面337 filePath1 = 'assets/img/product/'+image.name338 f = open(filePath1,'wb')339 f.write(image.file.getvalue())340 f.close()341 # 定义一个商品图对象342 gp = GoodsPic()343 gp.image = get_file_content(filePath1)344 # 文件名345 (filename, extension) = os.path.splitext(image.name)346 # 给图片增加描述347 gp.options["brief"] = "{\"name\":\""+filename+"\", \"url\":\""+filePath+"\"}"348 # 给图片增加类型349 gp.options["class_id1"] = int(category_id)350 # 有图片描述的本地图片入库351 data = gp.putIn(1)352 print(data)353 # 判断是否是返回错误信息354 if 'error_msg' in data.keys():355 return render(request, "admin-product.html", {"error_msg":data['error_msg'], "sign":0})356 else:357 return render(request, 'admin-product.html', {"sign":1})358# 商品图检索359def product_check(request):360 # 判断请求方法为post361 if request.method == "POST":362 # 获取表单传过来的图片363 image = request.FILES.get("image")364 # 获取表单传过来的图片类型365 category = request.POST.get("category", None)366 if productPicCategoryDict.get(category):367 category_id = productPicCategoryDict[category]368 else:369 category_id = productPicCategoryDict["other"]370 if category:371 # 定义一个商品图对象372 gp = GoodsPic()373 gp.image = image.file.getvalue()374 # 设置可选参数375 gp.options["class_id1"] = int(category_id)376 gp.options["pn"] = "0"377 gp.options["rn"] = "1000"378 # 本地图片检索379 data = gp.check(1)380 # 将字符串转为字典381 for image in data['result']:382 print(image['brief'])383 image['brief'] = json.loads(image['brief'])384 # 判断是否是返回错误信息385 if 'error_msg' in data.keys():386 return render(request, "admin-product.html", {"error_msg": data['error_msg'], "sign": 0})387 else:388 return render(request, "admin-gallery.html", {"data": data})389 else:390 # 定义一个商品图对象391 gp = GoodsPic()392 gp.image = image.file.getvalue()393 # 本地图片检索394 data = gp.check(0)395 # 将字符串转为字典396 for image in data['result']:397 print("hello", image['brief'])398 image['brief'] = json.loads(image['brief'])399 # 判断是否是返回错误信息400 if 'error_msg' in data.keys():401 return render(request, "admin-product.html", {"error_msg": data['error_msg'], "sign": 0})402 else:403 return render(request, "admin-gallery.html", {"data": data})404# 商品图更新405def product_update(request):406 # 判断请求方法为post407 if request.method == "POST":408 # 获取表单传过来的图片409 image = request.FILES.get("image")410 # 获取表单传过来的图片类型411 category = request.POST.get("category", None)412 if productPicCategoryDict.get(category):413 category_id = productPicCategoryDict[category]414 else:415 category_id = productPicCategoryDict["other"]416 if category:417 # 定义一个商品图对象418 gp = GoodsPic()419 gp.image = image.file.getvalue()420 # 可选参数421 gp.options["brief"] = "{\"name\":\"周杰伦\", \"id\":\"666\"}"422 gp.options["class_id1"] = int(category_id)423 # 本地图片更新424 data = gp.update(1)425 # 判断是否是返回错误信息426 if 'error_msg' in data.keys():427 return render(request, "admin-product.html", {"error_msg": data['error_msg'], "sign": 0})428 else:429 return render(request, 'admin-product.html', {"sign": 1})430 else:431 # 定义一个相同图对象432 gp = GoodsPic()433 gp.image = image.file.getvalue()434 # 本地图片更新435 data = gp.update(0)436 # 判断是否是返回错误信息437 if 'error_msg' in data.keys():438 return render(request, "admin-product.html", {"error_msg": data['error_msg'], "sign": 0})439 else:440 return render(request, 'admin-product.html', {"sign": 1})441# 商品图删除442def product_delete(request):443 # 判断请求方法为post444 if request.method == "POST":445 # 获取表单传过来的图片446 image = request.FILES.get("image")447 # 定义一个相同图对象448 gp = GoodsPic()449 gp.image = image.file.getvalue()450 # 本地图片更新451 data = gp.delete(0)452 # 判断是否是返回错误信息453 if 'error_msg' in data.keys():454 return render(request, "admin-product.html", {"error_msg": data['error_msg'], "sign": 0})455 else:456 return render(request, 'admin-product.html', {"sign": 1})457# 相同图入库458def same_put_in_url(request):459 if request.method == "POST":460 # 获取表单传过来的网络地址461 image_url = request.POST.get("URL")462 # 获取表单传过来的图片类型463 category = request.POST.get("category", None)464 if samePicCategoryDict.get(category):465 category_id = samePicCategoryDict[category]466 else:467 category_id = samePicCategoryDict["other"]468 # 获取图片名称469 image_name = request.POST.get("name", None)470 # 定义一个相同图对象471 sp = SamePic()472 sp.url = image_url473 # 给图片增加描述474 sp.options["brief"] = "{\"name\":\""+image_name+"\", \"url\":\""+image_url+"\"}"475 # 给图片增加类型476 sp.options["tags"] = category_id477 # 有图片描述的本地图片入库478 data = sp.putIn(3)479 # 判断是否是返回错误信息480 if 'error_msg' in data.keys():481 return render(request, "admin-same-url.html", {"error_msg": data['error_msg'], "sign": 0})482 else:483 return render(request, 'admin-same-url.html', {"sign": 1})484# 相同图检索485def same_check_url(request):486 # 判断请求方法为post487 if request.method == "POST":488 # 获取表单传过来的网络地址489 image_url = request.POST.get("URL")490 # 获取表单传过来的图片类型491 category = request.POST.get("category", None)492 if samePicCategoryDict.get(category):493 category_id = samePicCategoryDict[category]494 else:495 category_id = samePicCategoryDict["other"]496 if category:497 # 定义一个相同图对象498 sp = SamePic()499 sp.url = image_url500 # 设置可选参数501 sp.options["tags"] = category_id502 sp.options["tag_logic"] = "0"503 sp.options["pn"] = "0"504 sp.options["rn"] = "1000"505 # 本地图片检索506 data = sp.check(3)507 # 将字符串转为字典508 for image in data['result']:509 print(image['brief'])510 image['brief'] = json.loads(image['brief'])511 # 判断是否是返回错误信息512 if 'error_msg' in data.keys():513 return render(request, "admin-same.html", {"error_msg": data['error_msg'], "sign": 0})514 else:515 return render(request, "admin-gallery.html", {"data": data})516 else:517 # 定义一个相同图对象518 sp = SamePic()519 sp.url = image_url520 # 本地图片检索521 data = sp.check(2)522 # 将字符串转为字典523 for image in data['result']:524 print("hello",image['brief'])525 image['brief'] = json.loads(image['brief'])526 # 判断是否是返回错误信息527 if 'error_msg' in data.keys():528 return render(request, "admin-same.html", {"error_msg": data['error_msg'], "sign": 0})529 else:530 return render(request, "admin-gallery.html", {"data": data})531# 相同图更新532def same_update_url(request):533 # 判断请求方法为post534 if request.method == "POST":535 # 获取表单传过来的URL536 image_url = request.POST.get("URL")537 # 获取表单传过来的图片类型538 category = request.POST.get("category",None)539 if samePicCategoryDict.get(category):540 category_id = samePicCategoryDict[category]541 else:542 category_id = samePicCategoryDict["other"]543 if category:544 # 定义一个相同图对象545 sp = SamePic()546 sp.url = image_url547 # 可选参数548 # sp.options["brief"] = "{\"name\":\"周杰伦\", \"id\":\"666\"}"549 sp.options["tags"] = category_id550 # 本地图片更新551 data = sp.update(3)552 # 判断是否是返回错误信息553 if 'error_msg' in data.keys():554 return render(request, "admin-same.html", {"error_msg": data['error_msg'], "sign": 0})555 else:556 return render(request, 'admin-same.html', {"sign": 1})557 else:558 # 定义一个相同图对象559 sp = SamePic()560 sp.url = image_url561 # 本地图片更新562 data = sp.update(2)563 # 判断是否是返回错误信息564 if 'error_msg' in data.keys():565 return render(request, "admin-same.html", {"error_msg": data['error_msg'], "sign": 0})566 else:567 return render(request, 'admin-same.html', {"sign": 1})568# 相同图删除569def same_delete_url(request):570 # 判断请求方法为post571 if request.method == "POST":572 # 获取表单传过来的URL573 image_url = request.POST.get("URL")574 # 定义一个相同图对象575 sp = SamePic()576 sp.url = image_url577 # 本地图片更新578 data = sp.delete(1)579 # 判断是否是返回错误信息580 if 'error_msg' in data.keys():581 return render(request, "admin-same.html", {"error_msg": data['error_msg'], "sign": 0})582 else:583 return render(request, 'admin-same.html', {"sign": 1})584# 相似图入库585def similar_put_in_url(request):586 if request.method == "POST":587 # 获取表单传过来的网络地址588 image_url = request.POST.get("URL")589 # 获取表单传过来的图片类型590 category = request.POST.get("category", None)591 if similarPicCategoryDict.get(category):592 category_id = similarPicCategoryDict[category]593 else:594 category_id = similarPicCategoryDict["other"]595 # 获取图片名称596 image_name = request.POST.get("name", None)597 # 定义一个相似图对象598 sp = SimilarityPic()599 sp.url = image_url600 # 给图片增加描述601 sp.options["brief"] = "{\"name\":\""+image_name+"\", \"url\":\""+image_url+"\"}"602 # 给图片增加类型603 sp.options["tags"] = category_id604 # 有图片描述的本地图片入库605 data = sp.putIn(3)606 # 判断是否是返回错误信息607 if 'error_msg' in data.keys():608 return render(request, "admin-similar-url.html", {"error_msg": data['error_msg'], "sign": 0})609 else:610 return render(request, 'admin-similar-url.html', {"sign": 1})611# 相似图检索612def similar_check_url(request):613 # 判断请求方法为post614 if request.method == "POST":615 # 获取表单传过来的网络地址616 image_url = request.POST.get("URL")617 # 获取表单传过来的图片类型618 category = request.POST.get("category", None)619 if similarPicCategoryDict.get(category):620 category_id = similarPicCategoryDict[category]621 else:622 category_id = similarPicCategoryDict["other"]623 if category:624 # 定义一个相似图对象625 sp = SimilarityPic()626 sp.url = image_url627 # 设置可选参数628 sp.options["tags"] = category_id629 sp.options["tag_logic"] = "0"630 sp.options["pn"] = "0"631 sp.options["rn"] = "1000"632 # 本地图片检索633 data = sp.check(3)634 # 将字符串转为字典635 for image in data['result']:636 print(image['brief'])637 image['brief'] = json.loads(image['brief'])638 # 判断是否是返回错误信息639 if 'error_msg' in data.keys():640 return render(request, "admin-similar-url.html", {"error_msg": data['error_msg'], "sign": 0})641 else:642 return render(request, "admin-gallery.html", {"data": data})643 else:644 # 定义一个相似图对象645 sp = SimilarityPic()646 sp.url = image_url647 # 本地图片检索648 data = sp.check(2)649 # 将字符串转为字典650 for image in data['result']:651 print("hello", image['brief'])652 image['brief'] = json.loads(image['brief'])653 # 判断是否是返回错误信息654 if 'error_msg' in data.keys():655 return render(request, "admin-similar-url.html", {"error_msg": data['error_msg'], "sign": 0})656 else:657 return render(request, "admin-gallery.html", {"data": data})658# 相似图更新659def similar_update_url(request):660 # 判断请求方法为post661 if request.method == "POST":662 # 获取表单传过来的URL663 image_url = request.POST.get("URL")664 # 获取表单传过来的图片类型665 category = request.POST.get("category", None)666 if similarPicCategoryDict.get(category):667 category_id = similarPicCategoryDict[category]668 else:669 category_id = similarPicCategoryDict["other"]670 if category:671 # 定义一个相似图对象672 sp = SimilarityPic()673 sp.url = image_url674 # 可选参数675 # sp.options["brief"] = "{\"name\":\"周杰伦\", \"id\":\"666\"}"676 sp.options["tags"] = category_id677 # 本地图片更新678 data = sp.update(3)679 # 判断是否是返回错误信息680 if 'error_msg' in data.keys():681 return render(request, "admin-similar-url.html", {"error_msg": data['error_msg'], "sign": 0})682 else:683 return render(request, 'admin-similar-url.html', {"sign": 1})684 else:685 # 定义一个相似图对象686 sp = SimilarityPic()687 sp.url = image_url688 # 本地图片更新689 data = sp.update(2)690 # 判断是否是返回错误信息691 if 'error_msg' in data.keys():692 return render(request, "admin-similar-url.html", {"error_msg": data['error_msg'], "sign": 0})693 else:694 return render(request, 'admin-similar-url.html', {"sign": 1})695# 相似图删除696def similar_delete_url(request):697 # 判断请求方法为post698 if request.method == "POST":699 # 获取表单传过来的URL700 image_url = request.POST.get("URL")701 # 定义一个相似图对象702 sp = SimilarityPic()703 sp.url = image_url704 # 本地图片更新705 data = sp.delete(1)706 # 判断是否是返回错误信息707 if 'error_msg' in data.keys():708 return render(request, "admin-similar-url.html", {"error_msg": data['error_msg'], "sign": 0})709 else:710 return render(request, 'admin-similar-url.html', {"sign": 1})711# 商品图入库712def product_put_in_url(request):713 if request.method == "POST":714 # 获取表单传过来的网络地址715 image_url = request.POST.get("URL")716 # 获取表单传过来的图片类型717 category = request.POST.get("category", None)718 if productPicCategoryDict.get(category):719 category_id = productPicCategoryDict[category]720 else:721 category_id = productPicCategoryDict["other"]722 # 获取图片名称723 image_name = request.POST.get("name", None)724 # 定义一个商品图对象725 gp = GoodsPic()726 gp.url = image_url727 # 给图片增加描述728 gp.options["brief"] = "{\"name\":\""+image_name+"\", \"url\":\""+image_url+"\"}"729 # 给图片增加类型730 gp.options["class_id1"] = int(category_id)731 # 有图片描述的本地图片入库732 data = gp.putIn(3)733 # 判断是否是返回错误信息734 if 'error_msg' in data.keys():735 return render(request, "admin-product-url.html", {"error_msg": data['error_msg'], "sign": 0})736 else:737 return render(request, 'admin-product-url.html', {"sign": 1})738# 商品图检索739def product_check_url(request):740 # 判断请求方法为post741 if request.method == "POST":742 # 获取表单传过来的网络地址743 image_url = request.POST.get("URL")744 # 获取表单传过来的图片类型745 category = request.POST.get("category", None)746 if productPicCategoryDict.get(category):747 category_id = productPicCategoryDict[category]748 else:749 category_id = productPicCategoryDict["other"]750 if category:751 # 定义一个商品图对象752 gp = GoodsPic()753 gp.url = image_url754 # 设置可选参数755 gp.options["class_id1"] = int(category_id)756 gp.options["pn"] = "0"757 gp.options["rn"] = "1000"758 # 本地图片检索759 data = gp.check(3)760 # 将字符串转为字典761 for image in data['result']:762 print(image['brief'])763 image['brief'] = json.loads(image['brief'])764 # 判断是否是返回错误信息765 if 'error_msg' in data.keys():766 return render(request, "admin-product-url.html", {"error_msg": data['error_msg'], "sign": 0})767 else:768 return render(request, "admin-gallery.html", {"data": data})769 else:770 # 定义一个商品图对象771 gp = GoodsPic()772 gp.url = image_url773 # 本地图片检索774 data = gp.check(2)775 # 将字符串转为字典776 for image in data['result']:777 print("hello", image['brief'])778 image['brief'] = json.loads(image['brief'])779 # 判断是否是返回错误信息780 if 'error_msg' in data.keys():781 return render(request, "admin-product-url.html", {"error_msg": data['error_msg'], "sign": 0})782 else:783 return render(request, "admin-gallery.html", {"data": data})784# 商品图更新785def product_update_url(request):786 # 判断请求方法为post787 if request.method == "POST":788 # 获取表单传过来的URL789 image_url = request.POST.get("URL")790 # 获取表单传过来的图片类型791 category = request.POST.get("category", None)792 if productPicCategoryDict.get(category):793 category_id = productPicCategoryDict[category]794 else:795 category_id = productPicCategoryDict["other"]796 if category:797 # 定义一个商品图对象798 gp = GoodsPic()799 gp.url = image_url800 # 可选参数801 gp.options["brief"] = "{\"name\":\"周杰伦\", \"id\":\"666\"}"802 gp.options["class_id1"] = int(category_id)803 # 本地图片更新804 data = gp.update(3)805 # 判断是否是返回错误信息806 if 'error_msg' in data.keys():807 return render(request, "admin-product-url.html", {"error_msg": data['error_msg'], "sign": 0})808 else:809 return render(request, 'admin-product-url.html', {"sign": 1})810 else:811 # 定义一个商品图对象812 gp = GoodsPic()813 gp.url = image_url814 # 本地图片更新815 data = gp.update(2)816 # 判断是否是返回错误信息817 if 'error_msg' in data.keys():818 return render(request, "admin-product-url.html", {"error_msg": data['error_msg'], "sign": 0})819 else:820 return render(request, 'admin-product-url.html', {"sign": 1})821# 商品图删除822def product_delete_url(request):823 # 判断请求方法为post824 if request.method == "POST":825 # 获取表单传过来的URL826 image_url = request.POST.get("URL")827 # 定义一个商品图对象828 gp = GoodsPic()829 gp.url = image_url830 # 本地图片更新831 data = gp.delete(1)832 # 判断是否是返回错误信息833 if 'error_msg' in data.keys():834 return render(request, "admin-product-url.html", {"error_msg": data['error_msg'], "sign": 0})835 else:...

Full Screen

Full Screen

mobile.py

Source:mobile.py Github

copy

Full Screen

1#!/usr/bin/env python3.52# -*- coding: utf-8 -*-3"""4__author__ = xyy5__mtime__ = 2016/10/136"""7from pyramid.view import view_config8from ..common.sendsms import send9from ..common import constant10from ..common.jsonutils import other_response11from ..common.redisutil import create_redis12from ..common.base import BaseUtil13class MobileView(BaseUtil):14 @view_config(route_name='sendCode', renderer='json')15 def send_code(self):16 """17 发送验证码18 :param self:19 :return:20 """21 error_msg = ''22 dbs = self.request.dbsession23 user_phone = self.request.POST.get('phone', '')24 user_name = self.request.POST.get('name', '')25 if not user_phone:26 error_msg = '用户手机不能为空!'27 elif not user_name:28 error_msg = '用户姓名不能为空!'29 if not error_msg:30 code = self.sendSmsService.make_random(6)31 content = constant.SMS_DESC % code32 redis_host = self.request.registry.settings['redis.sessions.host']33 r = create_redis(redis_host)34 # num = r.get(self.request.client_addr)35 # num = int(num) if num else 036 # if num:37 # if num <= 9:38 self.sendSmsService.add_code_redis(user_phone, code, redis_host)39 self.sendSmsService.add_ip_no_redis(self.request.client_addr, (lambda x: x+1)(1), redis_host)40 # self.sendSmsService.add_ip_no_redis(self.request.client_addr, (lambda x: x+1)(num), redis_host)41 send(user_phone, content)42 error_msg = self.sendSmsService.add_sms(dbs, sms_content=content, phone=user_phone)43 if error_msg:44 json_a = {45 'returnCode': constant.CODE_ERROR,46 'returnMsg': error_msg47 }48 else:49 json_a = {50 'returnCode': constant.CODE_SUCCESS,51 'returnMsg': ''52 }53 self.hyLog.log_in(self.request.client_addr, ('sendCode failed ' +54 error_msg if error_msg else 'sendCode success'), 'mobile')55 resp = other_response(json_a=json_a)56 return resp57 @view_config(route_name='accountBinding', renderer='json')58 def account_binding(self):59 """60 设备初始化登录61 :param self:62 :return:63 """64 error_msg = ''65 dbs = self.request.dbsession66 error_code = constant.CODE_ERROR67 user_phone = self.request.POST.get('phone', '')68 user_name = self.request.POST.get('name', '')69 verification_code = self.request.POST.get('verificationCode', '')70 is_risk = 071 indiinstflag = ''72 if not user_phone:73 error_msg = '用户手机不能为空!'74 elif not user_name:75 error_msg = '用户姓名不能为空!'76 elif not verification_code:77 error_msg = '验证码不能为空!'78 if not error_msg:79 redis_host = self.request.registry.settings['redis.sessions.host']80 crm_path = self.request.registry.settings['crm_path']81 auth_key = self.request.registry.settings['crm_auth_key']82 r = create_redis(redis_host)83 user_info = self.customerService.count_bind(user_phone, user_name, crm_path, auth_key)84 if not user_info:85 error_msg = 'crm服务连接错误!'86 else:87 random_code = r.get(user_phone)88 random_code = int(random_code) if random_code else 089 if random_code != int(verification_code):90 error_msg = '验证码有误请重新输入!'91 error_code = constant.CODE_WRONG92 else:93 custid = user_info['objects']['custid']94 indiinstflag = user_info['objects']['indiinstflag']95 risklevel = user_info['objects']['risklevel']96 is_risk = 1 if risklevel else 097 cust_info_id = self.customerService.add_customer(dbs, cust_id=custid,98 indiinst_flag=indiinstflag, cust_name=user_name,99 phone=user_phone, risk_level=risklevel)100 if error_msg:101 json_a = {102 'returnCode': error_code,103 'returnMsg': error_msg,104 }105 else:106 json_a = {107 'returnCode': constant.CODE_SUCCESS,108 'returnMsg': '',109 'isRiskAssess': is_risk,110 'wechatId': cust_info_id,111 'indiinstflag': indiinstflag112 }113 self.hyLog.log_in(self.request.client_addr, ('accountBinding failed ' + error_msg if error_msg114 else 'sendCode success'), 'mobile')115 resp = other_response(json_a=json_a)116 return resp117 @view_config(route_name='riskQuestion', renderer='json')118 def risk_question(self):119 """120 风险题目查询121 :param self:122 :return:123 """124 error_msg = ''125 error_code = constant.CODE_ERROR126 dbs = self.request.dbsession127 wechat_id = self.request.POST.get('wechatId', '')128 type = self.request.POST.get('type', '0')129 if not wechat_id:130 error_msg = '用户wechat_id不能为空!'131 if not error_msg:132 questions = self.riskService.search_questions(dbs, type)133 # error_msg, error_code = self.customerService.search_cust_bind(dbs, wechat_id)134 if error_msg:135 json_a = {136 'returnCode': error_code,137 'returnMsg': error_msg138 }139 else:140 json_a = {141 'returnCode': constant.CODE_SUCCESS,142 'returnMsg': '',143 'questionList': questions144 }145 self.hyLog.log_in(self.request.client_addr,146 ('riskQuestion failed ' + error_msg if error_msg else 'riskQuestion success'),147 'mobile')148 resp = other_response(json_a=json_a)149 return resp150 @view_config(route_name='riskAssess', renderer='json')151 def risk_assess(self):152 """153 风险评估154 :param self:155 :return:156 """157 error_msg = ''158 error_code = constant.CODE_ERROR159 dbs = self.request.dbsession160 wechat_id = self.request.POST.get('wechatId', '')161 risk_answers = self.request.POST.get('riskAnswer', '')162 type = self.request.POST.get('type', '')163 cert_type = self.request.POST.get('certType', '')164 cert_no = self.request.POST.get('certNo', '')165 if not wechat_id:166 error_msg = '用户wechat_id不能为空!'167 elif not risk_answers:168 error_msg = '风险题目答案!'169 elif not type:170 error_msg = '对私对公标志不能为空!'171 if not error_msg:172 crm_path = self.request.registry.settings['crm_path']173 auth_key = self.request.registry.settings['crm_auth_key']174 risk_level = self.riskService.add_risk_assess(dbs, wechat_id, risk_answers,175 type, cert_type, cert_no, crm_path, auth_key)176 error_msg, error_code = self.customerService.search_cust_bind(dbs, wechat_id)177 if error_msg:178 json_a = {179 'returnCode': error_code,180 'returnMsg': error_msg181 }182 else:183 json_a = {184 'returnCode': constant.CODE_SUCCESS,185 'returnMsg': '',186 'riskLevel': risk_level187 }188 self.hyLog.log_in(self.request.client_addr,189 ('riskAssess failed ' + error_msg if error_msg else 'riskAssess success'),190 'mobile')191 resp = other_response(json_a=json_a)192 return resp193 @view_config(route_name='riskSearch', renderer='json')194 def risk_search(self):195 """196 风险评估查询197 :param self:198 :return:199 """200 error_msg = ''201 dbs = self.request.dbsession202 wechat_id = self.request.POST.get('wechatId', '')203 if not wechat_id:204 error_msg = '用户wechat_id不能为空!'205 if not error_msg:206 error_msg, error_code = self.customerService.search_cust_bind(dbs, wechat_id)207 if not error_msg:208 error_msg, error_code, risk_level, risk_msg, risk_type_level, indiinst_flag = self.riskService.search_customer_risk_level(dbs, wechat_id)209 if error_msg:210 json_a = {211 'returnCode': error_code,212 'returnMsg': error_msg213 }214 else:215 json_a = {216 'returnCode': constant.CODE_SUCCESS,217 'returnMsg': '',218 'riskLevel': risk_level,219 'indiinstflag': indiinst_flag,220 'riskMessage': risk_msg,221 'riskType': risk_type_level222 }223 self.hyLog.log_in(self.request.client_addr,224 ('riskSearch failed ' + error_msg if error_msg else 'riskSearch success'),225 'mobile')226 resp = other_response(json_a=json_a)227 return resp228 @view_config(route_name='navList', renderer='json')229 def nav_list(self):230 """231 风险评估净值走势232 :param self:233 :return:234 """235 error_msg = ''236 dbms = self.request.mysqldbsession237 wechat_id = self.request.POST.get('wechatId', '')238 pro_id = self.request.POST.get('productId', '')239 nav_type = self.request.POST.get('navType', 1)240 if not wechat_id:241 error_msg = '用户wechat_id不能为空!'242 elif not pro_id:243 error_msg = '产品id不能为空!'244 elif not nav_type:245 error_msg = '净值走势类型不能为空!'246 if not error_msg:247 nav_list = self.productService.search_navs(dbms, wechat_id, pro_id, nav_type)248 if error_msg:249 json_a = {250 'returnCode': constant.CODE_ERROR,251 'returnMsg': error_msg252 }253 else:254 json_a = {255 'returnCode': constant.CODE_SUCCESS,256 'returnMsg': '',257 'navList': nav_list258 }259 self.hyLog.log_in(self.request.client_addr,260 ('navList failed ' + error_msg if error_msg else 'navList success'),261 'mobile')262 resp = other_response(json_a=json_a)263 return resp264 @view_config(route_name='productList', renderer='json')265 def product_list(self):266 """267 查找产品列表268 :param self:269 :return:270 """271 error_msg = ''272 error_code = constant.CODE_ERROR273 dbs = self.request.dbsession274 dbms = self.request.mysqldbsession275 wechat_id = self.request.POST.get('wechatId', '')276 page_no = self.request.POST.get('pageNo', 0)277 search_key = self.request.POST.get('searchKey', '')278 if not wechat_id:279 error_msg = '用户wechat_id不能为空!'280 elif not page_no:281 error_msg = '页码不能为空!'282 if not error_msg:283 error_msg, error_code = self.customerService.search_cust_bind(dbs, wechat_id)284 if not error_msg:285 error_msg, error_code, risk_level, risk_msg, risk_type_level, indiinst_flag = self.riskService.search_customer_risk_level(286 dbs, wechat_id)287 pro_list, count_pros, count_user_pros = self.productService.search_products(dbms, wechat_id, page_no, search_key, risk_level)288 if error_msg:289 json_a = {290 'returnCode': error_code,291 'returnMsg': error_msg292 }293 else:294 json_a = {295 'returnCode': constant.CODE_SUCCESS,296 'returnMsg': '',297 'productList': pro_list,298 'allNum': count_pros if count_pros else 0,299 'filterNum': count_user_pros if count_user_pros else 0300 }301 self.hyLog.log_in(self.request.client_addr,302 ('productList failed ' + error_msg if error_msg else 'productList success'),303 'mobile')304 resp = other_response(json_a=json_a)305 return resp306 @view_config(route_name='productDetail', renderer='json')307 def product_detail(self):308 """309 查找产品详情310 :param self:311 :return:312 """313 error_msg = ''314 error_code = constant.CODE_ERROR315 dbs = self.request.dbsession316 dbms = self.request.mysqldbsession317 wechat_id = self.request.POST.get('wechatId', '')318 product_id = self.request.POST.get('productId', 0)319 if not wechat_id:320 error_msg = '用户wechat_id不能为空!'321 elif not product_id:322 error_msg = '产品ID不能为空!'323 if not error_msg:324 error_msg, error_code, risk_level, risk_msg, risk_type_level, indiinst_flag = self.riskService.search_customer_risk_level(325 dbs, wechat_id)326 product = self.productService.search_product_info(dbs, dbms, wechat_id, product_id)327 if error_msg:328 json_a = {329 'returnCode': error_code,330 'returnMsg': error_msg331 }332 else:333 json_a = {334 'returnCode': constant.CODE_SUCCESS,335 'returnMsg': '',336 'product': product337 }338 self.hyLog.log_in(self.request.client_addr,339 ('productDetail failed ' + error_msg if error_msg else 'productDetail success'),340 'mobile')341 resp = other_response(json_a=json_a)342 return resp343 @view_config(route_name='productCollect', renderer='json')344 def product_collect(self):345 """346 产品收藏347 :param self:348 :return:349 """350 error_msg = ''351 dbs = self.request.dbsession352 wechat_id = self.request.POST.get('wechatId', '')353 product_id = self.request.POST.get('productId', 0)354 if not wechat_id:355 error_msg = '用户wechat_id不能为空!'356 elif not product_id:357 error_msg = '产品ID不能为空!'358 if not error_msg:359 coll_state = self.customerService.collect_product_by_id(dbs, wechat_id, product_id)360 if error_msg:361 json_a = {362 'returnCode': constant.CODE_ERROR,363 'returnMsg': error_msg364 }365 else:366 json_a = {367 'returnCode': constant.CODE_SUCCESS,368 'returnMsg': '',369 'isCollect': coll_state370 }371 self.hyLog.log_in(self.request.client_addr,372 ('productCollect failed ' + error_msg if error_msg else 'productCollect success'),373 'mobile')374 resp = other_response(json_a=json_a)375 return resp376 @view_config(route_name='productBook', renderer='json')377 def product_book(self):378 """379 产品预约380 :param self:381 :return:382 """383 error_msg = ''384 error_code = constant.CODE_ERROR385 dbs = self.request.dbsession386 wechat_id = self.request.POST.get('wechatId', '')387 phone = self.request.POST.get('phone', 0)388 pro_id = self.request.POST.get('proId', '')389 pro_name = self.request.POST.get('proName', '')390 if not wechat_id:391 error_msg = '用户wechat_id不能为空!'392 elif not pro_name:393 error_msg = '产品名称不能为空!'394 elif not pro_id:395 error_msg = '产品Id不能为空!'396 elif not phone:397 error_msg = '联系电话不能为空!'398 if not error_msg:399 crm_path = self.request.registry.settings['crm_path']400 auth_key = self.request.registry.settings['crm_auth_key']401 error_msg, error_code = self.customerService.book_product_by_id(dbs, wechat_id, pro_name, phone, pro_id,402 crm_path, auth_key)403 if error_msg:404 json_a = {405 'returnCode': error_code,406 'returnMsg': error_msg407 }408 else:409 json_a = {410 'returnCode': constant.CODE_SUCCESS,411 'returnMsg': ''412 }413 self.hyLog.log_in(self.request.client_addr,414 ('productCollect failed ' + error_msg if error_msg else 'productCollect success'),415 'mobile')416 resp = other_response(json_a=json_a)417 return resp418 @view_config(route_name='myCollect', renderer='json')419 def my_collect(self):420 """421 我的收藏422 :param self:423 :return:424 """425 error_msg = ''426 error_code = constant.CODE_ERROR427 dbms = self.request.mysqldbsession428 dbs = self.request.dbsession429 wechat_id = self.request.POST.get('wechatId', '')430 page_no = self.request.POST.get('pageNo', 0)431 if not wechat_id:432 error_msg = '用户wechat_id不能为空!'433 if not error_msg:434 pro_col_list = self.customerService.search_coll_product(dbs, dbms, wechat_id, page_no)435 error_msg, error_code = self.customerService.search_cust_bind(dbs, wechat_id)436 if error_msg:437 json_a = {438 'returnCode': error_code,439 'returnMsg': error_msg440 }441 else:442 json_a = {443 'returnCode': constant.CODE_SUCCESS,444 'returnMsg': '',445 'productList': pro_col_list446 }447 self.hyLog.log_in(self.request.client_addr,448 ('myCollect failed ' + error_msg if error_msg else 'myCollect success'),449 'mobile')450 resp = other_response(json_a=json_a)...

Full Screen

Full Screen

stock_error.py

Source:stock_error.py Github

copy

Full Screen

1ERROR_MSG = {}2ERROR_MSG[0] = "成功"3ERROR_MSG[-1] = "表示交易所网络连接失败"4ERROR_MSG[-2] = "表示交易所未处理请求超过许可数"5ERROR_MSG[-3] = "表示交易所每秒发送请求数超过许可数"6ERROR_MSG[3] = "表示交易所服务器未登录成功"7ERROR_MSG[4] = "用户未登录"8ERROR_MSG[5] = "非本交易所API登录"9ERROR_MSG[6] = "API版本信息出错"10ERROR_MSG[7] = "系统正在初始化"11ERROR_MSG[8] = "重复的登录"12ERROR_MSG[9] = "密码错"13ERROR_MSG[10] = "用户未找到"14ERROR_MSG[12] = "更新密码失败"15ERROR_MSG[13] = "生成密码失败"16ERROR_MSG[14] = "查询信息失败"17ERROR_MSG[16] = "撤单时未找到原始报单"18ERROR_MSG[17] = "报单在发往交易所之前被撤单"19ERROR_MSG[18] = "报单状态为已撤单状态不可撤单"20ERROR_MSG[19] = "报单状态为全部成交状态不可撤单"21ERROR_MSG[20] = "报单为错单不可撤单"22ERROR_MSG[21] = "撤单时原始报单为不可撤单状态"23ERROR_MSG[22] = "重复的报单"24ERROR_MSG[23] = "报单时未找到对应的合约信息"25ERROR_MSG[24] = "报单时买卖方向字段错误"26ERROR_MSG[25] = "报单时有效期类型字段错误"27ERROR_MSG[26] = "报单时价格字段错误"28ERROR_MSG[27] = "报单时数量字段错误"29ERROR_MSG[28] = "报单价格条件错误"30ERROR_MSG[29] = "报单时未获取到客户对应的资金信息"31ERROR_MSG[30] = "报单时资金不足"32ERROR_MSG[32] = "不能撤销其他客户报单"33ERROR_MSG[33] = "报单时价格信息不符合最小价位变动要求"34ERROR_MSG[34] = "报单时数量信息不符合最小数量变动要求"35ERROR_MSG[35] = "市价单金额不符合系统要求"36ERROR_MSG[36] = "用户信息验证失败"37ERROR_MSG[37] = "服务器分配会话信息失败"38ERROR_MSG[38] = "日内过度交易行为"39ERROR_MSG[39] = "大额报撤单行为"40ERROR_MSG[40] = "频繁撤单行为"41ERROR_MSG[41] = "最后交割日的合约不允许开仓"42ERROR_MSG[42] = "投机套保标记错误"43ERROR_MSG[43] = "开平标志错误"44ERROR_MSG[44] = "买卖方向错误"45ERROR_MSG[45] = "报单价格条件错误"46ERROR_MSG[46] = "有效期类型错误"47ERROR_MSG[47] = "成交量类型错误"48ERROR_MSG[48] = "触发条件错误"49ERROR_MSG[49] = "当前状态禁止此项操作"50ERROR_MSG[50] = "平仓时客户持仓不足"51ERROR_MSG[51] = "价格超出涨停板"52ERROR_MSG[52] = "价格跌破跌停板"53ERROR_MSG[53] = "操作标志错误"54ERROR_MSG[54] = "不支持该交易所报单或交易所字段不正确"55ERROR_MSG[55] = "获取客户端连接地址信息时出错"56ERROR_MSG[56] = "合约类型不对"57ERROR_MSG[57] = "备兑只能是卖开或买平"58ERROR_MSG[58] = "备兑开仓时标的合约持仓不足"59ERROR_MSG[59] = "距离交割日时间太短不允许开义务仓"60ERROR_MSG[60] = "组合或拆分标志错"61ERROR_MSG[61] = "不支持该组合策略"...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run refurb automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful