package com.usky.alarm.controller.web;


import com.usky.alarm.domain.BaseAlarmNoticeResult;
import com.usky.alarm.service.BaseAlarmNoticeResultService;
import com.usky.common.core.bean.ApiResult;
import com.usky.common.core.bean.CommonPage;
import com.usky.common.log.annotation.Log;
import com.usky.common.log.enums.BusinessType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 告警通知结果 前端控制器
 * </p>
 *
 * @author han
 * @since 2023-09-25
 */
@RestController
@RequestMapping("/baseAlarmNoticeResult")
public class BaseAlarmNoticeResultController {

    @Autowired
    private BaseAlarmNoticeResultService baseAlarmNoticeResultService;

    /**
     * 推送记录查看分页
     * @param receiver  接收人
     * @param alarmId  告警ID
     * @param current      当前页
     * @param size     每页条数
     * @return
     */
    @GetMapping("/resultInfo")
    public ApiResult<CommonPage<BaseAlarmNoticeResult>> resultInfo(@RequestParam(value = "receiver", required = false) String receiver,
                                                                   @RequestParam(value = "alarmId") Integer alarmId,
                                                                   @RequestParam(value = "current", required = false, defaultValue = "1") Integer current,
                                                                   @RequestParam(value = "size", required = false, defaultValue = "10") Integer size)
    {
        return ApiResult.success(baseAlarmNoticeResultService.resultInfo(receiver, alarmId, current, size));
    }
}

