package com.njcn.event.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.event.pojo.param.UniversalFrontEndParam;
import com.njcn.event.pojo.vo.PwRmpEventDetailVO;
import com.njcn.event.service.distribution.PwRmpEventDetailService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
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;

/**
 * 配网-暂态事件明细
 *
 * @author yzh
 * @date 2022/10/31
 */
@RestController
@RequestMapping("/pwEventCategoryDetails")
@Api(tags = "配网-暂态事件明细")
@RequiredArgsConstructor
public class PwRmpEventDetailController extends BaseController {

    private final PwRmpEventDetailService pwRmpEventDetailService;

    /**
     * 获取配网暂态事件明细
     *
     * @param param 前端传入参数
     * @return 暂态事件明细
     */
    @PostMapping("/getPwRmpEventDetail")
    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @ApiOperation("获取暂态事件明细")
    @ApiImplicitParam(name = "param", value = "条件参数", required = true)
    public HttpResult<Page<PwRmpEventDetailVO>> getPwRmpEventDetail(@RequestBody UniversalFrontEndParam param) {
        String methodDescribe = getMethodDescribe("getPwRmpEventDetail");
        Page<PwRmpEventDetailVO> list = pwRmpEventDetailService.getPwRmpEventDetail(param);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
    }
}
