package com.njcn.device.pms.controller.distribution;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.device.pms.pojo.param.RStatPwAlarmCountWParam;
import com.njcn.device.pms.pojo.param.RStatPwAlarmDetailParam;
import com.njcn.device.pms.pojo.vo.RStatPwAlarmCountWVO;
import com.njcn.device.pms.pojo.vo.RStatPwAlarmDetailVO;
import com.njcn.device.pms.service.distribution.RStatPwAlarmCountWService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Title RStatPwAlarmCountWController
 * @Package com.njcn.device.pms.controller
 * @Author jianghaifei
 * @Date 2022-11-02 18:53
 * @Version V1.0
 */
@RestController
@RequestMapping("/rStatPwAlarmCountW")
@Api(tags = "配网-告警统计(周)")
@RequiredArgsConstructor
public class RStatPwAlarmCountWController extends BaseController {

    private final RStatPwAlarmCountWService rStatPwAlarmCountWService;

    /***
     *
     * @author jianghaifei
     * @date 2022-11-02 19:01
     * @param rStatPwAlarmCountWParam
     * @return com.njcn.common.pojo.response.HttpResult<java.util.List<com.njcn.device.pms.pojo.vo.RStatZwAlarmCountWVO>>
     */
    @PostMapping("getAllRStatPwAlarmCountList")
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("查询告警统计(周)")
    public HttpResult<List<RStatPwAlarmCountWVO>> getAllRStatPwAlarmCountList(@RequestBody RStatPwAlarmCountWParam rStatPwAlarmCountWParam) {
        String methodDescribe = getMethodDescribe("getAllRStatPwAlarmCountList");
        List<RStatPwAlarmCountWVO> list = rStatPwAlarmCountWService.getAllRStatPwAlarmCountList(rStatPwAlarmCountWParam);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
    }


    @PostMapping("getAlarmDetailList")
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("告警明细查看")
    public HttpResult<Page<RStatPwAlarmDetailVO>> getAlarmDetailList(@RequestBody RStatPwAlarmDetailParam rStatPwAlarmDetailParam) {
        String methodDescribe = getMethodDescribe("getAlarmDetailList");
        Page<RStatPwAlarmDetailVO> list = rStatPwAlarmCountWService.getAlarmDetailList(rStatPwAlarmDetailParam);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
    }
}
