package com.usky.issue.service;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.usky.issue.domain.IssueCloudConfig;
import com.usky.issue.service.vo.CloudConfigResponse;
import com.usky.issue.service.vo.CloudConfigSaveRequest;
import com.usky.issue.service.vo.CloudConnectionTestRequest;
import com.usky.issue.service.vo.CloudConnectionTestResponse;
import com.usky.issue.service.vo.CloudDisableResponse;

/**
 * 云平台配置服务
 *
 * @author fyc
 * @date 2026-05-21
 */
@DS("usky-cloud")
public interface CloudConfigService {

    CloudConfigResponse getConfig();

    CloudConfigResponse saveConfig(CloudConfigSaveRequest request);

    CloudConnectionTestResponse testConnection(CloudConnectionTestRequest request);

    /**
     * 云平台侧租户配置校验（供集成 API 调用，查询云库后返回结果，不再向外发起 HTTP）
     */
    CloudConnectionTestResponse validateTenantConnection(Integer tenantId);

    CloudDisableResponse disable(Integer status);

    /** 获取当前生效配置，不存在则抛业务异常 */
    IssueCloudConfig requireActiveConfig();
}
