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

@@ -38,6 +38,7 @@ def refresh_task(task_id):
class CalculateQuery(BaseModel):
year: int = Field(title='年份')
month: int = Field(title='月份')
only_avg: int = Field(title='是否只计算均值')
@data.route('/calculate', methods=['GET'])
@@ -51,6 +52,6 @@ def start_calculate(query: CalculateQuery):
@data.route('/collect', methods=['GET'])
@siwa.doc(tags=[""], summary='触发计算任务', query=CalculateQuery)
def start_collect(query: CalculateQuery):
collect(year=query.year, month=query.month)
collect(year=query.year, month=query.month, only_avg=query.only_avg)
return Response()