package com.njcn.harmonic.controller;

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.pq.pojo.param.PulicTimeStatisParam;
import com.njcn.harmonic.pojo.vo.SteadyInfoData;
import com.njcn.harmonic.service.SteadyDataService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
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;

/**
 * @author denghuajun
 * @date 2022/3/4 15:24
 *  稳态指标合格率
 */
@Validated
@Slf4j
@RestController
@RequestMapping("/pollution")
@Api(tags = "稳态指标合格率")
@AllArgsConstructor
public class SteadyDataController extends BaseController {

    private final SteadyDataService steadyDataService;

    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/getSteadyData")
    @ApiOperation("稳态指标合格率")
    @ApiImplicitParam(name = "param", value = "稳态指标合格率参数", required = true)
    public HttpResult<SteadyInfoData> getSteadyData(@RequestBody @Validated PulicTimeStatisParam param) {
        String methodDescribe = getMethodDescribe("getSteadyData");
        SteadyInfoData list = steadyDataService.getSteadyData(param);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
    }
}
