diff --git a/src/db/__init__.py b/db/__init__.py similarity index 100% rename from src/db/__init__.py rename to db/__init__.py diff --git a/db/__pycache__/__init__.cpython-310.pyc b/db/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000..371f42c Binary files /dev/null and b/db/__pycache__/__init__.cpython-310.pyc differ diff --git a/db/__pycache__/base.cpython-310.pyc b/db/__pycache__/base.cpython-310.pyc new file mode 100644 index 0000000..8db6a2d Binary files /dev/null and b/db/__pycache__/base.cpython-310.pyc differ diff --git a/db/__pycache__/session.cpython-310.pyc b/db/__pycache__/session.cpython-310.pyc new file mode 100644 index 0000000..58f58b7 Binary files /dev/null and b/db/__pycache__/session.cpython-310.pyc differ diff --git a/src/db/base.py b/db/base.py similarity index 100% rename from src/db/base.py rename to db/base.py diff --git a/src/db/models/__init__.py b/db/models/__init__.py similarity index 100% rename from src/db/models/__init__.py rename to db/models/__init__.py diff --git a/db/models/__pycache__/__init__.cpython-310.pyc b/db/models/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000..af1de00 Binary files /dev/null and b/db/models/__pycache__/__init__.cpython-310.pyc differ diff --git a/db/models/__pycache__/base.cpython-310.pyc b/db/models/__pycache__/base.cpython-310.pyc new file mode 100644 index 0000000..609622d Binary files /dev/null and b/db/models/__pycache__/base.cpython-310.pyc differ diff --git a/db/models/__pycache__/lot_data_model.cpython-310.pyc b/db/models/__pycache__/lot_data_model.cpython-310.pyc new file mode 100644 index 0000000..97044d2 Binary files /dev/null and b/db/models/__pycache__/lot_data_model.cpython-310.pyc differ diff --git a/src/db/models/base.py b/db/models/base.py similarity index 100% rename from src/db/models/base.py rename to db/models/base.py diff --git a/src/db/models/log_data_model.py b/db/models/lot_data_model.py similarity index 99% rename from src/db/models/log_data_model.py rename to db/models/lot_data_model.py index 2a23712..e99e179 100755 --- a/src/db/models/log_data_model.py +++ b/db/models/lot_data_model.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field from sqlalchemy import * -from src.db.base import Base +from db.base import Base class LOT_DATA(BaseModel): diff --git a/src/db/repository/__init__.py b/db/repository/__init__.py similarity index 100% rename from src/db/repository/__init__.py rename to db/repository/__init__.py diff --git a/db/repository/__pycache__/__init__.cpython-310.pyc b/db/repository/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000..0822d04 Binary files /dev/null and b/db/repository/__pycache__/__init__.cpython-310.pyc differ diff --git a/db/repository/__pycache__/lot_data_repository.cpython-310.pyc b/db/repository/__pycache__/lot_data_repository.cpython-310.pyc new file mode 100644 index 0000000..d430080 Binary files /dev/null and b/db/repository/__pycache__/lot_data_repository.cpython-310.pyc differ diff --git a/src/db/repository/lot_data_repository.py b/db/repository/lot_data_repository.py similarity index 92% rename from src/db/repository/lot_data_repository.py rename to db/repository/lot_data_repository.py index dc236f8..2647c6b 100755 --- a/src/db/repository/lot_data_repository.py +++ b/db/repository/lot_data_repository.py @@ -1,5 +1,5 @@ -from src.db.models.log_data_model import LOT_DATA_MODEL, LOT_DATA -from src.db.session import with_session +from db.models.lot_data_model import LOT_DATA_MODEL, LOT_DATA +from db.session import with_session @with_session diff --git a/src/db/session.py b/db/session.py similarity index 96% rename from src/db/session.py rename to db/session.py index 78b04d0..47cb59f 100755 --- a/src/db/session.py +++ b/db/session.py @@ -1,6 +1,6 @@ from functools import wraps from contextlib import contextmanager -from src.db.base import SessionLocal +from db.base import SessionLocal from sqlalchemy.orm import Session diff --git a/src/__pycache__/api.cpython-310.pyc b/src/__pycache__/api.cpython-310.pyc new file mode 100644 index 0000000..4eea617 Binary files /dev/null and b/src/__pycache__/api.cpython-310.pyc differ diff --git a/src/db/api.py b/src/api.py similarity index 75% rename from src/db/api.py rename to src/api.py index fe47791..93e0cd6 100644 --- a/src/db/api.py +++ b/src/api.py @@ -1,6 +1,6 @@ -from src.db.models.base import BaseResponse -from src.db.models.log_data_model import LOT_DATA -from src.db.repository import add_kb_to_db, get_kb_detail, delete_kb_detail_by_time +from db.models.base import BaseResponse +from db.repository import add_kb_to_db, get_kb_detail, delete_kb_detail_by_time +from db.models.lot_data_model import LOT_DATA def add(data: LOT_DATA): diff --git a/src/sensor_to_local.py b/src/sensor_to_local.py index 71aae79..8e25a1a 100644 --- a/src/sensor_to_local.py +++ b/src/sensor_to_local.py @@ -3,7 +3,7 @@ import time import serial -from db.api import add +from src.api import add from db.models.log_data_model import LOT_DATA if __name__ == '__main__': diff --git a/src/sensor_to_server.py b/src/sensor_to_server.py index 518a669..6046279 100644 --- a/src/sensor_to_server.py +++ b/src/sensor_to_server.py @@ -6,8 +6,8 @@ import time import serial import paho.mqtt.client as mqtt -from db.api import add -from db.models.log_data_model import LOT_DATA +from api import add +from db.models.lot_data_model import LOT_DATA def t():