from pot_libs.sanic_api import summary
from unify_api.modules.tsp_water.components.alarm_record_cps import \
    AlarmRecordReq, AlarmRecordResp
from unify_api.modules.tsp_water.service.alarm_record_service import \
    alarm_record_service


@summary("扬尘生态环境管理平台-报警记录")
async def post_alarm_record(req, body: AlarmRecordReq) -> AlarmRecordResp:
    cid = body.cid
    importance = body.importance
    pm_type = body.pm_type
    start = body.start
    end = body.end
    page_size = body.page_size
    page_num = body.page_num
    return await alarm_record_service(cid, pm_type, start, end, importance,
                                      page_size, page_num)
