mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-07 12:50:03 +08:00
init🎉: 首次提交
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
from tortoise import fields
|
||||
|
||||
from zhenxun.services.db_context import Model
|
||||
from zhenxun.utils.enum import (
|
||||
BlockType,
|
||||
LimitCheckType,
|
||||
LimitWatchType,
|
||||
PluginLimitType,
|
||||
)
|
||||
|
||||
|
||||
class PluginLimit(Model):
|
||||
id = fields.IntField(pk=True, generated=True, auto_increment=True)
|
||||
"""自增id"""
|
||||
module = fields.CharField(255, description="模块名")
|
||||
"""模块名"""
|
||||
module_path = fields.CharField(255, description="模块路径")
|
||||
"""模块路径"""
|
||||
plugin = fields.ForeignKeyField(
|
||||
"models.PluginInfo",
|
||||
related_name="plugin_limit",
|
||||
on_delete=fields.CASCADE,
|
||||
description="所属插件",
|
||||
)
|
||||
limit_type = fields.CharEnumField(PluginLimitType, description="限制类型")
|
||||
"""限制类型"""
|
||||
watch_type = fields.CharEnumField(LimitWatchType, description="监听类型")
|
||||
"""限制类型"""
|
||||
status = fields.BooleanField(default=True, description="限制的开关状态")
|
||||
"""限制的开关状态"""
|
||||
check_type = fields.CharEnumField(
|
||||
LimitCheckType, default=BlockType.ALL, description="检查类型"
|
||||
)
|
||||
"""检查类型"""
|
||||
result = fields.CharField(max_length=255, null=True, description="返回信息")
|
||||
"""返回信息"""
|
||||
cd = fields.IntField(null=True, description="cd")
|
||||
"""cd"""
|
||||
max_count = fields.IntField(null=True, description="最大调用次数")
|
||||
"""最大调用次数"""
|
||||
|
||||
class Meta:
|
||||
table = "plugin_limit"
|
||||
table_description = "插件限制"
|
||||
Reference in New Issue
Block a user