Configuracion final de back con serve
This commit is contained in:
16
Back_comercial_iko/app/comercial/Main_comercial.py
Normal file
16
Back_comercial_iko/app/comercial/Main_comercial.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from fastapi import APIRouter
|
||||
from Back_comercial_iko.services.Comercial_service import ComercialService
|
||||
from Back_comercial_iko.core.Response import ApiResponse
|
||||
from Back_comercial_iko.core.HttpStatus import HttpStatus
|
||||
|
||||
|
||||
router = APIRouter(prefix="/comercial", tags=["Comercial"])
|
||||
|
||||
@router.post("/create-project")
|
||||
def create_project(data: dict):
|
||||
try:
|
||||
service = ComercialService()
|
||||
result = service.create_project_commercial(data)
|
||||
return ApiResponse.success(result,"Proyecto creado",HttpStatus.CREATED)
|
||||
except Exception as e:
|
||||
return ApiResponse.error(str(e),HttpStatus.NOT_FOUND)
|
||||
Reference in New Issue
Block a user