package com.njcn.system.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.LargeScreenParam;
import com.njcn.device.pq.pojo.vo.DataScaleVO;
import com.njcn.system.service.LargeScreenService;
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 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;

import java.util.List;


/**
 * @version 1.0.0
 * @author: zbj
 * @date: 2023/04/10
 */
@Slf4j
@Api(tags = "大屏")
@RestController
@RequestMapping("/largeScreen")
@RequiredArgsConstructor
public class LargeScreenController extends BaseController {

    private final LargeScreenService largeScreenService;

    /**
     * 数据规模
     */
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/getDataScale")
    @ApiOperation("数据规模")
    @ApiImplicitParam(name = "largeScreenParam", value = "数据规模", required = true)
    public HttpResult<List<DataScaleVO>> getDataScale(@RequestBody @Validated LargeScreenParam largeScreenParam) {
        String methodDescribe = getMethodDescribe("getDataScale");
        List<DataScaleVO> result = largeScreenService.getDataScale(largeScreenParam);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
    }
}
