MaxKB/apps/setting/models/log_management.py
shaohuzhang1 f9d536f5a2
Some checks are pending
sync2gitee / repo-sync (push) Waiting to run
Typos Check / Spell Check with Typos (push) Waiting to run
feat: Audit log add operation object (#2681)
2025-03-25 19:07:02 +08:00

39 lines
1.0 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# coding=utf-8
"""
@project: MaxKB
@Author
@file log_management.py
@date2025/3/17 9:54
@desc:
"""
import uuid
from django.db import models
from common.encoder.encoder import SystemEncoder
from common.mixins.app_model_mixin import AppModelMixin
class Log(AppModelMixin):
"""
审计日志
"""
id = models.UUIDField(primary_key=True, max_length=128, default=uuid.uuid1, editable=False, verbose_name="主键id")
menu = models.CharField(max_length=128, verbose_name="操作菜单")
operate = models.CharField(max_length=128, verbose_name="操作")
operation_object = models.JSONField(verbose_name="操作对象", default=dict, encoder=SystemEncoder)
user = models.JSONField(verbose_name="用户信息", default=dict)
status = models.IntegerField(max_length=20, verbose_name="状态")
ip_address = models.CharField(max_length=128, verbose_name="ip地址")
details = models.JSONField(verbose_name="详情", default=dict, encoder=SystemEncoder)
class Meta:
db_table = "log"