add: webhook

This commit is contained in:
h z
2025-03-17 13:54:53 +00:00
parent acb1e2260f
commit 864b78641b
23 changed files with 473 additions and 43 deletions

16
db/models/Webhook.py Normal file
View File

@@ -0,0 +1,16 @@
from sqlalchemy import Column, String, Integer, ForeignKey, UniqueConstraint, text, Boolean
from db.models import Base
class Webhook(Base):
__tablename__ = 'webhook'
id = Column(Integer, primary_key=True, autoincrement=True)
hook_url = Column(String(100), nullable=False)
__table_args__ = (UniqueConstraint('hook_url'),)
def to_dict(self):
return {
"id": self.id,
"hook_url": self.hook_url
}