first base of project-changed apps: Herd-livestock-tag-log-elasticsearch-

This commit is contained in:
2025-05-24 15:01:55 +03:30
parent eab40af15d
commit 90a46e493c
129 changed files with 3844 additions and 187 deletions

16
apps/log/models.py Normal file
View File

@@ -0,0 +1,16 @@
from django.db import models
from apps.core.models import BaseModel
from mongoengine import Document, fields
# Create your models here.
class Log(Document):
endpoint = fields.StringField(max_length=100, null=True) # The url the user requested
user = fields.StringField(max_length=200, null=True)
response_code = fields.IntField(default=0) # Response status code
method = fields.StringField(max_length=10, null=True) # Request method
remote_address = fields.StringField(max_length=20, null=True) # IP address of user
exec_time = fields.IntField(null=True) # Time taken to create the response
date = fields.DateTimeField(auto_now=True) # Date and time of request
body_response = fields.StringField(null=True) # Response data
body_request = fields.StringField(max_length=1000, null=True) # Request data