package com.zcloud.personnel.positioning.service;

import com.zcloud.personnel.positioning.api.TerminalServiceI;
import com.zcloud.personnel.positioning.command.TerminalAddExe;
import com.zcloud.personnel.positioning.command.TerminalAppExe;
import com.zcloud.personnel.positioning.command.TerminalCardExe;
import com.zcloud.personnel.positioning.command.TerminalRemoveExe;
import com.zcloud.personnel.positioning.command.TerminalUpdateExe;
import com.zcloud.personnel.positioning.command.query.TerminalQueryExe;
import com.zcloud.personnel.positioning.dto.TerminalAddCmd;
import com.zcloud.personnel.positioning.dto.TerminalAppCompanyPageQry;
import com.zcloud.personnel.positioning.dto.TerminalAppPageQry;
import com.zcloud.personnel.positioning.dto.TerminalAppSaveCmd;
import com.zcloud.personnel.positioning.dto.TerminalAppSyncCmd;
import com.zcloud.personnel.positioning.dto.TerminalAppUpdateCmd;
import com.zcloud.personnel.positioning.dto.TerminalCardCompanyOptionQry;
import com.zcloud.personnel.positioning.dto.TerminalCardCompanyPageQry;
import com.zcloud.personnel.positioning.dto.TerminalCardPageQry;
import com.zcloud.personnel.positioning.dto.TerminalCardPersonOptionQry;
import com.zcloud.personnel.positioning.dto.TerminalCardSaveCmd;
import com.zcloud.personnel.positioning.dto.TerminalCardSyncCmd;
import com.zcloud.personnel.positioning.dto.TerminalCardUpdateCmd;
import com.zcloud.personnel.positioning.dto.TerminalPageQry;
import com.zcloud.personnel.positioning.dto.TerminalUpdateCmd;
import com.zcloud.personnel.positioning.dto.clientobject.TerminalAppCO;
import com.zcloud.personnel.positioning.dto.clientobject.TerminalAppCompanyCO;
import com.zcloud.personnel.positioning.dto.clientobject.TerminalAppSyncCO;
import com.zcloud.personnel.positioning.dto.clientobject.TerminalCardCO;
import com.zcloud.personnel.positioning.dto.clientobject.TerminalCardCompanyCO;
import com.zcloud.personnel.positioning.dto.clientobject.TerminalCardCompanyOptionCO;
import com.zcloud.personnel.positioning.dto.clientobject.TerminalCardPersonOptionCO;
import com.zcloud.personnel.positioning.dto.clientobject.TerminalCardSyncCO;
import com.zcloud.personnel.positioning.dto.clientobject.TerminalCO;
import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * web-app
 *
 * @Author fangjiakai
 * @Date 2026-07-07
 */
@Service
@AllArgsConstructor
public class TerminalServiceImpl implements TerminalServiceI {
    private final TerminalAddExe terminalAddExe;
    private final TerminalUpdateExe terminalUpdateExe;
    private final TerminalRemoveExe terminalRemoveExe;
    private final TerminalQueryExe terminalQueryExe;
    private final TerminalCardExe terminalCardExe;
    private final TerminalAppExe terminalAppExe;

    @Override
    public PageResponse<TerminalAppCompanyCO> listAppCompanyPage(TerminalAppCompanyPageQry qry) {
        return terminalAppExe.listCompanyPage(qry);
    }

    @Override
    public PageResponse<TerminalAppCO> listAppPage(TerminalAppPageQry qry) {
        return terminalAppExe.listAppPage(qry);
    }

    @Override
    public TerminalAppCO queryAppById(Long id) {
        return terminalAppExe.queryAppById(id);
    }

    @Override
    public TerminalAppSyncCO syncApps(TerminalAppSyncCmd cmd) {
        return terminalAppExe.syncApps(cmd);
    }

    @Override
    public TerminalAppCO saveApp(TerminalAppSaveCmd cmd) {
        return terminalAppExe.saveApp(cmd);
    }

    @Override
    public TerminalAppCO updateApp(TerminalAppUpdateCmd cmd) {
        return terminalAppExe.updateApp(cmd);
    }

    @Override
    public PageResponse<TerminalCardCompanyCO> listCardCompanyPage(TerminalCardCompanyPageQry qry) {
        return terminalCardExe.listCompanyPage(qry);
    }

    @Override
    public PageResponse<TerminalCardCO> listCardPage(TerminalCardPageQry qry) {
        return terminalCardExe.listCardPage(qry);
    }

    @Override
    public TerminalCardCO queryCardById(Long id) {
        return terminalCardExe.queryCardById(id);
    }

    @Override
    public TerminalCardSyncCO syncCards(TerminalCardSyncCmd cmd) {
        return terminalCardExe.syncCards(cmd);
    }

    @Override
    public TerminalCardCO saveCard(TerminalCardSaveCmd cmd) {
        return terminalCardExe.saveCard(cmd);
    }

    @Override
    public TerminalCardCO updateCard(TerminalCardUpdateCmd cmd) {
        return terminalCardExe.updateCard(cmd);
    }

    @Override
    public PageResponse<TerminalCardPersonOptionCO> listCardPersonOptions(TerminalCardPersonOptionQry qry) {
        return terminalCardExe.listPersonOptions(qry);
    }

    @Override
    public List<TerminalCardCompanyOptionCO> listCardCompanyOptions(TerminalCardCompanyOptionQry qry) {
        return terminalCardExe.listCompanyOptions(qry);
    }

    @Override
    public PageResponse<TerminalCO> listPage(TerminalPageQry qry) {
        return terminalQueryExe.execute(qry);
    }

    @Override
    public List<TerminalCO> listAll() {
        return terminalQueryExe.listAll();
    }

    @Override
    public TerminalCO queryById(Long id) {
        return terminalQueryExe.queryById(id);
    }

    @Override
    public SingleResponse<TerminalCO> add(TerminalAddCmd cmd) {
        terminalAddExe.execute(cmd);
        return SingleResponse.buildSuccess();
    }

    @Override
    public void edit(TerminalUpdateCmd cmd) {
        terminalUpdateExe.execute(cmd);
    }

    @Override
    public void remove(Long id) {
        terminalRemoveExe.execute(id);
    }

    @Override
    public void removeBatch(Long[] ids) {
        terminalRemoveExe.execute(ids);
    }
}
