package com.njcn.gather.systemops.deploy.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.LogUtil;
import com.njcn.gather.systemops.deploy.pojo.vo.DeployOverviewVO;
import com.njcn.gather.systemops.deploy.service.DeployService;
import com.njcn.web.controller.BaseController;
import com.njcn.web.utils.HttpResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 系统部署基础接口。
 */
@Slf4j
@Api(tags = "系统部署")
@RestController
@RequestMapping("/deploy")
@RequiredArgsConstructor
public class DeployController extends BaseController {

    private final DeployService deployService;

    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("查询系统部署基础信息")
    @GetMapping("/overview")
    public HttpResult<DeployOverviewVO> overview() {
        String methodDescribe = getMethodDescribe("overview");
        LogUtil.njcnDebug(log, "{}，开始查询系统部署基础信息", methodDescribe);
        DeployOverviewVO result = deployService.overview();
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
    }
}
