门店信息
This commit is contained in:
@@ -114,6 +114,90 @@ class OtherShopListData(BaseModel):
|
||||
other_shop_list: list[OtherShopItem] = []
|
||||
|
||||
|
||||
class ShopInfoRequest(BaseModel):
|
||||
"""加盟店/市场店铺信息请求参数"""
|
||||
tenpo_cd: str = Field(min_length=1, max_length=20, pattern=r"^[A-Za-z0-9_-]+$")
|
||||
include_details: bool = False # 为 True 时额外抓取 配送/ポリシー/返品保証/連絡 四个子页(多付出四次页面请求)
|
||||
|
||||
|
||||
class ShopShippingFeeItem(BaseModel):
|
||||
"""店铺「配送」页中按都道府县列出的一条运费"""
|
||||
prefecture: str = "" # 都道府县名,如"東京都"
|
||||
fee: int = 0 # 该都道府县运费(日元)
|
||||
|
||||
|
||||
class ShopDeliveryInfo(BaseModel):
|
||||
"""店铺「配送」子页信息"""
|
||||
description: str = "" # 发货说明原文(日文)
|
||||
shipping_fee_list: list[ShopShippingFeeItem] = [] # 按都道府县的运费表
|
||||
|
||||
|
||||
class ShopPolicyInfo(BaseModel):
|
||||
"""店铺「ポリシー」子页信息(含特定商取引法表记)"""
|
||||
description: str = "" # 政策全文(日文)
|
||||
|
||||
|
||||
class ShopServiceInfo(BaseModel):
|
||||
"""店铺「返品、保証、払い戻し」子页信息"""
|
||||
return_policy: str = "" # 返品、払い戻し 段落
|
||||
warranty: str = "" # 保証 段落
|
||||
|
||||
|
||||
class ShopAddress(BaseModel):
|
||||
"""店铺地址(联系地址或返品地址)"""
|
||||
label: str = "" # 地址类型,如"住所"/"返品先"
|
||||
postal_code: str = "" # 邮编
|
||||
prefecture: str = "" # 都道府县
|
||||
city: str = "" # 市区町村
|
||||
street: str = "" # 番地
|
||||
building: str = "" # 大楼/公寓名(可能为空)
|
||||
|
||||
|
||||
class ShopContactInfo(BaseModel):
|
||||
"""店铺「連絡」子页信息"""
|
||||
address_list: list[ShopAddress] = []
|
||||
|
||||
|
||||
class ShopInfoData(BaseModel):
|
||||
"""加盟店/市场店铺信息
|
||||
|
||||
基础字段来自 /shop/{tenpo_cd} 主页;delivery/policy/service/contact
|
||||
仅当请求 include_details=True 时才会填充,否则为 null。
|
||||
"""
|
||||
tenpo_cd: str
|
||||
shop_name: str = "" # 店铺名称
|
||||
shop_url: str = "" # 店铺主页链接
|
||||
logo_url: str = "" # 店铺 logo 图片链接
|
||||
rating_score: str = "" # 店铺评分,如"5.0"
|
||||
rating_count: int = 0 # 评价数量
|
||||
notice: str = "" # 店铺公告(ショップ情報)原文
|
||||
delivery: ShopDeliveryInfo | None = None
|
||||
policy: ShopPolicyInfo | None = None
|
||||
service: ShopServiceInfo | None = None
|
||||
contact: ShopContactInfo | None = None
|
||||
|
||||
|
||||
class ShopItemsRequest(BaseModel):
|
||||
"""加盟店/市场店铺商品列表请求参数"""
|
||||
model_config = ConfigDict(extra="allow")
|
||||
|
||||
tenpo_cd: str = Field(min_length=1, max_length=20, pattern=r"^[A-Za-z0-9_-]+$")
|
||||
search_word: str = "" # 店内关键词检索,留空为全部商品
|
||||
page: int = Field(default=1, ge=1, le=100)
|
||||
|
||||
|
||||
class ShopItemsData(BaseModel):
|
||||
"""加盟店/市场店铺商品列表数据"""
|
||||
tenpo_cd: str
|
||||
shop_name: str = "" # 店铺名称,从列表页标题解析
|
||||
query: str = ""
|
||||
page: int = 1
|
||||
page_size: int = 0
|
||||
total_count: int = 0
|
||||
has_more: int = 0
|
||||
items: list[ProductSummary] = []
|
||||
|
||||
|
||||
class HealthData(BaseModel):
|
||||
"""健康检查响应数据"""
|
||||
status: str
|
||||
|
||||
Reference in New Issue
Block a user