mirror of
https://github.com/fastapi-practices/fastapi-best-architecture.git
synced 2026-09-21 05:02:49 +00:00
Update code generator plugin naming to CodeGen prefix (#1243)
This commit is contained in:
@@ -49,8 +49,8 @@ class Get{{ schema_name }}Detail({{ schema_name }}SchemaBase):
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
id: int
|
||||
id: int = Field(description='主键 ID')
|
||||
{% if datetime_mixin %}
|
||||
created_time: datetime
|
||||
updated_time: datetime | None = None
|
||||
created_time: datetime = Field(description='创建时间')
|
||||
updated_time: datetime | None = Field(None, description='更新时间')
|
||||
{% endif %}
|
||||
|
||||
@@ -10,6 +10,8 @@ from backend.common.pagination import paging_data
|
||||
|
||||
|
||||
class {{ class_name }}Service:
|
||||
"""{{ doc_comment }}服务类"""
|
||||
|
||||
@staticmethod
|
||||
async def get(*, db: AsyncSession, pk: int) -> {{ class_name }}:
|
||||
"""
|
||||
@@ -25,7 +27,7 @@ class {{ class_name }}Service:
|
||||
return {{ table_name }}
|
||||
|
||||
@staticmethod
|
||||
async def get_list(db: AsyncSession) -> dict[str, Any]:
|
||||
async def get_list(*, db: AsyncSession) -> dict[str, Any]:
|
||||
"""
|
||||
获取{{ doc_comment }}列表
|
||||
|
||||
|
||||
Reference in New Issue
Block a user