feat: implement researcher and publication management with sync functionality
This commit is contained in:
+29
-6
@@ -1,9 +1,32 @@
|
||||
from fastapi import FastAPI
|
||||
from app.services.orcid_client import ORCIDClient
|
||||
from app.api.researchers import router as researchers_router
|
||||
from app.db.session import Base, engine
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
@app.get("/orcid/{orcid_id}/works")
|
||||
def test_works(orcid_id: str):
|
||||
client = ORCIDClient()
|
||||
return client.fetch_works(orcid_id)
|
||||
app = FastAPI(
|
||||
title="ORCID SWORD Backend",
|
||||
description="Backend para sincronización ORCID y exportación SWORD",
|
||||
version="1.0.0"
|
||||
)
|
||||
|
||||
|
||||
# ---------------------------------------------------------
|
||||
# Crear tablas al iniciar la aplicación
|
||||
# ---------------------------------------------------------
|
||||
@app.on_event("startup")
|
||||
def startup_event():
|
||||
Base.metadata.create_all(bind=engine)
|
||||
|
||||
|
||||
# ---------------------------------------------------------
|
||||
# Healthcheck
|
||||
# ---------------------------------------------------------
|
||||
@app.get("/health")
|
||||
def health():
|
||||
return {"status": "ok"}
|
||||
|
||||
|
||||
# ---------------------------------------------------------
|
||||
# Registrar routers
|
||||
# ---------------------------------------------------------
|
||||
app.include_router(researchers_router)
|
||||
|
||||
Reference in New Issue
Block a user