feat: batch update - gift card breakdown spec, backend APIs, miniprogram pages, ETL finance recharge, docs & migrations
This commit is contained in:
17
apps/backend/app/schemas/base.py
Normal file
17
apps/backend/app/schemas/base.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
from pydantic.alias_generators import to_camel
|
||||
|
||||
|
||||
class CamelModel(BaseModel):
|
||||
"""所有小程序 API 响应 schema 的基类。
|
||||
|
||||
- alias_generator=to_camel:JSON 输出字段名自动转 camelCase
|
||||
- populate_by_name=True:同时接受 snake_case 和 camelCase 输入
|
||||
- from_attributes=True:支持从 ORM 对象/dict 构造
|
||||
"""
|
||||
|
||||
model_config = ConfigDict(
|
||||
alias_generator=to_camel,
|
||||
populate_by_name=True,
|
||||
from_attributes=True,
|
||||
)
|
||||
Reference in New Issue
Block a user