feat(product): 新增产品接口

This commit is contained in:
xingc
2025-05-06 15:26:40 +08:00
parent 3fcc7a1608
commit 2239418c88
8 changed files with 73 additions and 4 deletions

View File

@@ -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

View File

@@ -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='商品描述')