diff --git a/core/sql_util.py b/core/sql_util.py index 054982a..c8838ad 100644 --- a/core/sql_util.py +++ b/core/sql_util.py @@ -4,7 +4,7 @@ import sqlite3 import typing -from oauth.dto.user_dto import UserDto +from service.oauth.dto.user_dto import UserDto def env(key): diff --git a/main.py b/main.py index e99adf1..97663b4 100644 --- a/main.py +++ b/main.py @@ -5,12 +5,9 @@ from fastapi import FastAPI from core.sql_util import check_and_create_table -from oauth import auth -from routers import deepl, location -from service.subway import subway -from service.summary import summary +from routers import deepl, location, subway, summary, weather, auth + # from service.summary.nlp_util import update_nlp_client -from service.weather import weather app = FastAPI() diff --git a/oauth/auth.py b/routers/auth.py similarity index 92% rename from oauth/auth.py rename to routers/auth.py index a8f80ac..015c033 100644 --- a/oauth/auth.py +++ b/routers/auth.py @@ -2,8 +2,8 @@ from core import sql_util from core.response import Response, ResponseStatus -from oauth.account_util import calculate_jwt, encode_pw, validate_pw, validate_id, validate_jwt -from oauth.dto.return_code import IdValidateCode, PWValidateCode, JWTValidateCode +from service.oauth.account_util import calculate_jwt, encode_pw, validate_pw, validate_id, validate_jwt +from service.oauth.dto.return_code import IdValidateCode, PWValidateCode, JWTValidateCode router = APIRouter() diff --git a/service/subway/subway.py b/routers/subway.py similarity index 100% rename from service/subway/subway.py rename to routers/subway.py diff --git a/service/summary/summary.py b/routers/summary.py similarity index 100% rename from service/summary/summary.py rename to routers/summary.py diff --git a/service/weather/weather.py b/routers/weather.py similarity index 100% rename from service/weather/weather.py rename to routers/weather.py diff --git a/oauth/account_util.py b/service/oauth/account_util.py similarity index 95% rename from oauth/account_util.py rename to service/oauth/account_util.py index 64a82ba..0e89db3 100644 --- a/oauth/account_util.py +++ b/service/oauth/account_util.py @@ -6,12 +6,12 @@ import jwt from core import sql_util -from oauth.dto.return_code import ( +from service.oauth.dto.return_code import ( IdValidateCode as IdValid, PWValidateCode as PwValid, JWTValidateCode as JWTValid ) -from oauth.rule.id_rule import ALLOWED_CHAR_RE +from service.oauth.rule.id_rule import ALLOWED_CHAR_RE _SALT = os.environ.get("AIT_PW_SALT") # admin only _PEPPER = os.environ.get("AIT_PW_PEPPER") # admin only @@ -19,7 +19,7 @@ # noinspection DuplicatedCode def validate_id(_id: str) -> IdValid: - from oauth.rule.id_rule import ( + from service.oauth.rule.id_rule import ( MAX_LENGTH, MIN_LENGTH, MIN_CHAR_LEN, MIN_NUMBER_LEN, MAX_REPEAT_TIME @@ -48,7 +48,7 @@ def validate_id(_id: str) -> IdValid: # noinspection DuplicatedCode def validate_pw(_id: str, pw: str) -> PwValid: - from oauth.rule.pw_rule import ( + from service.oauth.rule.pw_rule import ( MAX_LENGTH, MIN_LENGTH, MIN_CHAR_LEN, MIN_NUMBER_LEN, MAX_REPEAT_TIME, MAX_ID_SIMILARITY diff --git a/oauth/dto/return_code.py b/service/oauth/dto/return_code.py similarity index 100% rename from oauth/dto/return_code.py rename to service/oauth/dto/return_code.py diff --git a/oauth/dto/user_dto.py b/service/oauth/dto/user_dto.py similarity index 100% rename from oauth/dto/user_dto.py rename to service/oauth/dto/user_dto.py diff --git a/oauth/rule/id_rule.py b/service/oauth/rule/id_rule.py similarity index 100% rename from oauth/rule/id_rule.py rename to service/oauth/rule/id_rule.py diff --git a/oauth/rule/pw_rule.py b/service/oauth/rule/pw_rule.py similarity index 100% rename from oauth/rule/pw_rule.py rename to service/oauth/rule/pw_rule.py diff --git a/tests/test_auth.py b/tests/test_auth.py index 20cb366..e91c81e 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -1,6 +1,6 @@ -from oauth import account_util -from oauth.dto.return_code import IdValidateCode -from oauth.rule import id_rule +from service.oauth import account_util +from service.oauth.dto.return_code import IdValidateCode +from service.oauth.rule import id_rule def test_is_include_not_allowed_char():