Commit b89f39eb by Aeolus

update

parent 69df3902
......@@ -19,7 +19,7 @@ SSW_PAY_CONFIG = {
"key_path": os.getenv("SSW_PAY_SSL_KEY_PATH"),
'callback_url': '/rent/wx_pay_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 = {
......
......@@ -9,9 +9,11 @@ from flask import Flask
from myapps.sukang24h.api.wx_auth_portal import wx_auth_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):
prefix = "/sukang"
app.register_blueprint(wx_auth_route, url_prefix=prefix + "/wx_auth")
app.register_blueprint(hatch_route, url_prefix=prefix + "/hatch")
app.register_blueprint(rent_route, url_prefix=prefix + "/rent")
......@@ -37,6 +37,10 @@ def create_rent():
hatch_nos = json_data["hatch_nos"]
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()
if not machine:
......
......@@ -5,6 +5,7 @@ import random
from sqlalchemy.exc import SQLAlchemyError
import logging
from models.models import Rent
from utils.my_redis_cache import redis_client
logger = logging.getLogger(__name__)
......@@ -35,10 +36,6 @@ class RentService(object):
try:
model = Rent()
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.customer_id = data["user_id"]
model.add_time = datetime.datetime.now()
......@@ -62,8 +59,6 @@ class RentService(object):
db.session.rollback()
raise e
@staticmethod
if __name__ == '__main__':
rent = RentService.getMyRecord(15, 1, 10)
......@@ -59,7 +59,8 @@ def jwt_authentication():
if current_app.name == "sukang24h":
NO_AUTH_CHECK_URL = [url_for('wx_auth.my_test'),
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:
NO_AUTH_CHECK_URL = []
......
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