优化更新

This commit is contained in:
2026-09-13 22:47:31 +08:00
parent cca6743f15
commit 0c67b3e8b5
19 changed files with 51 additions and 51 deletions
@@ -171,7 +171,7 @@ templates/
修改 `templates/models.py.tpl`:
```jinja2
```jinja
{% if f.db_type == 'String' %}
{{ f.name }} = Column(String({{ f.db_args or 255 }}), nullable={{ 'True' if f.nullable else 'False' }}, index=True, comment="{{ f.comment }}")
{% endif %}
@@ -181,7 +181,7 @@ templates/
修改 `templates/service.py.tpl`,在 Service 类中添加钩子方法:
```jinja2
```jinja
class {{ model_class_name }}Service(BaseService[{{ model_class_name }}]):
# ... 差异点声明 ...
@@ -197,7 +197,7 @@ class {{ model_class_name }}Service(BaseService[{{ model_class_name }}]):
修改 `templates/ui/columns.ts.tpl`:
```jinja2
```jinja
{% for f in list_fields %}
{
label: '{{ f.label }}',
@@ -215,7 +215,7 @@ class {{ model_class_name }}Service(BaseService[{{ model_class_name }}]):
在 `templates/` 下新建 `test.py.tpl`:
```jinja2
```jinja
# tests/test_{{ app_name }}.py
import pytest
from modules.{{ app_name }}.service import {{ app_name }}_service
@@ -248,7 +248,7 @@ BACKEND_TEMPLATES = [
## Jinja2 语法速查
```jinja2
```jinja
{# 注释 #}
{# 变量输出 #}
@@ -133,7 +133,7 @@ git tag -l
## .gitignore 配置
```gitignore
```ini
# Python
__pycache__/
*.py[cod]