Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
Automat
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
冯佳佳
Automat
Commits
e64c0af3
Commit
e64c0af3
authored
Jan 07, 2022
by
yanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
05b51d64
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
248 additions
and
31 deletions
+248
-31
models/models.py
+9
-0
myapps/management/api/__init__.py
+6
-2
myapps/management/api/login.py
+20
-10
myapps/management/api/machine_portal.py
+71
-14
myapps/management/api/rent_portal.py
+3
-3
myapps/management/api/tallyman_portal.py
+126
-0
service/machine_service.py
+11
-0
utils/error_code.py
+2
-2
No files found.
models/models.py
View file @
e64c0af3
...
...
@@ -384,3 +384,12 @@ class Management(Base):
# 使用check_password,进行密码校验,返回True False。
def
check_password
(
self
,
pasword
):
return
check_password_hash
(
self
.
_password_hash_
,
pasword
)
class
TallymanPlace
(
Base
):
__tablename__
=
'tallyman_place'
id
=
Column
(
INTEGER
(
11
),
primary_key
=
True
,
unique
=
True
)
user_id
=
Column
(
String
(
25
,
'utf8mb4_unicode_ci'
))
place_id
=
Column
(
String
(
255
,
'utf8mb4_unicode_ci'
))
status
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
comment
=
'状态1绑定 -1未绑定'
)
created_at
=
Column
(
DateTime
,
nullable
=
False
,
server_default
=
text
(
"CURRENT_TIMESTAMP"
))
updated_at
=
Column
(
DateTime
,
nullable
=
False
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
))
myapps/management/api/__init__.py
View file @
e64c0af3
...
...
@@ -7,9 +7,10 @@ author:Aeolus
"""
from
flask
import
Flask
from
myapps.management.api.rent_
query
import
rent_query_route
from
myapps.management.api.machine_
management
import
machine_query_route
from
myapps.management.api.rent_
portal
import
rent_query_route
from
myapps.management.api.machine_
portal
import
machine_query_route
from
myapps.management.api.login
import
login_route
from
myapps.management.api.tallyman_portal
import
tallyman_route
...
...
@@ -18,3 +19,6 @@ def register_management_blueprint(app: Flask):
app
.
register_blueprint
(
rent_query_route
,
url_prefix
=
prefix
+
"/rent"
)
app
.
register_blueprint
(
machine_query_route
,
url_prefix
=
prefix
+
"/machine"
)
app
.
register_blueprint
(
login_route
,
url_prefix
=
prefix
+
"/login"
)
app
.
register_blueprint
(
tallyman_route
,
url_prefix
=
prefix
+
"/tallyman"
)
myapps/management/api/login.py
View file @
e64c0af3
...
...
@@ -3,9 +3,12 @@
import
json
import
logging
import
re
import
time
import
os
from
utils.jwt_util
import
generate_jwt
from
config.env_path_config
import
env_path
from
dotenv
import
load_dotenv
from
flask
import
Blueprint
,
request
,
jsonify
,
g
from
models.base_model
import
db
from
utils.my_response
import
BaseResponse
...
...
@@ -22,16 +25,19 @@ def login():
json_date
=
request
.
get_json
()
number
=
json_date
[
"number"
]
password
=
json_date
[
'password'
]
key
=
json_date
[
"key"
]
#手机号登录
phone_result
=
Management
.
query
.
filter_by
(
phone
=
number
,
status
=
1
)
.
first
()
if
phone_result
:
# 进行密码验证
if
phone_result
.
check_password
(
password
)
==
True
:
token_making
=
generate_token
(
key
,
360
)
# 从获取库里获取key
ky
=
phone_result
.
key
return
BaseResponse
(
data
=
certify_token
(
ky
,
token_making
))
load_dotenv
(
dotenv_path
=
env_path
,
verbose
=
True
,
override
=
True
)
SECRET_KEY
=
os
.
getenv
(
'SECRET_KEY'
)
token
=
generate_jwt
({
"user_no"
:
'SK000007'
},
time
.
time
()
+
6000
,
SECRET_KEY
)
date
=
{
"token"
:
token
,
"success"
:
True
}
return
BaseResponse
(
data
=
date
)
else
:
return
BaseResponse
(
**
PASSWORD_ERROR
)
...
...
@@ -40,10 +46,14 @@ def login():
if
user_result
:
# 进行密码验证
if
user_result
.
check_password
(
password
)
==
True
:
token_making
=
generate_token
(
key
,
360
)
# 从获取库里获取key
ky
=
user_result
.
key
return
BaseResponse
(
data
=
certify_token
(
ky
,
token_making
))
load_dotenv
(
dotenv_path
=
env_path
,
verbose
=
True
,
override
=
True
)
SECRET_KEY
=
os
.
getenv
(
'SECRET_KEY'
)
token
=
generate_jwt
({
"user_no"
:
'SK000007'
},
time
.
time
()
+
6000
,
SECRET_KEY
)
date
=
{
"token"
:
token
,
"success"
:
True
}
return
BaseResponse
(
data
=
date
)
else
:
return
BaseResponse
(
**
PASSWORD_ERROR
)
...
...
myapps/management/api/machine_
management
.py
→
myapps/management/api/machine_
portal
.py
View file @
e64c0af3
...
...
@@ -5,23 +5,14 @@ import json
import
logging
import
re
import
time
from
flask
import
Blueprint
,
request
,
jsonify
,
g
from
models.base_model
import
db
from
utils.my_response
import
BaseResponse
from
models.models
import
Machine
,
Hatch
from
utils.error_code
import
MACHINE_NOT_EXIST_ERROR
from
models.models
import
Machine
,
Hatch
,
Place
from
utils.error_code
import
MACHINE_NOT_EXIST_ERROR
,
NO_PLACE_ERROR
logger
=
logging
.
getLogger
(
__name__
)
# 创建蓝图
machine_query_route
=
Blueprint
(
'machine'
,
__name__
)
# 模糊查询到机器信息
@machine_query_route.route
(
"query_machine"
,
methods
=
[
"post"
])
def
query_machine
():
json_date
=
request
.
get_json
()
number
=
json_date
[
"number"
]
page
=
json_date
[
"page"
]
page_size
=
json_date
[
"page_size"
]
pass
# 修改机器信息
@machine_query_route.route
(
"query_edit"
,
methods
=
[
"post"
])
def
query_edit
():
...
...
@@ -37,7 +28,8 @@ def query_edit():
{
"address"
:
address
,
"short_address"
:
short_address
,
"status"
:
status
}
)
db
.
session
.
commit
()
return
BaseResponse
()
return
BaseResponse
(
data
=
True
)
# 显出机柜数量
@machine_query_route.route
(
"hatch_query"
,
methods
=
[
"post"
])
def
hatch_query
():
...
...
@@ -78,7 +70,7 @@ def query():
else
:
# 有返回add信息
add_result
=
Machine
.
query
.
filter
(
Machine
.
address
.
like
(
"
%
"
+
get_number
+
"
%
"
))
.
offset
((
page
-
1
)
*
page_size
)
.
limit
(
page_size
)
.
all
()
)
result_date
=
[]
for
add
in
add_result
:
date
=
{
...
...
@@ -92,7 +84,7 @@ def query():
return
BaseResponse
(
data
=
result_date
,
page
=
page
,
page_size
=
page_size
)
else
:
machine_result
=
Machine
.
query
.
filter
(
Machine
.
machine_no
.
like
(
"
%
"
+
get_number
+
"
%
"
))
.
offset
((
page
-
1
)
*
page_size
)
.
\
limit
(
page_size
)
.
all
()
limit
(
page_size
)
result_date
=
[]
for
machine
in
machine_result
:
date
=
{
...
...
@@ -104,3 +96,68 @@ def query():
}
result_date
.
append
(
date
)
return
BaseResponse
(
data
=
result_date
,
page
=
page
,
page_size
=
page_size
)
# 机器查询machine_query
@machine_query_route.route
(
"machine_query"
,
methods
=
[
"post"
])
def
machine_query
():
json_date
=
request
.
get_json
()
page
=
json_date
[
"page"
]
page_size
=
json_date
[
"page_size"
]
if
"machine_no"
in
json_date
:
machine_no
=
json_date
[
"machine_no"
]
machine_result
=
Machine
.
query
.
filter
(
Machine
.
machine_no
.
like
(
"
%
"
+
machine_no
+
"
%
"
))
.
offset
((
page
-
1
)
*
page_size
)
.
limit
(
page_size
)
elif
"machine_mac"
in
json_date
:
machine_mac
=
json_date
[
"machine_mac"
]
machine_result
=
Machine
.
query
.
filter
(
Machine
.
mac
.
like
(
"
%
"
+
machine_mac
+
"
%
"
))
.
offset
((
page
-
1
)
*
page_size
)
.
limit
(
page_size
)
else
:
machine_result
=
Machine
.
query
.
filter_by
()
.
offset
((
page
-
1
)
*
page_size
)
.
limit
(
page_size
)
result_date
=
[]
# 将数据遍历和筛选
for
i
in
machine_result
:
date
=
{
"machine_no"
:
i
.
machine_no
,
"machine_mac"
:
i
.
mac
,
"status"
:
i
.
status
,
"short_address"
:
i
.
short_address
,
"address"
:
i
.
address
,
"address_id"
:
i
.
place_id
}
result_date
.
append
(
date
)
return
BaseResponse
(
date
=
result_date
)
# 编辑机柜edit_machine
@machine_query_route.route
(
"edit_machine"
,
methods
=
[
"post"
])
def
update_machine
():
json_data
=
request
.
get_json
()
machine_no
=
json_data
[
"machine_no"
]
machine_mac
=
json_data
[
"machine_mac"
]
short_address
=
json_data
[
"short_address"
]
if
"short_address"
in
json_data
else
None
address_id
=
json_data
[
"address_id"
]
address_result
=
Place
.
query
.
filter_by
(
id
=
address_id
)
.
first
()
if
not
address_result
:
return
NO_PLACE_ERROR
machine_result
=
Machine
.
query
.
filter_by
(
mac
=
machine_mac
)
.
first
()
if
not
machine_result
:
return
MACHINE_NOT_EXIST_ERROR
machine_result
.
no
=
machine_no
machine_result
.
place_id
=
address_id
machine_result
.
short_address
=
address_result
.
place_name
machine_result
.
short_address
=
short_address
db
.
session
.
add
(
machine_result
)
db
.
session
.
commit
()
return
BaseResponse
(
date
=
{
"success"
:
True
})
# 更换机器状态change_machine_status
@machine_query_route.route
(
"change_machine_status"
,
methods
=
[
"post"
])
def
update_status
():
json_data
=
request
.
get_json
()
machine_mac
=
json_data
[
"machine_mac"
]
status
=
json_data
[
"status"
]
machine_result
=
Machine
.
query
.
filter_by
(
mac
=
machine_mac
)
.
first
()
if
not
machine_result
:
return
MACHINE_NOT_EXIST_ERROR
machine_result
.
status
=
status
db
.
session
.
add
(
machine_result
)
db
.
session
.
commit
()
return
BaseResponse
(
date
=
{
"success"
:
True
})
myapps/management/api/rent_
query
.py
→
myapps/management/api/rent_
portal
.py
View file @
e64c0af3
...
...
@@ -90,8 +90,8 @@ def details():
"back_money"
:
result
.
back_money
,
"is_pay"
:
result
.
is_pay
,
"rent_type"
:
result
.
rent_type
,
"add_time"
:
result
.
add_time
,
"pay_time"
:
result
.
pay_time
,
"add_time"
:
result
.
add_time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
,
"pay_time"
:
result
.
pay_time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
,
"over_time"
:
result
.
over_time
}
result_date
.
append
(
data
)
...
...
@@ -125,4 +125,4 @@ def edit_s():
db
.
session
.
add
(
rent_refund
)
db
.
session
.
commit
()
return
BaseResponse
()
return
BaseResponse
(
data
=
True
)
myapps/management/api/tallyman_portal.py
0 → 100644
View file @
e64c0af3
# -*- coding: utf-8 -*-
import
datetime
import
logging
import
time
from
flask
import
Blueprint
,
jsonify
,
request
,
g
from
sqlalchemy
import
func
from
config.base_config
import
MONGO_DATABASE_URI
from
config.commen_config
import
LOGIN_TYPE
from
models.base_model
import
db
from
models.models
import
TallymanAccount
,
TallymanMachine
,
TallymanLoginRecord
,
Machine
,
Hatch
,
TallyRecord
,
\
TallymanPlace
from
service.tallyman_service
import
TallymanService
from
utils.error_code
import
TALLYMAN_ACCOUNT_EXIST
,
PHONE_NOT_VALID_ERROR
,
TOKEN_NOT_VALID_ERROR
,
PASSWORD_ERROR
,
\
TALLYMAN_ACCOUNT_NOT_EXIST
,
MACHINE_NOT_EXIST_ERROR
,
HATCH_NOT_EXIST_ERROR
,
MACHINE_ACTIVATED_ERROR
,
\
USER_ALREADY_REGISTER_ERROR
from
utils.jwt_util
import
verify_jwt
,
generate_jwt
from
utils.my_response
import
BaseResponse
logger
=
logging
.
getLogger
(
__name__
)
tallyman_route
=
Blueprint
(
'tallyman'
,
__name__
)
@tallyman_route.route
(
'/add_man'
,
methods
=
[
'GET'
,
'POST'
])
def
add_man
():
# 添加补货员账号
json_data
=
request
.
get_json
()
user_name
=
json_data
[
'name'
]
phone
=
json_data
[
'phone'
]
password
=
json_data
[
'password'
]
comment
=
json_data
[
'comment'
]
if
'comment'
in
json_data
else
None
# 是否存在手机号码
tallyman
=
TallymanAccount
.
query
.
filter_by
(
phone
=
phone
)
.
first
()
if
tallyman
:
if
tallyman
.
status
!=
-
1
:
return
jsonify
(
TALLYMAN_ACCOUNT_EXIST
)
else
:
tallyman
=
TallymanAccount
()
tallyman
.
user_no
=
"todo"
tallyman
.
level
=
1
tallyman
.
user_name
=
user_name
tallyman
.
phone
=
phone
tallyman
.
status
=
1
tallyman
.
comment
=
comment
tallyman
.
created_at
=
datetime
.
datetime
.
now
()
tallyman
.
updated_at
=
datetime
.
datetime
.
now
()
if
password
:
tallyman
.
password
=
password
db
.
session
.
add
(
tallyman
)
db
.
session
.
commit
()
tallyman
.
user_no
=
"SK"
+
str
(
tallyman
.
id
)
.
zfill
(
6
)
db
.
session
.
add
(
tallyman
)
db
.
session
.
commit
()
return
BaseResponse
(
date
=
{
"success"
:
True
})
# 删除补货员
@tallyman_route.route
(
'/del_man'
,
methods
=
[
'GET'
,
'POST'
])
def
del_man
():
json_date
=
request
.
get_json
()
tallyman_id
=
json_date
[
"tallyman_id"
]
tall_result
=
TallymanAccount
.
query
.
filter_by
(
id
=
tallyman_id
)
.
first
()
if
not
tall_result
:
return
TALLYMAN_ACCOUNT_NOT_EXIST
tall_result
.
status
=
-
1
db
.
session
.
add
(
tall_result
)
db
.
session
.
commit
()
return
BaseResponse
(
date
=
{
"success"
:
True
})
# 补货员list
@tallyman_route.route
(
"/query_man"
,
methods
=
[
'POST'
])
def
tallyman
():
json_date
=
request
.
get_json
()
tallyman
=
json_date
[
'tallyman'
]
page
=
json_date
[
"page"
]
page_size
=
json_date
[
"page_size"
]
tallyman_result
=
TallymanAccount
.
query
.
filter
(
TallymanAccount
.
user_name
.
like
(
"
%
"
+
tallyman
+
"
%
"
),
TallymanAccount
.
status
==
1
)
.
offset
\
((
page
-
1
)
*
page_size
)
.
limit
(
page_size
)
result_date
=
[]
for
i
in
tallyman_result
:
query1
=
"SELECT b.place_name,a.user_id,b.id as 'place_id' FROM tallyman_place as a JOIN place as b ON"
\
" a.place_id = b.id where user_id= {} "
.
format
(
i
.
id
)
man_place_res
=
db
.
session
.
execute
(
query1
)
.
fetchone
()
date
=
{
"tallyman_id"
:
i
.
id
,
"user_no"
:
i
.
user_no
,
"user_name"
:
i
.
user_name
,
"level"
:
i
.
level
,
"phone"
:
i
.
phone
,
"status"
:
i
.
status
,
"last_login"
:
i
.
last_login
,
"address_id"
:
man_place_res
[
2
],
"address_name"
:
man_place_res
[
0
]
}
result_date
.
append
(
date
)
return
BaseResponse
(
date
=
result_date
)
# 编辑补货员信息
@tallyman_route.route
(
"/edit_man"
,
methods
=
[
"POST"
])
def
edit_man
():
json_date
=
request
.
get_json
()
tallyman_id
=
json_date
[
"tallyman_id"
]
phone
=
json_date
[
"phone"
]
t_name
=
json_date
[
"t_name"
]
level
=
json_date
[
"level"
]
machine_place_id
=
json_date
[
"machine_place_id"
]
man_result
=
TallymanAccount
.
query
.
filter_by
(
id
=
tallyman_id
)
.
first
()
if
not
man_result
:
return
TALLYMAN_ACCOUNT_NOT_EXIST
phone_not
=
TallymanAccount
.
query
.
filter_by
(
phone
=
phone
,
status
=
1
)
.
first
()
if
phone_not
:
return
USER_ALREADY_REGISTER_ERROR
man_result
.
phone
=
phone
man_result
.
user_name
=
t_name
man_result
.
level
=
level
db
.
session
.
add
(
man_result
)
machine_place_res
=
TallymanPlace
.
query
.
filter_by
(
user_id
=
tallyman_id
)
.
first
()
if
not
machine_place_res
:
return
TALLYMAN_ACCOUNT_NOT_EXIST
machine_place_res
.
place_id
=
machine_place_id
db
.
session
.
add
(
machine_place_res
)
db
.
session
.
commit
()
return
BaseResponse
(
date
=
{
"success"
:
True
})
# 为补货员添加机器
\ No newline at end of file
service/machine_service.py
0 → 100644
View file @
e64c0af3
# -*- coding: utf-8 -*-
import
logging
from
flask
import
Blueprint
,
request
,
jsonify
,
g
from
utils.my_response
import
BaseResponse
from
models.base_model
import
db
from
models.models
import
Machine
,
Production
,
Hatch
,
RentDetail
from
utils.error_code
import
MACHINE_NOT_EXIST_ERROR
,
HATCH_NOT_EXIST_ERROR
logger
=
logging
.
getLogger
(
__name__
)
# 查询数据
utils/error_code.py
View file @
e64c0af3
#!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": "账号或密码错误" } ## 微信登陆相关 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 newline at end of file
#!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": "账号或密码错误" } ## 微信登陆相关 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,不存在场景" }
\ No newline at end of file
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment