package com.zcloud.primeport.command;

import com.zcloud.primeport.domain.gateway.VehicleDockLogGateway;
import com.alibaba.cola.exception.BizException;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


/**
 * web-app
 *
 * @Author dearLin
 * @Date 2026-04-14 14:53:30
 */
@Component
@AllArgsConstructor
public class VehicleDockLogRemoveExe {
    private final VehicleDockLogGateway vehicleDockLogGateway;

    @Transactional(rollbackFor = Exception.class)
    public boolean execute(Long id) {
        boolean res = vehicleDockLogGateway.deletedVehicleDockLogById(id);
        if (!res) {
            throw new BizException("删除失败");
        }
        return true;
    }

    @Transactional(rollbackFor = Exception.class)
    public boolean execute(List<Long> ids) {
        boolean res = vehicleDockLogGateway.deletedVehicleDockLogByIds(ids);
        if (!res) {
            throw new BizException("删除失败");
        }
        return true;
    }
}

