package com.zcloud.primeport.service;

import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse;
import com.zcloud.primeport.api.MkmjGateServiceI;
import com.zcloud.primeport.command.MkmjGateAddExe;
import com.zcloud.primeport.command.MkmjGateRemoveExe;
import com.zcloud.primeport.command.MkmjGateUpdateExe;
import com.zcloud.primeport.command.query.MkmjGateQueryExe;
import com.zcloud.primeport.dto.MkmjGateAddCmd;
import com.zcloud.primeport.dto.MkmjGatePageQry;
import com.zcloud.primeport.dto.MkmjGateUpdateCmd;
import com.zcloud.primeport.dto.clientobject.MkmjGateCO;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * web-app
 *
 * @Author makejava
 * @Date 2026-03-05 11:33:18
 */
@Service
@AllArgsConstructor
public class MkmjGateServiceImpl implements MkmjGateServiceI {
    private final MkmjGateAddExe mkmjGateAddExe;
    private final MkmjGateUpdateExe mkmjGateUpdateExe;
    private final MkmjGateRemoveExe mkmjGateRemoveExe;
    private final MkmjGateQueryExe mkmjGateQueryExe;

    @Override
    public PageResponse<MkmjGateCO> listPage(MkmjGatePageQry qry) {

        return mkmjGateQueryExe.execute(qry);
    }

    @Override
    public SingleResponse add(MkmjGateAddCmd cmd) {

        mkmjGateAddExe.execute(cmd);
        return SingleResponse.buildSuccess();
    }

    @Override
    public void edit(MkmjGateUpdateCmd mkmjGateUpdateCmd) {
        mkmjGateUpdateExe.execute(mkmjGateUpdateCmd);
    }

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

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

    @Override
    public MkmjGateCO getInfoById(Long id) {
        return mkmjGateQueryExe.getInfoById(id);
    }

    @Override
    public Boolean checkName(String gateName, Long passageId, Long id) {
        return mkmjGateQueryExe.checkName(gateName,passageId, id);
    }
}

