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.harmonic.pojo.param.HarmInHarmParam;
import com.njcn.harmonic.pojo.vo.HarmInHarmVO;
import com.njcn.harmonic.service.HarmInHarmService;
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
 * @version 1.0.0
 * @date 2022/3/17
 */
@Slf4j
@RestController
@RequestMapping("/inHarm")
@Api(tags = "谐波频谱")
@AllArgsConstructor
public class HarmInHarmController extends BaseController {

    private final HarmInHarmService harmInHarmService;

    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/getHarmInHarmData")
    @ApiOperation("谐波频谱统计")
    @ApiImplicitParam(name = "harmInHarmParam", value = "谐波频谱参数", required = true)
    public HttpResult<HarmInHarmVO> getHarmInHarmData(@RequestBody @Validated HarmInHarmParam harmInHarmParam) {
        String methodDescribe = getMethodDescribe("getHarmInHarmData");
        HarmInHarmVO list = harmInHarmService.getHarmInHarmData(harmInHarmParam);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
    }
}
