22 lines
627 B
Python
22 lines
627 B
Python
from typing import List
|
|
from fastapi import APIRouter, Depends
|
|
from sqlalchemy.ext.asyncio import AsyncSession
|
|
from app.database.session import get_db
|
|
from app.domain.entities.industries import IndustryRead
|
|
from app.infrastructure.industries_services import IndustriesService
|
|
|
|
industries_router = APIRouter()
|
|
|
|
|
|
@industries_router.get(
|
|
'/',
|
|
response_model=List[IndustryRead],
|
|
summary='Get all industries',
|
|
description='Get all industries',
|
|
)
|
|
async def get_all_industries(
|
|
db: AsyncSession = Depends(get_db),
|
|
):
|
|
industries_service = IndustriesService(db)
|
|
return await industries_service.get_all()
|