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
b89f39eb
Commit
b89f39eb
authored
Oct 13, 2021
by
Aeolus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
69df3902
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
8 deletions
+10
-8
config/wechat_config.py
+1
-1
myapps/sukang24h/api/__init__.py
+2
-0
myapps/sukang24h/api/rent_portal.py
+4
-0
service/rent_service.py
+1
-6
utils/middlewares.py
+2
-1
No files found.
config/wechat_config.py
View file @
b89f39eb
...
@@ -19,7 +19,7 @@ SSW_PAY_CONFIG = {
...
@@ -19,7 +19,7 @@ SSW_PAY_CONFIG = {
"key_path"
:
os
.
getenv
(
"SSW_PAY_SSL_KEY_PATH"
),
"key_path"
:
os
.
getenv
(
"SSW_PAY_SSL_KEY_PATH"
),
'callback_url'
:
'/rent/wx_pay_callback'
,
'callback_url'
:
'/rent/wx_pay_callback'
,
'refund_callback_url'
:
'/rent/refund_callback'
,
'refund_callback_url'
:
'/rent/refund_callback'
,
'domain'
:
'https://
guide.ssw-htzn.com/v2/tour
/'
'domain'
:
'https://
sukang.ssw-htzn.com/sukang
/'
}
}
XX_PAY_CONFIG
=
{
XX_PAY_CONFIG
=
{
...
...
myapps/sukang24h/api/__init__.py
View file @
b89f39eb
...
@@ -9,9 +9,11 @@ from flask import Flask
...
@@ -9,9 +9,11 @@ from flask import Flask
from
myapps.sukang24h.api.wx_auth_portal
import
wx_auth_route
from
myapps.sukang24h.api.wx_auth_portal
import
wx_auth_route
from
myapps.sukang24h.api.hatch_portal
import
hatch_route
from
myapps.sukang24h.api.hatch_portal
import
hatch_route
from
myapps.sukang24h.api.rent_portal
import
rent_route
def
register_sukang_blueprint
(
app
:
Flask
):
def
register_sukang_blueprint
(
app
:
Flask
):
prefix
=
"/sukang"
prefix
=
"/sukang"
app
.
register_blueprint
(
wx_auth_route
,
url_prefix
=
prefix
+
"/wx_auth"
)
app
.
register_blueprint
(
wx_auth_route
,
url_prefix
=
prefix
+
"/wx_auth"
)
app
.
register_blueprint
(
hatch_route
,
url_prefix
=
prefix
+
"/hatch"
)
app
.
register_blueprint
(
hatch_route
,
url_prefix
=
prefix
+
"/hatch"
)
app
.
register_blueprint
(
rent_route
,
url_prefix
=
prefix
+
"/rent"
)
myapps/sukang24h/api/rent_portal.py
View file @
b89f39eb
...
@@ -37,6 +37,10 @@ def create_rent():
...
@@ -37,6 +37,10 @@ def create_rent():
hatch_nos
=
json_data
[
"hatch_nos"
]
hatch_nos
=
json_data
[
"hatch_nos"
]
user
=
g
.
user
user
=
g
.
user
machine_no
=
'1636127865'
hatch_nos
=
[
1
]
user
=
WxUser
.
query
.
filter_by
(
id
=
user_id
)
.
first
()
# 验证机柜是否存在
# 验证机柜是否存在
machine
=
Machine
.
query
.
filter_by
(
machine_no
=
machine_no
)
.
first
()
machine
=
Machine
.
query
.
filter_by
(
machine_no
=
machine_no
)
.
first
()
if
not
machine
:
if
not
machine
:
...
...
service/rent_service.py
View file @
b89f39eb
...
@@ -5,6 +5,7 @@ import random
...
@@ -5,6 +5,7 @@ import random
from
sqlalchemy.exc
import
SQLAlchemyError
from
sqlalchemy.exc
import
SQLAlchemyError
import
logging
import
logging
from
models.models
import
Rent
from
utils.my_redis_cache
import
redis_client
from
utils.my_redis_cache
import
redis_client
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
...
@@ -35,10 +36,6 @@ class RentService(object):
...
@@ -35,10 +36,6 @@ class RentService(object):
try
:
try
:
model
=
Rent
()
model
=
Rent
()
model
.
rent_no
=
rent_no
model
.
rent_no
=
rent_no
model
.
number
=
data
[
"number"
]
model
.
deposit
=
machine
.
deposit
model
.
one_day_price
=
machine
.
one_day_price
model
.
free_time
=
machine
.
free_time
model
.
machine_id
=
machine
.
id
model
.
machine_id
=
machine
.
id
model
.
customer_id
=
data
[
"user_id"
]
model
.
customer_id
=
data
[
"user_id"
]
model
.
add_time
=
datetime
.
datetime
.
now
()
model
.
add_time
=
datetime
.
datetime
.
now
()
...
@@ -62,8 +59,6 @@ class RentService(object):
...
@@ -62,8 +59,6 @@ class RentService(object):
db
.
session
.
rollback
()
db
.
session
.
rollback
()
raise
e
raise
e
@staticmethod
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
rent
=
RentService
.
getMyRecord
(
15
,
1
,
10
)
rent
=
RentService
.
getMyRecord
(
15
,
1
,
10
)
utils/middlewares.py
View file @
b89f39eb
...
@@ -59,7 +59,8 @@ def jwt_authentication():
...
@@ -59,7 +59,8 @@ def jwt_authentication():
if
current_app
.
name
==
"sukang24h"
:
if
current_app
.
name
==
"sukang24h"
:
NO_AUTH_CHECK_URL
=
[
url_for
(
'wx_auth.my_test'
),
NO_AUTH_CHECK_URL
=
[
url_for
(
'wx_auth.my_test'
),
url_for
(
'wx_auth.mini_login'
),
url_for
(
'wx_auth.mini_login'
),
# url_for('rent.wx_pay_callback'),
url_for
(
'rent.wx_pay_callback'
),
url_for
(
'hatch.get_production_list'
),
]
]
else
:
else
:
NO_AUTH_CHECK_URL
=
[]
NO_AUTH_CHECK_URL
=
[]
...
...
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