From bc126cdd9cf97d2e48be454f1adeafd22177084f Mon Sep 17 00:00:00 2001 From: Kseninia Mikhaylova Date: Tue, 7 May 2024 11:43:11 +0300 Subject: [PATCH] new url --- app/main.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/main.py b/app/main.py index e836929..71fcd55 100644 --- a/app/main.py +++ b/app/main.py @@ -9,7 +9,7 @@ app = FastAPI() @app.get("/") def read_root(): - return {"Hello": "World"} + return {"service": "BX integrations"} @app.post("/integration") @@ -20,7 +20,7 @@ async def intgr(request: Request): [tag, number, *args] = branch.split("-") logger.info(f"input tag {tag} number {number} args {args}") - + bx_comment = ( f"Сообщение от GITEA для задачи {number} (ветка {body['ref']} в репозитории {body['repository']['full_name']})" "\n\n" @@ -33,12 +33,13 @@ async def intgr(request: Request): f"&fields[POST_MESSAGE]={bx_comment}" ) logger.info(f"result {json.loads(bx_res.text)}") - + return {"status": "success"} -@app.post("integration_tg") + +@app.post("/integration_tg") async def tg_intgr(request: Request): body = await request.json() logger.info(body) - - return {"status": "success"} \ No newline at end of file + + return {"status": "success"}