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
06dfc370
Commit
06dfc370
authored
Jan 14, 2022
by
Aeolus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
0023e52a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
4 deletions
+39
-4
config/wechat_config.py
+9
-1
myapps/automat/api/machine_portal.py
+28
-1
myapps/automat/api/rent_portal.py
+1
-1
sukang_app.py
+1
-1
utils/error_code.py
+0
-0
utils/middlewares.py
+0
-0
No files found.
config/wechat_config.py
View file @
06dfc370
...
...
@@ -12,6 +12,11 @@ SK_CONFIG = {
"app_secret"
:
os
.
getenv
(
"SK_MINI_PROGRAM_APPSECRET"
),
}
XXZN_CONFIG
=
{
"app_id"
:
os
.
getenv
(
"XXZN_MINI_PROGRAM_APPID"
),
"app_secret"
:
os
.
getenv
(
"XXZN_MINI_PROGRAM_APPSECRET"
),
}
XX_PAY_CONFIG
=
{
"mch_id"
:
os
.
getenv
(
"XX_MCHID"
),
"pay_key"
:
os
.
getenv
(
"XX_PAY_KEY"
),
...
...
@@ -28,19 +33,22 @@ pay_config_dict = {
"xx"
:
XX_PAY_CONFIG
,
}
platform_config_list
=
[
""
,
"sukang24h"
,
]
platform_config_list
=
[
""
,
"sukang24h"
,
"xxzn"
]
platform_config_dict
=
{
"sukang24h"
:
SK_CONFIG
,
"xxzn"
:
XXZN_CONFIG
}
platform_appid_config_list
=
[
""
,
SK_CONFIG
[
"app_id"
],
# 苏康24H 平台序号 ==>1
XXZN_CONFIG
[
"app_id"
]
]
platform_appid_config_dict
=
{
"sukang24h"
:
SK_CONFIG
[
"app_id"
],
"xxzn"
:
XXZN_CONFIG
[
"app_id"
]
}
...
...
myapps/automat/api/machine_portal.py
View file @
06dfc370
...
...
@@ -6,12 +6,14 @@ author:Aeolus
@file: hatch_portal.py
"""
import
logging
import
time
from
flask
import
Blueprint
,
request
,
jsonify
,
g
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
from
utils.error_code
import
MACHINE_NOT_EXIST_ERROR
,
HATCH_NOT_EXIST_ERROR
,
MACHINE_NO_CREATE_ERROR
,
\
MACHINE_MAC_DUPLICATE_ERROR
from
utils.my_response
import
BaseResponse
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -92,3 +94,28 @@ def run_get_machine_no():
"command_time"
:
machine
.
command_time
,
"type"
:
machine
.
type
})
else
:
return
jsonify
(
MACHINE_NOT_EXIST_ERROR
)
@machine_route.route
(
'create_machine_no'
,
methods
=
[
"post"
])
def
run_create_machine_no
():
json_data
=
request
.
get_json
()
mac
=
json_data
[
"iMEI"
]
hatch_number
=
json_data
[
"slotCount"
]
machine
=
Machine
.
query
.
filter_by
(
mac
=
mac
)
.
first
()
if
machine
:
return
jsonify
(
MACHINE_MAC_DUPLICATE_ERROR
)
for
i
in
range
(
3
):
machine_no
=
int
(
time
.
time
())
machine
=
Machine
.
query
.
filter_by
(
machine_no
=
machine_no
)
.
first
()
if
not
machine
:
break
return
jsonify
(
MACHINE_NO_CREATE_ERROR
)
machine_model
=
Machine
()
machine_model
.
machine_no
=
machine_no
machine_model
.
mac
=
mac
machine_model
.
hatch_number
=
hatch_number
db
.
session
.
add
(
machine_model
)
db
.
session
.
commit
()
return
BaseResponse
(
data
=
{
"machine_no"
:
machine_no
})
myapps/automat/api/rent_portal.py
View file @
06dfc370
...
...
@@ -124,7 +124,7 @@ def create_rent():
db
.
session
.
add
(
rent
)
db
.
session
.
add
(
rent_detail
)
db
.
session
.
commit
()
return
BaseResponse
()
return
BaseResponse
(
data
=
{
"out_trade_no"
:
rent_no
,
"free_order"
:
True
}
)
total_fee
=
0
open_hatchs
=
{}
...
...
sukang_app.py
View file @
06dfc370
...
...
@@ -13,4 +13,4 @@ app = create_app(os.getenv('RUN_ENV', 'prod'))
logger
.
info
(
"run server"
)
if
__name__
==
'__main__'
:
app
.
run
(
'127.0.0.1'
,
8893
,
debug
=
Fals
e
)
app
.
run
(
'127.0.0.1'
,
8893
,
debug
=
Tru
e
)
utils/error_code.py
View file @
06dfc370
This diff is collapsed.
Click to expand it.
utils/middlewares.py
View file @
06dfc370
This diff is collapsed.
Click to expand it.
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