переделал структуру апи
This commit is contained in:
parent
d81875c113
commit
74787e7e44
0
api/app/config.py
Normal file
0
api/app/config.py
Normal file
0
api/app/controllers/__init__.py
Normal file
0
api/app/controllers/__init__.py
Normal file
@ -1,11 +0,0 @@
|
||||
from pydantic import BaseSettings
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
DATABASE_URL: str = "postgresql+asyncpg://user:password@localhost:5432/dbname"
|
||||
|
||||
class Config:
|
||||
env_file = ".env"
|
||||
|
||||
|
||||
settings = Settings()
|
||||
0
api/app/database/__init__.py
Normal file
0
api/app/database/__init__.py
Normal file
@ -1,6 +1,6 @@
|
||||
from sqlalchemy.ext.asyncio import AsyncSession, create_async_engine
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
from app.core.config import settings
|
||||
from app.config import settings
|
||||
|
||||
engine = create_async_engine(settings.DATABASE_URL, echo=True)
|
||||
|
||||
0
api/app/domain/__init__.py
Normal file
0
api/app/domain/__init__.py
Normal file
3
api/app/domain/models/__init__.py
Normal file
3
api/app/domain/models/__init__.py
Normal file
@ -0,0 +1,3 @@
|
||||
from sqlalchemy.ext.declarative import declarative_base
|
||||
|
||||
Base = declarative_base()
|
||||
11
api/app/domain/models/lenses_types.py
Normal file
11
api/app/domain/models/lenses_types.py
Normal file
@ -0,0 +1,11 @@
|
||||
from sqlalchemy import Column, Integer, VARCHAR, ForeignKey
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
from app.domain.models import Base
|
||||
|
||||
|
||||
class LensesType(Base):
|
||||
__tablename__ = 'lenses_types'
|
||||
|
||||
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||
title = Column(VARCHAR(150), nullable=False, unique=True)
|
||||
0
api/app/infrastructure/__init__.py
Normal file
0
api/app/infrastructure/__init__.py
Normal file
Loading…
x
Reference in New Issue
Block a user