diplom
This commit is contained in:
@@ -4,6 +4,7 @@ import json
|
||||
import model_messege as mm
|
||||
from sqlalchemy.future import select
|
||||
from sqlalchemy import MetaData, inspect, text, insert, Table
|
||||
import bcrypt
|
||||
|
||||
class JsonJober:
|
||||
data = []
|
||||
@@ -51,6 +52,15 @@ class Request():
|
||||
await cls.craete_all_table()
|
||||
mass_table = JsonJober.ReadJson(path_file="./data_base/preset/test.json")
|
||||
await cls.insert_mass_table(mass_table=mass_table)
|
||||
|
||||
user_data = {
|
||||
"inn": "123",
|
||||
"password": bcrypt.hashpw("123".encode("utf-8"), bcrypt.gensalt()).decode('utf-8'),
|
||||
"mail": "123",
|
||||
"name_poo": "123"
|
||||
}
|
||||
await cls.insert_table(data={"data": [user_data]}, table_name="users")
|
||||
|
||||
|
||||
@classmethod
|
||||
async def insert_mass_table(cls, mass_table):
|
||||
|
||||
@@ -5,4 +5,4 @@ sqlalchemy
|
||||
asyncpg
|
||||
psycopg2-binary
|
||||
bcrypt
|
||||
orjson
|
||||
orjson
|
||||
|
||||
@@ -69,7 +69,7 @@ async def insert_table(data:dict):
|
||||
"""Добавление записи"""
|
||||
return await Request.insert_table(data=data)
|
||||
|
||||
@router.post("select_rows_with_filter")
|
||||
@router.post("/select_rows_with_filter")
|
||||
async def select_rows_with_filter(value:str):
|
||||
"""Выборка с фильтром"""
|
||||
return await Request.select_rows_with_filter(value=value)
|
||||
Reference in New Issue
Block a user