package com.njcn.cloud.controller.AdminStatistic;

import com.njcn.cloud.pojo.vo.AdminStatistic.Integrity;
import com.njcn.cloud.pojo.vo.AdminStatistic.StaticInfo;
import com.njcn.cloud.service.AdminStatistic.DataIntegrityService;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @Description: 统计终端在线率
 * @Author: wr
 * @Date: 2024/1/8 14:30
 */
@RestController
@RequestMapping("/dataIntegrity")
@Api(tags = "统计数据完整性率接口")
@RequiredArgsConstructor
public class DataIntegrityController extends BaseController {

    private final DataIntegrityService dataIntegrityService;

    /**
     * 统计数据完整性率
     */
    @PostMapping("/getDataIntegrity")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "用户ID", required = true, paramType = "query"),
    })
    @ApiOperation(value = "统计数据完整性率入口", notes = "统计数据完整性率列表")
    public HttpResult<Integrity> getDataIntegrity(String userId) {
        String methodDescribe = getMethodDescribe("getDataIntegrity");
        Integrity integrity = dataIntegrityService.getIntegrity(userId);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, integrity, methodDescribe);
    }
}