package com.njcn.event.controller.distribution;

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.PwUniversalFrontEndParam;
import com.njcn.event.pojo.vo.PwRStatEventOrgVO;
import com.njcn.event.pojo.vo.RStatOrgVO;
import com.njcn.event.service.distribution.PwRStatOrgService;
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/24
 */
@RestController
@RequestMapping("/pwRStatOrg")
@Api(tags = "配网-暂态事件统计")
@RequiredArgsConstructor
public class PwRStatOrgController extends BaseController {

    private final PwRStatOrgService pwRStatOrgService;

    /**
     * 获取配网区域暂态事件统计
     *
     * @param param 前端传入参数
     * @return 配网区域暂态指标统计
     */
    @PostMapping("/getPwRStatOrg")
    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @ApiOperation("获取配网区域暂态事件统计")
    @ApiImplicitParam(name = "param", value = "条件参数", required = true)
    public HttpResult<List<RStatOrgVO>> getPwRStatOrg(@RequestBody PwUniversalFrontEndParam param) {
        String methodDescribe = getMethodDescribe("getPwRStatOrg");
        List<RStatOrgVO> list = pwRStatOrgService.getPwRStatOrg(param);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
    }

    /**
     * 获取配网区域暂态事件分类统计
     *
     * @param param 前端传入参数
     * @return 配网区域暂态指标统计
     */
    @PostMapping("/getPwRStatOrgClassified")
    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @ApiOperation("获取配网区域暂态事件分类统计")
    @ApiImplicitParam(name = "param", value = "条件参数", required = true)
    public HttpResult<List<PwRStatEventOrgVO>> getPwRStatOrgClassified(@RequestBody PwUniversalFrontEndParam param) {
        String methodDescribe = getMethodDescribe("getPwRStatOrgClassified");
        List<PwRStatEventOrgVO> list = pwRStatOrgService.getPwRStatOrgClassified(param);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
    }

}
