diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..04b6255 --- /dev/null +++ b/.env.example @@ -0,0 +1,32 @@ +ENV_ENABLE= +#Django +DJANGO_SECRET_KEY= +DEBUG= +#Elasticsearch +ELASTICSEARCH_ENDPOINT= +#Logstash +LOGSTASH_SERVER_IP= +LOGSTASH_PORT= +LOGSTASH_UDP_PORT= +#PostgreSQL +POSTGRES_DB= +POSTGRES_USER= +POSTGRES_PASSWORD= +POSTGRES_DB_URL= +#ChatGPT +CHATGPT_ENABLE= +CHATGPT_APIKEY= +#RabbitMQ +RABBITMQ_ENABLE= +RABBITMQ_USERNAME= +RABBITMQ_PASSWORD= +RABBITMQ_SERVER_IP= +RABBITMQ_PORT= +RABBITMQ_VIRTUAL_HOST= +#Redis +REDIS_HOST= +REDIS_PORT= +#Forest +FOREST_URL= +FOREST_ENV_SECRET= +FOREST_AUTH_SECRET= \ No newline at end of file diff --git a/.gitignore b/.gitignore index 08bc07e..a032b48 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ .idea/** -.env.example +.env /Lib /Scripts /Include diff --git a/api/management/commands/recordListener.py b/api/management/commands/recordListener.py deleted file mode 100644 index 5243695..0000000 --- a/api/management/commands/recordListener.py +++ /dev/null @@ -1,29 +0,0 @@ -from django.core.management.base import BaseCommand -from PetMonitoringSystemBackend.settings import RABBITMQ_CONFIG -from api.management.commands.callback import recordCallBack, machineCallBack -from api.models import Pet - - -class Command(BaseCommand): - def handle(self, *args, **options): - from api.utils.Rabbitmqserver import RabbitmqServer - from api.management.commands.callback import recordCallBack, machineCallBack - if RABBITMQ_CONFIG["enable"]: - rabbitmqClient = RabbitmqServer( - username=RABBITMQ_CONFIG["username"], - password=RABBITMQ_CONFIG["password"], - serverip=RABBITMQ_CONFIG["serverip"], - port=RABBITMQ_CONFIG["port"], - virtual_host=RABBITMQ_CONFIG["vhost"] - ) - - rabbitmqClient.connect() - - # Listen Record - rabbitmqClient.expense("distance/#", recordCallBack.distanceCallBack) - rabbitmqClient.expense("temperature/#", recordCallBack.temperatureAndHumidityCallBack) - rabbitmqClient.expense("weight/#", recordCallBack.weightCallBack) - rabbitmqClient.expense("water/#", recordCallBack.waterCallBack) - # Listen Machine - rabbitmqClient.expense("machine/status/#", machineCallBack.machineCallBack) -