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.AssesVO;
import com.njcn.harmonic.service.AssesService;
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/2
 *
 */
@Slf4j
@RestController
@RequestMapping("/asses")
@Api(tags = "综合评估管理")
@AllArgsConstructor
public class AssesController extends BaseController {

    private final AssesService assesService;

    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/getQualityAssessData")
    @ApiOperation("综合评估")
    @ApiImplicitParam(name = "pulicTimeStatisParam", value = "综合评估参数", required = true)
    public HttpResult<AssesVO> getQualityAssessData(@RequestBody @Validated PulicTimeStatisParam pulicTimeStatisParam) {
        String methodDescribe = getMethodDescribe("getQualityAssessData");
        AssesVO list = assesService.getQualityAssessData(pulicTimeStatisParam);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
    }
}
