完成虎牙宝典WSS绑定与快照隔离重构
This commit is contained in:
@@ -1823,8 +1823,11 @@ def list_goods(
|
||||
current: User = Depends(require_permission("huya:task")),
|
||||
):
|
||||
"""查看已缓存的虎牙商品快照。"""
|
||||
rows = db.query(HuyaGoodsSnapshot).order_by(HuyaGoodsSnapshot.id.asc()).all()
|
||||
return rows
|
||||
rows = db.query(HuyaGoodsSnapshot).order_by(HuyaGoodsSnapshot.id.desc()).all()
|
||||
latest = {}
|
||||
for row in rows:
|
||||
latest.setdefault((row.sid, row.product_id), row)
|
||||
return list(latest.values())
|
||||
|
||||
|
||||
@router.get("/recharge-goods", response_model=list[HuyaRechargeGoodsOut])
|
||||
@@ -1833,12 +1836,11 @@ def list_recharge_goods(
|
||||
current: User = Depends(require_permission("huya:task")),
|
||||
):
|
||||
"""查看已缓存的虎牙充值商品快照。"""
|
||||
rows = (
|
||||
db.query(HuyaRechargeGoodsSnapshot)
|
||||
.order_by(HuyaRechargeGoodsSnapshot.id.asc())
|
||||
.all()
|
||||
)
|
||||
return rows
|
||||
rows = db.query(HuyaRechargeGoodsSnapshot).order_by(HuyaRechargeGoodsSnapshot.id.desc()).all()
|
||||
latest = {}
|
||||
for row in rows:
|
||||
latest.setdefault((row.sid, row.spu_id), row)
|
||||
return list(latest.values())
|
||||
|
||||
|
||||
@router.post("/tasks/batch")
|
||||
|
||||
Reference in New Issue
Block a user