Commit fd44bcc2 by Aeolus

update

parent 197d295b
...@@ -6,10 +6,11 @@ from flask import Blueprint, jsonify, request, g ...@@ -6,10 +6,11 @@ from flask import Blueprint, jsonify, request, g
from pymongo import MongoClient, ASCENDING from pymongo import MongoClient, ASCENDING
from config.wechat_config import platform_config_list from config.wechat_config import platform_config_list
from config.commen_config import LOGIN_TYPE, ACCOUNT_STATUS from config.commen_config import LOGIN_TYPE, ACCOUNT_STATUS
from mongodb_collections.agent_modules import Modules, AdminModules
from service.admin_service import AdminService from service.admin_service import AdminService
from utils.error_code import ACCOUNT_AGENT_SPOT_NULL_ERROR, ACCOUNT_NOT_EXISTS_ERROR, \ from utils.error_code import ACCOUNT_AGENT_SPOT_NULL_ERROR, ACCOUNT_NOT_EXISTS_ERROR, \
ACCOUNT_ALREADY_EXISTS_ERROR, ACCOUNT_ALREADY_DELETE_ERROR, AGNET_MODULES_ERROR, MODULES_NOT_EXISTS_ERROR, \ ACCOUNT_ALREADY_EXISTS_ERROR, ACCOUNT_ALREADY_DELETE_ERROR, AGNET_MODULES_ERROR, MODULES_NOT_EXISTS_ERROR, \
OPERATE_LEVEL_ERROR, Param_Invalid_Error OPERATE_LEVEL_ERROR, Param_Invalid_Error, COMMON_MONGO_ERROR
from utils.error_code import PHONE_NOT_NULL_ERROR, PHONE_NOT_VALID_ERROR, TOKEN_NOT_VALID_ERROR, \ from utils.error_code import PHONE_NOT_NULL_ERROR, PHONE_NOT_VALID_ERROR, TOKEN_NOT_VALID_ERROR, \
VERIFICATION_CODE_INVALID_ERROR, VERIFICATION_CODE_ERROR, PASSWORD_ERROR VERIFICATION_CODE_INVALID_ERROR, VERIFICATION_CODE_ERROR, PASSWORD_ERROR
from models.base_model import db from models.base_model import db
...@@ -80,15 +81,15 @@ def user_login(): ...@@ -80,15 +81,15 @@ def user_login():
new_token = generate_jwt(payload={"user_id": user_info.id}, expiry=time.time() + 24 * 60 * 60) new_token = generate_jwt(payload={"user_id": user_info.id}, expiry=time.time() + 24 * 60 * 60)
agent_log = AdminLoginRecord() admin_log = AdminLoginRecord()
agent_log.phone = user_info.phone admin_log.phone = user_info.phone
agent_log.ip = cur_ip admin_log.ip = cur_ip
agent_log.platform = platform_config_list.index(platform) admin_log.platform = platform_config_list.index(platform)
agent_log.last_login = datetime.datetime.now() admin_log.last_login = datetime.datetime.now()
agent_log.login_type = LOGIN_TYPE['token_login'] admin_log.login_type = LOGIN_TYPE['token_login']
agent_log.created_at = datetime.datetime.now() admin_log.created_at = datetime.datetime.now()
agent_log.updated_at = datetime.datetime.now() admin_log.updated_at = datetime.datetime.now()
db.session.add(agent_log) db.session.add(admin_log)
db.session.commit() db.session.commit()
data['token'] = new_token data['token'] = new_token
...@@ -150,24 +151,22 @@ def get_account_list(): ...@@ -150,24 +151,22 @@ def get_account_list():
page_size = json_data.get("pageSize", None) page_size = json_data.get("pageSize", None)
keyword = json_data.get("keyword", None) keyword = json_data.get("keyword", None)
select_sql = """select agent_account.user_name, agent_account.phone, agent_account.level, agent_account.status, select_sql = """select admin_account.user_name, admin_account.phone, admin_account.level, admin_account.status,
agent_account.comment, agent_account.created_at, agent_account.updated_at, agent_account.last_login, admin_account.comment,admin_account.parent_id,admin_account.rate, admin_account.created_at, admin_account.updated_at, admin_account.last_login,
agent_account.id admin_account.id
""" """
count_sql = "select count(agent_account.id) as total_count" count_sql = "select count(admin_account.id) as total_count"
from_sql = " from agent_account where agent_account.id in ( select agent_account.id " from_sql = " from admin_account where admin_account.id in ( select admin_account.id "
from_sql += " from agent_account " from_sql += " from admin_account "
from_sql += " left join agent_spot on agent_account.id = agent_spot.agent_no " where_sql = " where 0=0 and admin_account.level < {} and admin_account.parent = {}".format(g.user.level, g.user.id)
from_sql += " left join spot on spot.id = agent_spot.spot_no "
where_sql = " where 0=0 "
if keyword: if keyword:
where_sql += """ where_sql += """
and CONCAT(agent_account.user_name,agent_account.phone,spot.spotname) LIKE '%{keyword}%' and CONCAT(admin_account.user_name,admin_account.phone) LIKE '%{keyword}%'
""".format(keyword=keyword) """.format(keyword=keyword)
where_sql += " ) " where_sql += " ) "
order_sql = " ORDER BY agent_account.created_at ASC, agent_account.status ASC" order_sql = " ORDER BY admin_account.id ASC, admin_account.status ASC"
limit_sql = " LIMIT {offset} , {page_size} ".format(offset=(page - 1) * page_size, page_size=page_size) limit_sql = " LIMIT {offset} , {page_size} ".format(offset=(page - 1) * page_size, page_size=page_size)
count_result = db.session.execute(count_sql + from_sql + where_sql).fetchone() count_result = db.session.execute(count_sql + from_sql + where_sql).fetchone()
...@@ -183,10 +182,10 @@ def get_account_list(): ...@@ -183,10 +182,10 @@ def get_account_list():
for info in result: for info in result:
return_data.append( return_data.append(
{"user_name": info.user_name, "phone": info.phone, "level": info.level, "status": info.status, {"user_name": info.user_name, "phone": info.phone, "level": info.level, "status": info.status,
"comment": info.comment, "agent_id": info.id, "comment": info.comment, "admin_id": info.id,
"create_time": info.created_at.strftime("%Y-%m-%d %H:%M:%S") if info.last_login else "", "create_time": info.created_at.strftime("%Y-%m-%d %H:%M:%S") if info.last_login else "",
"update_time": info.updated_at.strftime("%Y-%m-%d %H:%M:%S") if info.last_login else "", "update_time": info.updated_at.strftime("%Y-%m-%d %H:%M:%S") if info.last_login else "",
"login_time": info.last_login.strftime("%Y-%m-%d %H:%M:%S") if info.last_login else ""}) })
return BaseResponse({"list": return_data, "page": page, "pageSize": page_size, "total_count": total_count}) return BaseResponse({"list": return_data, "page": page, "pageSize": page_size, "total_count": total_count})
...@@ -195,17 +194,24 @@ def get_account_list(): ...@@ -195,17 +194,24 @@ def get_account_list():
def get_account_detail(): def get_account_detail():
json_data = request.get_json() json_data = request.get_json()
phone = json_data["phone"] phone = json_data["phone"]
if phone == g.user.phone:
agent_info = AdminAccount.query.filter_by(phone=phone).first() admin_info = g.user
if not agent_info: else:
admin_info = AdminAccount.query.filter(AdminAccount.phone == phone,
AdminAccount.level < g.user.level,
AdminAccount.parent_id == g.user.id).first()
if not admin_info:
return BaseResponse(**ACCOUNT_NOT_EXISTS_ERROR) return BaseResponse(**ACCOUNT_NOT_EXISTS_ERROR)
user_info = {}
user_info["agent_no"] = agent_info.agent_no user_info = {
user_info["user_name"] = agent_info.user_name "admin_no": admin_info.admin_no,
user_info["phone"] = phone "user_name": admin_info.user_name,
user_info["level"] = agent_info.level "phone": admin_info.phone,
user_info["status"] = ACCOUNT_STATUS['on_use'] "level": admin_info.level,
user_info["comment"] = agent_info.comment "status": admin_info.status,
"comment": admin_info.comment
}
return BaseResponse(data=user_info) return BaseResponse(data=user_info)
...@@ -228,7 +234,15 @@ def edit_user(): ...@@ -228,7 +234,15 @@ def edit_user():
if not status: if not status:
return BaseResponse(**Param_Invalid_Error) return BaseResponse(**Param_Invalid_Error)
admin_info = AdminAccount.query.filter_by(phone=old_phone).first() if old_phone == g.user.phone:
admin_info = g.user
if level:
admin_info.level = int(level)
else:
admin_info = AdminAccount.query.filter(AdminAccount.phone == old_phone,
AdminAccount.level < g.user.level,
AdminAccount.parent_id == g.user.id
).first()
if not admin_info: if not admin_info:
return BaseResponse(**ACCOUNT_NOT_EXISTS_ERROR) return BaseResponse(**ACCOUNT_NOT_EXISTS_ERROR)
...@@ -237,9 +251,6 @@ def edit_user(): ...@@ -237,9 +251,6 @@ def edit_user():
admin_info.status = status admin_info.status = status
admin_info.comment = comment admin_info.comment = comment
if level:
admin_info.level = int(level)
if password: if password:
admin_info.password = password admin_info.password = password
...@@ -255,7 +266,8 @@ def delete_user(): ...@@ -255,7 +266,8 @@ def delete_user():
if not phone: if not phone:
return BaseResponse(**PHONE_NOT_NULL_ERROR) return BaseResponse(**PHONE_NOT_NULL_ERROR)
admin_info = AdminAccount.query.filter_by(phone=phone).first() admin_info = AdminAccount.query.filter(AdminAccount.phone == phone,
AdminAccount.level < g.user.level).first()
if not admin_info: if not admin_info:
return BaseResponse(**ACCOUNT_NOT_EXISTS_ERROR) return BaseResponse(**ACCOUNT_NOT_EXISTS_ERROR)
...@@ -264,201 +276,3 @@ def delete_user(): ...@@ -264,201 +276,3 @@ def delete_user():
db.session.commit() db.session.commit()
return BaseResponse() return BaseResponse()
@admin_route.route('/sendCode', methods=['GET', 'POST'])
def send_code():
json_data = request.get_json()
cur_ip = request.remote_addr
phone = json_data['phone'] if 'phone' in json_data else None
if not phone:
return BaseResponse(**PHONE_NOT_NULL_ERROR)
# 判断该手机号是否再数据库中,不在返回无权限登录
agent = AdminAccount.query.filter_by(phone=phone).first()
if not agent:
return BaseResponse(**PHONE_NOT_VALID_ERROR)
# 判断该账号是否已被删除
if agent.status == ACCOUNT_STATUS['delete']:
return BaseResponse(**ACCOUNT_ALREADY_DELETE_ERROR)
# result = Helper.check_phone(phone)
# if not result:
# return BaseResponse(**PHONE_NOT_VALID_ERROR)
sms = SMSService()
result = sms.phoneSendCode(phone, 520391, '灰兔智能')
logger.info(result)
agent_log = AdminLoginRecord()
agent_log.phone = phone
agent_log.ip = cur_ip
agent_log.last_login = datetime.datetime.now()
agent_log.login_type = LOGIN_TYPE['send_code']
agent_log.created_at = datetime.datetime.now()
agent_log.updated_at = datetime.datetime.now()
db.session.add(agent_log)
db.session.commit()
return BaseResponse()
@admin_route.route('/agent_module_list', methods=['GET', 'POST'])
def get_agent_module_list():
agent_id = g.user.id
platform = g.platform
if int(g.user.level) != 1:
agent_modules = AgentModules()
result = agent_modules.find_one({"agent_id": agent_id, "platform": platform})
return_data = {"agent_id": agent_id, "module_list": result["module_list"]}
if result:
return BaseResponse(data=return_data)
else:
return BaseResponse(**AGNET_MODULES_ERROR)
modules = Modules()
result = modules.collection.find({"platform": platform}).sort(
[("parent_id", ASCENDING), ("order_no", ASCENDING)])
if not result:
return BaseResponse(**MODULES_NOT_EXISTS_ERROR)
parent_module_list = list(result)
tmp_data = {}
for i in parent_module_list:
i.pop("_id")
if i["parent_id"] == 0:
i["children"] = []
tmp_data[i["id"]] = i
else:
tmp_data[i["parent_id"]]["children"].append(i)
module_list = list(tmp_data.values())
return_data = {"agent_id": agent_id, "module_list": module_list}
if result:
return BaseResponse(data=return_data)
else:
return BaseResponse(**AGNET_MODULES_ERROR)
@admin_route.route('/agent_module_list_by_agent_id', methods=['GET', 'POST'])
def get_agent_module_list_by_agent_id():
admin_user = g.user
if int(admin_user.level) != 1:
return BaseResponse(**OPERATE_LEVEL_ERROR)
platform = g.platform
json_data = request.get_json()
agent_id = json_data.get("agent_id", None)
agent_modules = AgentModules()
result = agent_modules.find_one({"agent_id": agent_id, "platform": platform})
if result:
return_data = {"agent_id": agent_id, "module_list": result["module_list"]}
else:
return_data = {"agent_id": agent_id, "module_list": []}
return BaseResponse(data=return_data)
@admin_route.route("/set_module_list", methods=['GET', 'POST'])
def set_agent_module_list():
parent_agent_id = g.user.id
platform = g.platform
platform_int = platform
json_data = request.get_json()
module_list = json_data.get("module_list", [])
agent_id = json_data.get("agent_id", None)
if not module_list or not agent_id:
return BaseResponse(**Param_Invalid_Error)
agent_modules = AgentModules()
modules = Modules()
if int(g.user.level) == 1:
result = modules.collection.find({"platform": platform}).sort(
[("parent_id", ASCENDING), ("order_no", ASCENDING)])
if not result:
return BaseResponse(**MODULES_NOT_EXISTS_ERROR)
parent_module_list = list(result)
return_data = []
tmp_data = {}
for i in parent_module_list:
i.pop("_id")
if i["id"] in module_list:
if i["parent_id"] == 0:
i["children"] = []
tmp_data[i["id"]] = i
else:
tmp_data[i["parent_id"]]["children"].append(i)
return_data = list(tmp_data.values())
else:
result = agent_modules.collection.find_one({"platform": platform_int, "agent_id": parent_agent_id})
if not result:
return BaseResponse(**MODULES_NOT_EXISTS_ERROR)
parent_module_list = result["module_list"]
return_data = []
for i in parent_module_list:
if i["id"] in module_list:
tmp_data = i
children_list = i["children"]
tmp_data["children"] = []
for j in children_list:
if j["id"] in module_list:
tmp_data["children"].append(j)
return_data.append(tmp_data)
for i in range(3):
agent_modules.collection.replace_one({'agent_id': agent_id, "platform": platform_int},
{'agent_id': agent_id, "platform": platform_int,
"module_list": return_data},
upsert=True)
result = agent_modules.collection.find_one({'agent_id': agent_id, "platform": platform_int,
"module_list": return_data})
if result:
return BaseResponse()
else:
continue
return BaseResponse(**COMMON_MONGO_ERROR)
# @admin_route.route("/set_super_user_module_list", methods=['GET', 'POST'])
def set_super_agent_module_list():
platform = g.platform
platform_int = platform
json_data = request.get_json()
module_list = json_data.get("module_list", [])
agent_id_list = json_data.get("agent_id_list", None)
if not module_list or not agent_id_list:
return BaseResponse(**Param_Invalid_Error)
agent_modules = AgentModules()
modules = Modules()
result = modules.collection.find({"platform": platform_int, "id": {"$in": module_list}}).sort(
[("parent_id", ASCENDING), ("order_no", ASCENDING)])
if not result:
return BaseResponse(**MODULES_NOT_EXISTS_ERROR)
parent_module_list = list(result)
tmp_data = {}
for i in parent_module_list:
i.pop("_id")
if i["parent_id"] == 0:
i["children"] = []
tmp_data[i["id"]] = i
else:
tmp_data[i["parent_id"]]["children"].append(i)
return_data = list(tmp_data.values())
for agent_id in agent_id_list:
for i in range(3):
agent_modules.collection.replace_one({'agent_id': agent_id, "platform": platform_int},
{'agent_id': agent_id, "platform": platform_int,
"module_list": return_data},
upsert=True)
result = agent_modules.collection.find_one({'agent_id': agent_id, "platform": platform_int,
"module_list": return_data})
if result:
break
else:
continue
return BaseResponse()
#!usr/bin/env python # -*- coding:utf-8 _*- """ @version: author:Aeolus @file: error_code.py """ ### 通用错误相关 Param_Invalid_Error = { "error_code": "500", "error_message": "params is invalid, 参数无效" } TOKEN_NOT_VALID_ERROR = { "error_code": "1001", "error_message": "无效的token" } TOKEN_NOT_PROVIDED_ERROR = { "error_code": "1002", "error_message": "token未提供" } TOKEN_EXPIRE_ERROR = { "error_code": "1003", "error_message": "token超时" } PHONE_NOT_BINDING_ERROR = { "error_code": "1004", "error_message": "未绑定手机号" } PHONE_NOT_NULL_ERROR = { "error_code": "1005", "error_message": "手机号为空" } PHONE_NOT_VALID_ERROR = { "error_code": "1006", "error_message": "无效的手机号" } USER_ALREADY_REGISTER_ERROR = { "error_code": "1007", "error_message": "用户已注册" } VERIFICATION_CODE_NULL_ERROR = { "error_code": "1008", "error_message": "验证码为空" } VERIFICATION_CODE_INVALID_ERROR = { "error_code": "1009", "error_message": "验证码已失效" } VERIFICATION_CODE_ERROR = { "error_code": "1010", "error_message": "验证码错误" } PASSWORD_ERROR = { "error_code": "1011", "error_message": "账号或密码错误" } # 账号相关 12开头 ACCOUNT_ALREADY_EXISTS_ERROR = { "error_code": '1012', "error_message": "该账号已存在" } ACCOUNT_NOT_EXISTS_ERROR = { "error_code": '1013', "error_message": "账号不存在" } ACCOUNT_ALREADY_DELETE_ERROR = { "error_code": '1014', "error_message": "账号已被删除" } ACCOUNT_AGENT_SPOT_NULL_ERROR = { "error_code": '1015', "error_message": "代理商景点列表为空" } AGNET_MODULES_ERROR = { "error_code": '1016', "error_message": "用户未绑定模块" } OPERATE_TYPE_ERROR = { "error_code": '1017', "error_message": "type错误" } OPERATE_LEVEL_ERROR = { "error_code": '1018', "error_message": "权限错误" } OPERATE_ERROR = { "error_code": '1019', "error_message": "操作有误" } MODULES_NOT_EXISTS_ERROR = { "error_code": '1020', "error_message": "modules not exists,模块不存在" } ACCOUNT_AGENT_SPOT_NOT_EXIST = { "error_code": '1021', "error_message": "agent spot not exists,代理景区不存在" } AGENT_MACHINE_NOT_EXIST = { "error_code": '1022', "error_message": "agent machine not exists,代理机柜不存在" } ## 微信登陆相关 WX_LOGIN_DATA_ERROR = { "error_code": "3001", "error_message": "微信登录数据错误" } WX_LOGIN_CODE_ERROR = { "error_code": "3002", "error_message": "微信登录code值错误" } WX_OPENID_NOT_GET_ERROR = { "error_code": "3003", "error_message": "微信OpenId获取失败,请刷新重试" } WX_SESSION_KEY_ERROR = { "error_code": "3004", "error_message": "session key error" } ### 微信支付相关 WE_MINIAPP_PAY_FAIL = { "error_code": "3101", "error_message": "小程序下单失败" } ### 消息推送相关 WXBizMsgCrypt_OK = { "error_code": "0", "error_message": "WXBizMsgCrypt_OK" } WXBizMsgCrypt_ValidateSignature_Error = { "error_code": "4001", "error_message": "验证签名错误" } WXBizMsgCrypt_ParseXml_Error = { "error_code": "4002", "error_message": "解析xml错误" } WXBizMsgCrypt_ComputeSignature_Error = { "error_code": "4003", "error_message": "计算签名错误" } WXBizMsgCrypt_IllegalAesKey = { "error_code": "4004", "error_message": "Aes key非法错误" } WXBizMsgCrypt_ValidateAppid_Error = { "error_code": "4005", "error_message": "appid错误" } WXBizMsgCrypt_EncryptAES_Error = { "error_code": "4006", "error_message": "aes加密错误" } WXBizMsgCrypt_DecryptAES_Error = { "error_code": "4007", "error_message": "aes解密错误" } WXBizMsgCrypt_IllegalBuffer = { "error_code": "4008", "error_message": "illegal buffer" } WXBizMsgCrypt_EncodeBase64_Error = { "error_code": "4009", "error_message": "base64加密错误" } WXBizMsgCrypt_DecodeBase64_Error = { "error_code": "4010", "error_message": "base64解密错误" } WXBizMsgCrypt_GenReturnXml_Error = { "error_code": "4011", "error_message": "gen return xml error" } MACHINE_NOT_EXIST_ERROR = { "error_code": '5001', "error_message": "机柜不存在" } MACHINE_IS_USE_ERROR = { "error_code": '5002', "error_message": "已有他人正在租借中,请稍后" } MACHINE_IS_NOT_ONLINE_ERROR = { "error_code": '5003', "error_message": "机柜不在线" } MACHINE_ADD_ERROR = { "error_code": '5004', "error_message": "机柜添加失败" } MACHINE_NO_DUPLICATE_ERROR = { "error_code": '5005', "error_message": "machine_no duplicate,机柜编号重复" } MACHINE_EDIT_ERROR = { "error_code": '5006', "error_message": "machine edit error, 机柜修改错误" } HATCH_NOT_EXIST_ERROR = { "error_code": "5007", "error_message": "no hatch, 没有商品信息" } HATCH_NOT_ALL_EXIST_ERROR = { "error_code": "5008", "error_message": "no all hatch, 存在已售出商品" } HATCH_COUNT_ERROR = { "error_code": "5009", "error_message": "hatch count error, 商品数量错误,检查数量" } MACHINE_ACTIVATED_ERROR = { "error_code": '5010', "error_message": "machine activated, 机柜已激活" } ### 订单相关 RENT_ORDER_NOT_BACK_ERROR = { "error_code": '6101', "error_message": "有未归还的订单" } RENT_ORDER_NOT_TAKE_ERROR = { "error_code": '6102', "error_message": "有未取货的订单" } RENT_ORDER_NUMBER_MAX = { "error_code": '6103', "error_message": "订单数量达到上限" } TAKE_CODE_NOT_VALID = { "error_code": '6104', "error_message": "取货码错误请确认手机号及取货码是否匹配" } CODE_CANCEL_ERROR = { "error_code": '6105', "error_message": "取货码已取消" } CODE_USED_ERROR = { "error_code": '6108', "error_message": "取货码已使用" } NO_POWER_ERROR = { "error_code": '6106', "error_message": "没有可租借设备" } NO_RENT_RECORD = { "error_code": '6107', "error_message": "订单不存在" } CODE_USED_ERROR = { "error_code": '6108', "error_message": "取货码已使用" } RENT_ORDER_NUMBER_LIMIT = { "error_code": '6109', "error_message": "机柜只允许租借一台" } REFUND_NOT_RENT_INFO = { "error_code": "6301", "error_message": "没有该订单信息" } REFUND_BACK_TIME_ERROR = { "error_code": "6302", "error_message": "归还时间异常" } REFUND_NOT_PRODUCTION_INFO = { "error_code": "6303", "error_message": "没有该讲解器信息" } REFUND_MONEY_IS_ZERO = { "error_code": "6304", "error_message": "退款金额为零" } REFUND_NO_DUPLICATE = { "error_code": "6305", "error_message": "退款单号重复" } TALLYMAN_ACCOUNT_EXIST = { "error_code": "7001", "error_message": "tallyman account exist, 补货员账号已存在" } TALLYMAN_ACCOUNT_NOT_EXIST = { "error_code": "7002", "error_message": "tallyman account not exist, 补货员账号不存在" } NFC_CARD_NOT_EXIST = { "error_code": "8001", "error_message": "nfc card not exist, 卡号错误" } NFC_CARD_ACTIVATED_ERROR = { "error_code": "8002", "error_message": "nfc card activated, 卡片已激活" } NO_NFC_CARD_ERROR = { "error_code": "8003", "error_message": "no nfc card , 不存在卡片" } RE_NFC_CARD_ERROR = { "error_code": "8004", "error_message": "re nfc card , 卡片已存在" } NFC_PAY_LOAD_SECRET_ERROR = { "error_code": "8005", "error_message": "secret error , 身份验证失败" } NO_PLACE_ERROR = { "error_code": "9001", "error_message": "no place error,不存在场景" } #!usr/bin/env python # -*- coding:utf-8 _*- """ @version: author:Aeolus @file: error_code.py """ ### 通用错误相关 Param_Invalid_Error = { "error_code": "500", "error_message": "params is invalid, 参数无效" } TOKEN_NOT_VALID_ERROR = { "error_code": "1001", "error_message": "无效的token" } TOKEN_NOT_PROVIDED_ERROR = { "error_code": "1002", "error_message": "token未提供" } TOKEN_EXPIRE_ERROR = { "error_code": "1003", "error_message": "token超时" } PHONE_NOT_BINDING_ERROR = { "error_code": "1004", "error_message": "未绑定手机号" } PHONE_NOT_NULL_ERROR = { "error_code": "1005", "error_message": "手机号为空" } PHONE_NOT_VALID_ERROR = { "error_code": "1006", "error_message": "无效的手机号" } USER_ALREADY_REGISTER_ERROR = { "error_code": "1007", "error_message": "用户已注册" } VERIFICATION_CODE_NULL_ERROR = { "error_code": "1008", "error_message": "验证码为空" } VERIFICATION_CODE_INVALID_ERROR = { "error_code": "1009", "error_message": "验证码已失效" } VERIFICATION_CODE_ERROR = { "error_code": "1010", "error_message": "验证码错误" } PASSWORD_ERROR = { "error_code": "1011", "error_message": "账号或密码错误" } # 账号相关 12开头 ACCOUNT_ALREADY_EXISTS_ERROR = { "error_code": '1012', "error_message": "该账号已存在" } ACCOUNT_NOT_EXISTS_ERROR = { "error_code": '1013', "error_message": "账号不存在" } ACCOUNT_ALREADY_DELETE_ERROR = { "error_code": '1014', "error_message": "账号已被删除" } ACCOUNT_AGENT_SPOT_NULL_ERROR = { "error_code": '1015', "error_message": "代理商景点列表为空" } AGNET_MODULES_ERROR = { "error_code": '1016', "error_message": "用户未绑定模块" } OPERATE_TYPE_ERROR = { "error_code": '1017', "error_message": "type错误" } OPERATE_LEVEL_ERROR = { "error_code": '1018', "error_message": "权限错误" } OPERATE_ERROR = { "error_code": '1019', "error_message": "操作有误" } MODULES_NOT_EXISTS_ERROR = { "error_code": '1020', "error_message": "modules not exists,模块不存在" } ACCOUNT_AGENT_SPOT_NOT_EXIST = { "error_code": '1021', "error_message": "agent spot not exists,代理景区不存在" } AGENT_MACHINE_NOT_EXIST = { "error_code": '1022', "error_message": "agent machine not exists,代理机柜不存在" } ## 微信登陆相关 WX_LOGIN_DATA_ERROR = { "error_code": "3001", "error_message": "微信登录数据错误" } WX_LOGIN_CODE_ERROR = { "error_code": "3002", "error_message": "微信登录code值错误" } WX_OPENID_NOT_GET_ERROR = { "error_code": "3003", "error_message": "微信OpenId获取失败,请刷新重试" } WX_SESSION_KEY_ERROR = { "error_code": "3004", "error_message": "session key error" } ### 微信支付相关 WE_MINIAPP_PAY_FAIL = { "error_code": "3101", "error_message": "小程序下单失败" } ### 消息推送相关 WXBizMsgCrypt_OK = { "error_code": "0", "error_message": "WXBizMsgCrypt_OK" } WXBizMsgCrypt_ValidateSignature_Error = { "error_code": "4001", "error_message": "验证签名错误" } WXBizMsgCrypt_ParseXml_Error = { "error_code": "4002", "error_message": "解析xml错误" } WXBizMsgCrypt_ComputeSignature_Error = { "error_code": "4003", "error_message": "计算签名错误" } WXBizMsgCrypt_IllegalAesKey = { "error_code": "4004", "error_message": "Aes key非法错误" } WXBizMsgCrypt_ValidateAppid_Error = { "error_code": "4005", "error_message": "appid错误" } WXBizMsgCrypt_EncryptAES_Error = { "error_code": "4006", "error_message": "aes加密错误" } WXBizMsgCrypt_DecryptAES_Error = { "error_code": "4007", "error_message": "aes解密错误" } WXBizMsgCrypt_IllegalBuffer = { "error_code": "4008", "error_message": "illegal buffer" } WXBizMsgCrypt_EncodeBase64_Error = { "error_code": "4009", "error_message": "base64加密错误" } WXBizMsgCrypt_DecodeBase64_Error = { "error_code": "4010", "error_message": "base64解密错误" } WXBizMsgCrypt_GenReturnXml_Error = { "error_code": "4011", "error_message": "gen return xml error" } MACHINE_NOT_EXIST_ERROR = { "error_code": '5001', "error_message": "机柜不存在" } MACHINE_IS_USE_ERROR = { "error_code": '5002', "error_message": "已有他人正在租借中,请稍后" } MACHINE_IS_NOT_ONLINE_ERROR = { "error_code": '5003', "error_message": "机柜不在线" } MACHINE_ADD_ERROR = { "error_code": '5004', "error_message": "机柜添加失败" } MACHINE_NO_DUPLICATE_ERROR = { "error_code": '5005', "error_message": "machine_no duplicate,机柜编号重复" } MACHINE_EDIT_ERROR = { "error_code": '5006', "error_message": "machine edit error, 机柜修改错误" } HATCH_NOT_EXIST_ERROR = { "error_code": "5007", "error_message": "no hatch, 没有商品信息" } HATCH_NOT_ALL_EXIST_ERROR = { "error_code": "5008", "error_message": "no all hatch, 存在已售出商品" } HATCH_COUNT_ERROR = { "error_code": "5009", "error_message": "hatch count error, 商品数量错误,检查数量" } MACHINE_ACTIVATED_ERROR = { "error_code": '5010', "error_message": "machine activated, 机柜已激活" } ### 订单相关 RENT_ORDER_NOT_BACK_ERROR = { "error_code": '6101', "error_message": "有未归还的订单" } RENT_ORDER_NOT_TAKE_ERROR = { "error_code": '6102', "error_message": "有未取货的订单" } RENT_ORDER_NUMBER_MAX = { "error_code": '6103', "error_message": "订单数量达到上限" } TAKE_CODE_NOT_VALID = { "error_code": '6104', "error_message": "取货码错误请确认手机号及取货码是否匹配" } CODE_CANCEL_ERROR = { "error_code": '6105', "error_message": "取货码已取消" } CODE_USED_ERROR = { "error_code": '6108', "error_message": "取货码已使用" } NO_POWER_ERROR = { "error_code": '6106', "error_message": "没有可租借设备" } NO_RENT_RECORD = { "error_code": '6107', "error_message": "订单不存在" } CODE_USED_ERROR = { "error_code": '6108', "error_message": "取货码已使用" } RENT_ORDER_NUMBER_LIMIT = { "error_code": '6109', "error_message": "机柜只允许租借一台" } REFUND_NOT_RENT_INFO = { "error_code": "6301", "error_message": "没有该订单信息" } REFUND_BACK_TIME_ERROR = { "error_code": "6302", "error_message": "归还时间异常" } REFUND_NOT_PRODUCTION_INFO = { "error_code": "6303", "error_message": "没有该讲解器信息" } REFUND_MONEY_IS_ZERO = { "error_code": "6304", "error_message": "退款金额为零" } REFUND_NO_DUPLICATE = { "error_code": "6305", "error_message": "退款单号重复" } TALLYMAN_ACCOUNT_EXIST = { "error_code": "7001", "error_message": "tallyman account exist, 补货员账号已存在" } TALLYMAN_ACCOUNT_NOT_EXIST = { "error_code": "7002", "error_message": "tallyman account not exist, 补货员账号不存在" } NFC_CARD_NOT_EXIST = { "error_code": "8001", "error_message": "nfc card not exist, 卡号错误" } NFC_CARD_ACTIVATED_ERROR = { "error_code": "8002", "error_message": "nfc card activated, 卡片已激活" } NO_NFC_CARD_ERROR = { "error_code": "8003", "error_message": "no nfc card , 不存在卡片" } RE_NFC_CARD_ERROR = { "error_code": "8004", "error_message": "re nfc card , 卡片已存在" } NFC_PAY_LOAD_SECRET_ERROR = { "error_code": "8005", "error_message": "secret error , 身份验证失败" } NO_PLACE_ERROR = { "error_code": "9001", "error_message": "no place error,不存在场景" } # COMMON_MONGO_ERROR = { "error_code": 5001, "error_message": "mongodb operation error, mongodb操作错误" }
\ No newline at end of file \ No newline at end of file
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment