Skip to content

Commit

Permalink
feat(translate): replace to /toKr ep
Browse files Browse the repository at this point in the history
  • Loading branch information
PleahMaCaka committed Nov 2, 2023
1 parent a88da4f commit 064a48a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 62 deletions.
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from starlette.middleware.cors import CORSMiddleware

from core.sql_util import check_and_create_table
from routers import deepl, location, subway, weather, auth
from routers import translate, location, subway, weather, auth

# from service.summary.nlp_util import update_nlp_client

Expand All @@ -24,7 +24,7 @@
app.include_router(weather.router, prefix="/service/weather", tags=["weather"])
# app.include_router(summary.router, prefix="/service/summary", tags=["summary"])
app.include_router(subway.router, prefix="/service/subway", tags=["subway"])
app.include_router(deepl.router, prefix="/service/deepl", tags=["deepl"])
app.include_router(translate.router, prefix="/service/translate", tags=["translate"])
app.include_router(location.router, prefix="/service/location", tags=["ipinfo"])

check_and_create_table()
Expand Down
19 changes: 0 additions & 19 deletions routers/deepl.py

This file was deleted.

14 changes: 14 additions & 0 deletions routers/translate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import os

import deepl
from fastapi import APIRouter

router = APIRouter()

API_KEY = os.environ.get("DEEPL_KEY")
translator = deepl.Translator("b00f5dce-5f8a-44a6-c6cd-3c972604600f:fx")


@router.post("/toKr")
async def translate(text: str):
return translator.translate_text(text, source_lang="EN", target_lang="KO")
41 changes: 0 additions & 41 deletions service/deepl.py

This file was deleted.

0 comments on commit 064a48a

Please sign in to comment.