package com.njcn.cloud.controller.AdminStatistic;

import com.njcn.cloud.pojo.vo.AdminStatistic.StaticInfo;
import com.njcn.cloud.service.AdminStatistic.StaticService;
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;



@RestController
@RequestMapping("/dataIntegrity")
@Api(tags = "统计装置在线率接口")
@RequiredArgsConstructor
public class StaticController extends BaseController {

    private final StaticService staticService;


    /**
     * 统计数据完整性率
     */
    @PostMapping("/getDevStatus")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "用户ID", required = true, paramType = "query"),
    })
    @ApiOperation(value = "统计装置在线率入口", notes = "统计装置在线率列表")
    public HttpResult<StaticInfo> getDevStatus(String userId) {
        String methodDescribe = getMethodDescribe("getDevStatus");
        StaticInfo aStatic = staticService.getStatic(userId);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, aStatic, methodDescribe);
    }
}