feat(product): 新增产品接口
This commit is contained in:
@@ -79,7 +79,7 @@ class CRUD:
|
||||
|
||||
result = await self.session.execute(
|
||||
select(model) if filters is None else select(model).filter(
|
||||
*self.build_filter_conditions(filters, model)).order_by(desc(model.insert_time))
|
||||
*self.build_filter_conditions(filters, model)).order_by(desc(model.created_at))
|
||||
)
|
||||
records = result.scalars().all()
|
||||
return records
|
||||
|
||||
@@ -220,7 +220,7 @@ class Product(BaseModel, DateModel):
|
||||
Enum(base_schema.ProductCategory, inherit_schema=True), comment='商品分类, vip-会员服务 points-积分服务'
|
||||
)
|
||||
price: Mapped[int] = mapped_column(Integer, comment='价格,不带小数点 单位为分')
|
||||
action: Mapped[str] = mapped_column(String(10), comment='付款后的动作,会员续期:vip_renewal 积分:recharge_points')
|
||||
action: Mapped[str] = mapped_column(String(30), comment='付款后的动作,会员续期:vip_renewal 积分:recharge_points')
|
||||
number: Mapped[int] = mapped_column(Integer, comment='执行动作的增量值')
|
||||
description: Mapped[str] = mapped_column(Text, nullable=True, comment='商品描述')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user