From 888efad38c2c470ad493c3f4a7b9c4e781289bea Mon Sep 17 00:00:00 2001 From: wcq <744800102@qq.com> Date: Wed, 8 Feb 2023 17:03:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9D=83=E9=99=90=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Crud/AuthRuleCrud.py | 0 Model/AuthRuleModel.py | 16 ++++++++++++++++ Router/AuthRuleRouter.py | 0 Schemas/AuthRuleSchemas.py | 0 4 files changed, 16 insertions(+) create mode 100644 Crud/AuthRuleCrud.py create mode 100644 Model/AuthRuleModel.py create mode 100644 Router/AuthRuleRouter.py create mode 100644 Schemas/AuthRuleSchemas.py diff --git a/Crud/AuthRuleCrud.py b/Crud/AuthRuleCrud.py new file mode 100644 index 0000000..e69de29 diff --git a/Model/AuthRuleModel.py b/Model/AuthRuleModel.py new file mode 100644 index 0000000..e652ce3 --- /dev/null +++ b/Model/AuthRuleModel.py @@ -0,0 +1,16 @@ +import uuid + +from sqlalchemy import Column, String, Boolean, ForeignKey, Enum, Text, DateTime, func, Integer +from Utils.SqlAlchemyUtils import Base + + +class AuthRule(Base): + __tablename__ = "AUTH_RULE_TABLE" + id = Column(String(32), primary_key=True, comment="应用id") + name = Column(String(32), unique=True, comment="应用名称") + secret_key = Column(String(255), comment="验证密匙") + token_key = Column(String(255), comment="app随机token加密密匙", default=lambda: uuid.uuid4().hex) + + def to_dict(self): + return {c.name: getattr(self, c.name) for c in self.__table__.columns} + diff --git a/Router/AuthRuleRouter.py b/Router/AuthRuleRouter.py new file mode 100644 index 0000000..e69de29 diff --git a/Schemas/AuthRuleSchemas.py b/Schemas/AuthRuleSchemas.py new file mode 100644 index 0000000..e69de29