实现虎牙充值商品列表与支付二维码
This commit is contained in:
@@ -9,13 +9,14 @@ from sqlalchemy.orm import Session, joinedload
|
||||
|
||||
from ..database import SessionLocal, get_db
|
||||
from ..deps import authenticate_websocket, require_permission
|
||||
from ..models import HuyaAccount, HuyaConfig, HuyaGoodsSnapshot, HuyaTask, User
|
||||
from ..models import HuyaAccount, HuyaConfig, HuyaGoodsSnapshot, HuyaRechargeGoodsSnapshot, HuyaTask, User
|
||||
from ..schemas import (
|
||||
HuyaAccountOut,
|
||||
HuyaConfigOut,
|
||||
HuyaConfigUpdate,
|
||||
HuyaCookieImport,
|
||||
HuyaGoodsOut,
|
||||
HuyaRechargeGoodsOut,
|
||||
HuyaTaskBatchRequest,
|
||||
HuyaTaskOut,
|
||||
)
|
||||
@@ -200,6 +201,16 @@ def list_goods(
|
||||
return rows
|
||||
|
||||
|
||||
@router.get("/recharge-goods", response_model=list[HuyaRechargeGoodsOut])
|
||||
def list_recharge_goods(
|
||||
db: Session = Depends(get_db),
|
||||
current: User = Depends(require_permission("huya:task")),
|
||||
):
|
||||
"""查看已缓存的虎牙充值商品快照。"""
|
||||
rows = db.query(HuyaRechargeGoodsSnapshot).order_by(HuyaRechargeGoodsSnapshot.id.asc()).all()
|
||||
return rows
|
||||
|
||||
|
||||
@router.post("/tasks/batch")
|
||||
async def create_task_batch(
|
||||
req: HuyaTaskBatchRequest,
|
||||
|
||||
Reference in New Issue
Block a user