From f5a91c0ece84a05817ab535e5ced90645a6343cc Mon Sep 17 00:00:00 2001 From: insistence <3055204202@qq.com> Date: Fri, 5 Sep 2025 09:21:40 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90do?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E8=A1=A5=E5=85=85=E8=A1=A8=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module_generator/templates/python/do.py.jinja2 | 1 + ruoyi-fastapi-backend/utils/template_util.py | 1 + 2 files changed, 2 insertions(+) diff --git a/ruoyi-fastapi-backend/module_generator/templates/python/do.py.jinja2 b/ruoyi-fastapi-backend/module_generator/templates/python/do.py.jinja2 index 22c23c4..c7ea757 100644 --- a/ruoyi-fastapi-backend/module_generator/templates/python/do.py.jinja2 +++ b/ruoyi-fastapi-backend/module_generator/templates/python/do.py.jinja2 @@ -13,6 +13,7 @@ class {{ ClassName }}(Base): """ __tablename__ = '{{ tableName }}' + __table_args__ = {'comment': '{{ tableComment }}'} {% for column in columns %} {{ column.column_name }} = Column({{ column.column_type | get_sqlalchemy_type }}, {% if column.pk %}primary_key=True, {% endif %}{% if column.increment %}autoincrement=True, {% endif %}{% if column.required or column.pk %}nullable=False{% else %}nullable=True{% endif %}, comment='{{ column.column_comment }}') diff --git a/ruoyi-fastapi-backend/utils/template_util.py b/ruoyi-fastapi-backend/utils/template_util.py index 6765bd0..afe5c41 100644 --- a/ruoyi-fastapi-backend/utils/template_util.py +++ b/ruoyi-fastapi-backend/utils/template_util.py @@ -73,6 +73,7 @@ class TemplateUtils: context = { 'tplCategory': tpl_category, 'tableName': gen_table.table_name, + 'tableComment': gen_table.table_comment, 'functionName': function_name if StringUtil.is_not_empty(function_name) else '【请填写功能名称】', 'ClassName': class_name, 'className': class_name.lower(),