多语言-收集busiResult返回结果
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -76,7 +76,7 @@ public class SmsController extends BaseController {
|
||||
}
|
||||
logger.info("sendSmsCode2, mobile:{}, type:{}, uid:{}, phoneAreaCode:{} ", mobile, type, uid,phoneAreaCode);
|
||||
if (phoneBlackService.checkIsNeedInterceptWithPhoneAreaCode(phoneAreaCode,mobile)) {
|
||||
throw new ServiceException(BusiStatus.PHONE_BE_INTERCEPTED);
|
||||
throw new ServiceException(BusiStatus.PHONE_NUMBER_BE_INTERCEPTED);
|
||||
}
|
||||
if (!CommonUtil.checkPhoneFormat(phoneAreaCode,mobile)) {
|
||||
return SmsTypeEnum.REGISTER.getValue() == type ? new BusiResult<>(BusiStatus.SMS_SEND_SUCCESS) :
|
||||
@@ -96,7 +96,7 @@ public class SmsController extends BaseController {
|
||||
}
|
||||
boolean verify = smsService.verifySmsCode(mobile, code);
|
||||
if (!verify) {
|
||||
return new BusiResult(BusiStatus.VERIFY_CODE_ERROR);
|
||||
return new BusiResult(BusiStatus.SMS_VERIFY_CODE_ERROR);
|
||||
}
|
||||
return new BusiResult(BusiStatus.SUCCESS);
|
||||
}
|
||||
|
@@ -861,7 +861,7 @@ public class UsersController extends BaseController {
|
||||
HttpServletRequest request) throws Exception {
|
||||
phone = decryptSensitiveInfo(request, phone);
|
||||
if (phoneBlackService.checkIsNeedInterceptWithPhoneAreaCode(phoneAreaCode, phone)) {
|
||||
throw new ServiceException(BusiStatus.PHONE_BE_INTERCEPTED);
|
||||
throw new ServiceException(BusiStatus.PHONE_NUMBER_BE_INTERCEPTED);
|
||||
}
|
||||
return new BusiResult(usersService.boundPhone(getUid(request), phone, code, phoneAreaCode));
|
||||
}
|
||||
|
@@ -50,7 +50,7 @@ public class SmsWithdrawController extends BaseController {
|
||||
HttpServletRequest request) {
|
||||
phone = decryptSensitiveInfo(request, phone);
|
||||
if (phoneBlackService.checkIsNeedIntercept(phone)) {
|
||||
throw new ServiceException(BusiStatus.PHONE_BE_INTERCEPTED);
|
||||
throw new ServiceException(BusiStatus.PHONE_NUMBER_BE_INTERCEPTED);
|
||||
}
|
||||
return BusiResult.success(withdrawService.boundPhone(getUid(), phone, code, phoneAreaCode));
|
||||
}
|
||||
|
@@ -2,6 +2,7 @@ import random
|
||||
import hashlib
|
||||
import requests
|
||||
import time
|
||||
import os
|
||||
|
||||
|
||||
def baidu_translate(word):
|
||||
@@ -29,6 +30,7 @@ def baidu_translate(word):
|
||||
req_get = requests.get(api_url, api_data)
|
||||
# 结果的位置可能不同
|
||||
result_json = req_get.json()
|
||||
print(result_json)
|
||||
result: str = ''
|
||||
if 'trans_result' in result_json:
|
||||
result = result_json['trans_result'][0]['dst']
|
||||
@@ -36,7 +38,6 @@ def baidu_translate(word):
|
||||
|
||||
|
||||
def spider(filepath, suffix):
|
||||
import os
|
||||
code_files = []
|
||||
for root, dirs, files in os.walk(filepath, topdown=False):
|
||||
for f in files:
|
||||
@@ -60,7 +61,7 @@ def message(code_files):
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
code_files = spider('/Users/liaozetao/Downloads/message', '.txt')
|
||||
code_files = spider('/Users/liaozetao/Downloads/', '.txt')
|
||||
msgs = message(code_files)
|
||||
for m in msgs:
|
||||
while True:
|
||||
@@ -80,7 +81,9 @@ if __name__ == '__main__':
|
||||
str2 = str2.split(')')[0]
|
||||
str2 = str2.replace('"', '')
|
||||
content = baidu_translate(str2)
|
||||
print(str1, ', "', content, '"),')
|
||||
if len(str1) > 0 and '(' in str1:
|
||||
str1 = str1.split('(')[0]
|
||||
print('BusiStatus.', str1, '=', content)
|
||||
time.sleep(1)
|
||||
break
|
||||
except Exception as e:
|
||||
|
Reference in New Issue
Block a user