Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -187,7 +187,7 @@ def get_db_connection_user():
|
|
| 187 |
conn.row_factory = sqlite3.Row
|
| 188 |
return conn
|
| 189 |
|
| 190 |
-
@app.route('/
|
| 191 |
def get_user():
|
| 192 |
# Проверка API-ключа
|
| 193 |
api_key_sys_control = request.args.get('api_sys')
|
|
@@ -248,7 +248,7 @@ def get_user():
|
|
| 248 |
|
| 249 |
|
| 250 |
# Отдаем дату онлайн
|
| 251 |
-
@app.route('/get_current_time', methods=['GET'])
|
| 252 |
def get_current_time():
|
| 253 |
utc_now = datetime.utcnow()
|
| 254 |
msk_tz = pytz.timezone('Europe/Moscow')
|
|
@@ -416,7 +416,7 @@ def add_or_update_contact(contact_data, db_name):
|
|
| 416 |
|
| 417 |
|
| 418 |
|
| 419 |
-
@app.route('/add_user_home', methods=['GET'])
|
| 420 |
def add_user_home():
|
| 421 |
global current_curator_index
|
| 422 |
|
|
@@ -456,7 +456,7 @@ def add_user_home():
|
|
| 456 |
logging.error(f"Error adding user: {e}")
|
| 457 |
return jsonify({'status': 'error', 'message': str(e)}), 500
|
| 458 |
|
| 459 |
-
@app.route('/user', methods=['GET'])
|
| 460 |
def user():
|
| 461 |
global current_curator_index
|
| 462 |
|
|
@@ -496,7 +496,7 @@ def user():
|
|
| 496 |
logging.error(f"Error adding user: {e}")
|
| 497 |
return jsonify({'status': 'error', 'message': str(e)}), 500
|
| 498 |
|
| 499 |
-
@app.route('/add_user_mess', methods=['GET'])
|
| 500 |
def add_user_mess():
|
| 501 |
global current_curator_index
|
| 502 |
|
|
@@ -548,7 +548,7 @@ def add_user_mess():
|
|
| 548 |
|
| 549 |
|
| 550 |
# Работа с ордером из сайта без VK_ID
|
| 551 |
-
@app.route('/wr_order', methods=['GET'])
|
| 552 |
def shop_order_new():
|
| 553 |
try:
|
| 554 |
logging.debug("Starting shop_order_new")
|
|
@@ -625,7 +625,7 @@ def shop_order_new():
|
|
| 625 |
|
| 626 |
|
| 627 |
# Работа из VK_ID Запись ордер с полными данными
|
| 628 |
-
@app.route('/wr_order_vk_full', methods=['GET'])
|
| 629 |
def write_order_vk_full():
|
| 630 |
try:
|
| 631 |
logging.debug("Starting shop_order_new")
|
|
@@ -706,7 +706,7 @@ def write_order_vk_full():
|
|
| 706 |
|
| 707 |
|
| 708 |
# Работа из VK_ID только по VK ID
|
| 709 |
-
@app.route('/wr_order_vk', methods=['GET'])
|
| 710 |
def wr_order_vk():
|
| 711 |
try:
|
| 712 |
logging.debug("Starting wr_order_vk")
|
|
@@ -782,7 +782,7 @@ def wr_order_vk():
|
|
| 782 |
|
| 783 |
|
| 784 |
# Работа с бонусами из сайта без VK_ID
|
| 785 |
-
@app.route('/wr_bonus', methods=['GET'])
|
| 786 |
def shop_bonus_new():
|
| 787 |
try:
|
| 788 |
logging.debug("Starting shop_bonus_new")
|
|
@@ -874,7 +874,7 @@ def shop_bonus_new():
|
|
| 874 |
|
| 875 |
|
| 876 |
# Добавление пользователя в группу СЕНДЛЕРА
|
| 877 |
-
@app.route('/add_user_senler', methods=['GET'])
|
| 878 |
def add_user_senler():
|
| 879 |
# Получаем параметры из GET-запроса, если параметр отсутствует, устанавливаем значение пустой строки
|
| 880 |
vk_user_id = request.args.get('vk_user_id', "")
|
|
@@ -908,7 +908,7 @@ def add_user_senler():
|
|
| 908 |
# Возвращаем результат
|
| 909 |
return jsonify(response.json())
|
| 910 |
|
| 911 |
-
@app.route('/add_user_senler_full', methods=['GET'])
|
| 912 |
def add_user_senler_full():
|
| 913 |
# Получаем параметры из GET-запроса, если параметр отсутствует, устанавливаем значение пустой строки
|
| 914 |
vk_user_id = request.args.get('vk_user_id', "")
|
|
@@ -1055,7 +1055,7 @@ def vk_s_set():
|
|
| 1055 |
|
| 1056 |
|
| 1057 |
# ЗАПИСЫВАЕМ ДАННЫЕ В ВК СТОРИДЖ
|
| 1058 |
-
@app.route('/vk_s_get', methods=['GET'])
|
| 1059 |
def vk_s_get():
|
| 1060 |
api_sys_control = request.args.get('api_sys')
|
| 1061 |
if api_sys_control != api_key_sys:
|
|
|
|
| 187 |
conn.row_factory = sqlite3.Row
|
| 188 |
return conn
|
| 189 |
|
| 190 |
+
@app.route('/user_db_set', methods=['GET','POST'])
|
| 191 |
def get_user():
|
| 192 |
# Проверка API-ключа
|
| 193 |
api_key_sys_control = request.args.get('api_sys')
|
|
|
|
| 248 |
|
| 249 |
|
| 250 |
# Отдаем дату онлайн
|
| 251 |
+
@app.route('/get_current_time', methods=['GET','POST'])
|
| 252 |
def get_current_time():
|
| 253 |
utc_now = datetime.utcnow()
|
| 254 |
msk_tz = pytz.timezone('Europe/Moscow')
|
|
|
|
| 416 |
|
| 417 |
|
| 418 |
|
| 419 |
+
@app.route('/add_user_home', methods=['GET','POST'])
|
| 420 |
def add_user_home():
|
| 421 |
global current_curator_index
|
| 422 |
|
|
|
|
| 456 |
logging.error(f"Error adding user: {e}")
|
| 457 |
return jsonify({'status': 'error', 'message': str(e)}), 500
|
| 458 |
|
| 459 |
+
@app.route('/user', methods=['GET','POST'])
|
| 460 |
def user():
|
| 461 |
global current_curator_index
|
| 462 |
|
|
|
|
| 496 |
logging.error(f"Error adding user: {e}")
|
| 497 |
return jsonify({'status': 'error', 'message': str(e)}), 500
|
| 498 |
|
| 499 |
+
@app.route('/add_user_mess', methods=['GET','POST'])
|
| 500 |
def add_user_mess():
|
| 501 |
global current_curator_index
|
| 502 |
|
|
|
|
| 548 |
|
| 549 |
|
| 550 |
# Работа с ордером из сайта без VK_ID
|
| 551 |
+
@app.route('/wr_order', methods=['GET','POST'])
|
| 552 |
def shop_order_new():
|
| 553 |
try:
|
| 554 |
logging.debug("Starting shop_order_new")
|
|
|
|
| 625 |
|
| 626 |
|
| 627 |
# Работа из VK_ID Запись ордер с полными данными
|
| 628 |
+
@app.route('/wr_order_vk_full', methods=['GET','POST'])
|
| 629 |
def write_order_vk_full():
|
| 630 |
try:
|
| 631 |
logging.debug("Starting shop_order_new")
|
|
|
|
| 706 |
|
| 707 |
|
| 708 |
# Работа из VK_ID только по VK ID
|
| 709 |
+
@app.route('/wr_order_vk', methods=['GET','POST'])
|
| 710 |
def wr_order_vk():
|
| 711 |
try:
|
| 712 |
logging.debug("Starting wr_order_vk")
|
|
|
|
| 782 |
|
| 783 |
|
| 784 |
# Работа с бонусами из сайта без VK_ID
|
| 785 |
+
@app.route('/wr_bonus', methods=['GET','POST'])
|
| 786 |
def shop_bonus_new():
|
| 787 |
try:
|
| 788 |
logging.debug("Starting shop_bonus_new")
|
|
|
|
| 874 |
|
| 875 |
|
| 876 |
# Добавление пользователя в группу СЕНДЛЕРА
|
| 877 |
+
@app.route('/add_user_senler', methods=['GET','POST'])
|
| 878 |
def add_user_senler():
|
| 879 |
# Получаем параметры из GET-запроса, если параметр отсутствует, устанавливаем значение пустой строки
|
| 880 |
vk_user_id = request.args.get('vk_user_id', "")
|
|
|
|
| 908 |
# Возвращаем результат
|
| 909 |
return jsonify(response.json())
|
| 910 |
|
| 911 |
+
@app.route('/add_user_senler_full', methods=['GET','POST'])
|
| 912 |
def add_user_senler_full():
|
| 913 |
# Получаем параметры из GET-запроса, если параметр отсутствует, устанавливаем значение пустой строки
|
| 914 |
vk_user_id = request.args.get('vk_user_id', "")
|
|
|
|
| 1055 |
|
| 1056 |
|
| 1057 |
# ЗАПИСЫВАЕМ ДАННЫЕ В ВК СТОРИДЖ
|
| 1058 |
+
@app.route('/vk_s_get', methods=['GET','POST'])
|
| 1059 |
def vk_s_get():
|
| 1060 |
api_sys_control = request.args.get('api_sys')
|
| 1061 |
if api_sys_control != api_key_sys:
|