feat: 新增单独计算近半年均价的接口

This commit is contained in:
han0
2025-06-05 18:26:30 +08:00
parent d752fe17c8
commit 1402b1a1e3
4 changed files with 16 additions and 10 deletions

View File

@@ -2,12 +2,11 @@ from collectors import Collector
from commons.models.price_publish import PricePublish
def collect(year=2023, month=11):
def collect(year=2023, month=11, only_avg=0):
"""
整理发布价格
"""
PricePublish.clean(year, month) # 清空当月数据
collector = Collector(year, month)
collector = Collector(year, month, only_avg=only_avg)
collector.run()
@@ -15,7 +14,7 @@ if __name__ == '__main__':
from core.factory import ClientApp
with ClientApp().app_context():
collect(2025, 4)
collect(2025, 5)
# for i in range(4):
# collect(2025, i + 1)