package com.zcloud.personnel.positioning.service;

import com.zcloud.personnel.positioning.api.TerminalBindServiceI;
import com.zcloud.personnel.positioning.command.TerminalBindAddExe;
import com.zcloud.personnel.positioning.command.TerminalBindRemoveExe;
import com.zcloud.personnel.positioning.command.TerminalBindUpdateExe;
import com.zcloud.personnel.positioning.command.query.TerminalBindQueryExe;
import com.zcloud.personnel.positioning.dto.TerminalBindAddCmd;
import com.zcloud.personnel.positioning.dto.TerminalBindPageQry;
import com.zcloud.personnel.positioning.dto.TerminalBindUpdateCmd;
import com.zcloud.personnel.positioning.dto.clientobject.TerminalBindCO;
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 TerminalBindServiceImpl implements TerminalBindServiceI {
    private final TerminalBindAddExe terminalBindAddExe;
    private final TerminalBindUpdateExe terminalBindUpdateExe;
    private final TerminalBindRemoveExe terminalBindRemoveExe;
    private final TerminalBindQueryExe terminalBindQueryExe;

    @Override
    public PageResponse<TerminalBindCO> listPage(TerminalBindPageQry qry) {
        return terminalBindQueryExe.execute(qry);
    }

    @Override
    public List<TerminalBindCO> listAll() {
        return terminalBindQueryExe.listAll();
    }

    @Override
    public TerminalBindCO queryById(Long id) {
        return terminalBindQueryExe.queryById(id);
    }

    @Override
    public SingleResponse<TerminalBindCO> add(TerminalBindAddCmd cmd) {
        terminalBindAddExe.execute(cmd);
        return SingleResponse.buildSuccess();
    }

    @Override
    public void edit(TerminalBindUpdateCmd cmd) {
        terminalBindUpdateExe.execute(cmd);
    }

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

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