package io.wdd.server.coreService;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.wdd.server.beans.po.DomainInfoPO;
import io.wdd.server.beans.po.ServerInfoPO;
import io.wdd.server.beans.request.ServerQueryEntity;
import io.wdd.server.beans.vo.AppInfoVO;
import io.wdd.server.beans.vo.DomainInfoVO;
import io.wdd.server.beans.vo.ServerInfoVO;

import java.util.List;

public interface CoreServerService {

    List<ServerInfoVO> serverGetSingle(String serverName, String ipv4, String serverLocation);

    // list all server that are not deleted
    List<ServerInfoPO> serverGetAll();

    /**
     * 查询主机信息，但是是条件查询
     */
    Page<ServerInfoPO> serverGetByPage(ServerQueryEntity serverQueryEntity);

    List<ServerInfoVO> serverGetAllIncludeDelete();

    boolean serverCreate(ServerInfoVO serverInfoVO);

    boolean serverCreateOrUpdate(ServerInfoVO serverInfoVO);

    boolean serverUpdate(ServerInfoPO serverInfoPO);

    boolean serverDelete(Long serverId, String serverName);

    /* app deprecated 2023年10月8日 */
    List<AppInfoVO> appGetAll(Long serverId);

    AppInfoVO appCreate(Long serverId, AppInfoVO appInfoVO);

    boolean appDelete(Long serverId, Long appId);

    /* domain deprecated 2023年10月8日 */
    List<DomainInfoVO> domainGetAll(Long serverId);

    List<DomainInfoVO>  domainGetSingle(Long serverId, String domainName, String dnsIP);

    boolean domainCreate(Long serverId, DomainInfoVO domainInfoVO);

    boolean domainUpdate(DomainInfoPO domainInfoPO);

    boolean domainDelete(Long serverId, Long domainId);

}
