Fix custom filename in code generation (#1030)

This commit is contained in:
Wu Clan
2026-01-22 16:33:37 +08:00
committed by GitHub
parent c8ebd1e9f6
commit 0aa63ed6e6
4 changed files with 8 additions and 7 deletions
@@ -2,13 +2,13 @@ from typing import Annotated
from fastapi import APIRouter, Depends, Path, Query
from backend.app.{{ app_name }}.schema.{{ table_name }} import (
from backend.app.{{ app_name }}.schema.{{ filename }} import (
Create{{ schema_name }}Param,
Delete{{ schema_name }}Param,
Get{{ schema_name }}Detail,
Update{{ schema_name }}Param,
)
from backend.app.{{ app_name }}.service.{{ table_name }}_service import {{ table_name }}_service
from backend.app.{{ app_name }}.service.{{ filename }}_service import {{ table_name }}_service
from backend.common.pagination import DependsPagination, PageData
from backend.common.response.response_schema import ResponseModel, ResponseSchemaModel, response_base
from backend.common.security.jwt import DependsJwtAuth
@@ -5,7 +5,7 @@ from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy_crud_plus import CRUDPlus
from backend.app.{{ app_name }}.model import {{ class_name }}
from backend.app.{{ app_name }}.schema.{{ table_name }} import Create{{ schema_name }}Param, Update{{ schema_name }}Param
from backend.app.{{ app_name }}.schema.{{ filename }} import Create{{ schema_name }}Param, Update{{ schema_name }}Param
class CRUD{{ class_name }}(CRUDPlus[{{ class_name }}]):
@@ -2,9 +2,9 @@ from typing import Any, Sequence
from sqlalchemy.ext.asyncio import AsyncSession
from backend.app.{{ app_name }}.crud.crud_{{ table_name }} import {{ table_name }}_dao
from backend.app.{{ app_name }}.crud.crud_{{ filename }} import {{ table_name }}_dao
from backend.app.{{ app_name }}.model import {{ class_name }}
from backend.app.{{ app_name }}.schema.{{ table_name }} import Create{{ schema_name }}Param, Delete{{ schema_name }}Param, Update{{ schema_name }}Param
from backend.app.{{ app_name }}.schema.{{ filename }} import Create{{ schema_name }}Param, Delete{{ schema_name }}Param, Update{{ schema_name }}Param
from backend.common.exception import errors
from backend.common.pagination import paging_data