支持其他店铺
This commit is contained in:
@@ -18,6 +18,7 @@ from app.models.scrape import (
|
||||
DetailRequest,
|
||||
OrderShippingFeeData,
|
||||
OrderShippingFeeRequest,
|
||||
OtherShopListData,
|
||||
ProductDetailData,
|
||||
PurchaseTaskRequest,
|
||||
SearchRequest,
|
||||
@@ -122,6 +123,29 @@ async def item_detail(
|
||||
)
|
||||
|
||||
|
||||
@router.post(
|
||||
"/item_other_shops",
|
||||
response_model=ApiResponse[OtherShopListData],
|
||||
dependencies=[Depends(require_bearer_token)],
|
||||
)
|
||||
async def item_other_shops(
|
||||
payload: DetailRequest,
|
||||
container: ServiceContainer = Depends(get_container),
|
||||
) -> ApiResponse[OtherShopListData]:
|
||||
"""获取商品「他のショップ」全部店铺报价列表
|
||||
|
||||
根据商品 ID 抓取骏河屋 /product/other/{id} 页面,返回全部店铺(含官方自营+加盟店/市场店铺)报价列表;
|
||||
列表中每项的 detail_url 已带上对应 tenpo_cd/branch_number,可直接用于 /api/item_detail 跳转查看该店铺报价。
|
||||
"""
|
||||
data = await container.surugaya_client.fetch_other_shops(payload)
|
||||
return ApiResponse[OtherShopListData](
|
||||
success=True,
|
||||
msg="success",
|
||||
data=data,
|
||||
code=0,
|
||||
)
|
||||
|
||||
|
||||
@router.get(
|
||||
"/categories",
|
||||
response_model=ApiResponse[list[CategoryData]],
|
||||
|
||||
Reference in New Issue
Block a user