This commit is contained in:
2026-11-04 15:35:15 +08:00
parent 4709ea4328
commit 62291c57ec
12 changed files with 363 additions and 72 deletions
+6 -6
View File
@@ -41,9 +41,9 @@ def get_date_str(timestamp: int) -> str:
@router.get('/gold/realtime/', operation_id='realtimeGold', response_model=Response[list[RealTimeGold]])
async def get_real_time_gold(redis: Annotated[AsyncRedis, Depends(thirdpart_gold.get_redis)], background_tasks: BackgroundTasks) -> Response[list[RealTimeGold]]:
"""获取网站金币比例,数据为各跨区首次报价前200条的平均万金币/元。
"""获取网站金币单价,取页面第4~10条单价均值,元/万金币,两位小数。
updataTime为数字秒级时间戳,code为跨区标识。与thirdpart接口共用Redis缓存和
updataTime为数据所属半小时刻度的数字秒级时间戳,:25/:55提前采集对应:30/:00数据。与thirdpart接口共用Redis缓存和
后台刷新任务:30分钟自动更新,也支持按需补齐,逐区间隔8秒;初始化未齐时响应体code=202。
"""
return await get_thirdpart_gold(redis, background_tasks)
@@ -145,11 +145,11 @@ async def get_official_gold(redis: Annotated[AsyncRedis, Depends(thirdpart_gold.
@router.get('/gold/thirdpart/', operation_id='thirdpartGold', response_model=Response[list[RealTimeGold]])
async def get_thirdpart_gold(redis: Annotated[AsyncRedis, Depends(thirdpart_gold.get_redis)], background_tasks: BackgroundTasks) -> Response[list[RealTimeGold]]:
"""获取跨1~跨8(含跨3A/3B)的第三方首批报价均值,单位:万金币/元。
"""获取跨1~跨8(含跨3A/3B)的第三方单价均值,单位:元/万金币。
不限制最低总价;各平台首次返回的有效报价汇总、去重、按单价取前200条,
对每条报价的1/Price取算术平均,不按库存或份数加权。保留上游原始价格,
不额外计算交易手续费。该接口无上游分页参数,前200条是本接口的样本口径。
不额外限制最低总价;汇总渠道报价并按公开页面展示规则排序、去重,
对i.item1的第4~10条(Python切片[3:10])显示单价取算术平均,
四舍五入至两位小数,不按库存或份数加权。
每30分钟自动后台刷新,跨区页面最短间隔8秒(每分钟不超过8次),Redis锁避免重复刷新。
初始化跨区未齐时响应体code=202并注明进度;9区缓存齐全才返回code=200。