package com.zcloud.primeport.service;

import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse;
import com.zcloud.primeport.api.VehicleBlackServiceI;
import com.zcloud.primeport.command.VehicleBlackAddExe;
import com.zcloud.primeport.command.VehicleBlackRemoveExe;
import com.zcloud.primeport.command.VehicleBlackUpdateExe;
import com.zcloud.primeport.command.query.VehicleBlackQueryExe;
import com.zcloud.primeport.dto.VehicleBlackAddCmd;
import com.zcloud.primeport.dto.VehicleBlackPageQry;
import com.zcloud.primeport.dto.VehicleBlackUpdateCmd;
import com.zcloud.primeport.dto.clientobject.VehicleBlackCO;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * web-app
 *
 * @Author makejava
 * @Date 2026-03-05 11:33:27
 */
@Service
@AllArgsConstructor
public class VehicleBlackServiceImpl implements VehicleBlackServiceI {
    private final VehicleBlackAddExe vehicleBlackAddExe;
    private final VehicleBlackUpdateExe vehicleBlackUpdateExe;
    private final VehicleBlackRemoveExe vehicleBlackRemoveExe;
    private final VehicleBlackQueryExe vehicleBlackQueryExe;

    @Override
    public PageResponse<VehicleBlackCO> listPage(VehicleBlackPageQry qry) {

        return vehicleBlackQueryExe.execute(qry);
    }

    @Override
    public SingleResponse add(VehicleBlackAddCmd cmd) {

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

    @Override
    public void edit(VehicleBlackUpdateCmd vehicleBlackUpdateCmd) {
        vehicleBlackUpdateExe.execute(vehicleBlackUpdateCmd);
    }

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

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

    @Override
    public VehicleBlackCO getInfoById(Long id) {
        return vehicleBlackQueryExe.getInfoById(id);
    }
}

