package com.zcloud.zcGbsServicer.command;

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




/**
* web-app
* @Author makejava
* @Date 2026-01-21 17:22:16
*/
@Component
@AllArgsConstructor
public class PumpRoomRemoveExe {
    private final PumpRoomGateway pumpRoomGateway;

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

    @Transactional(rollbackFor = Exception.class)
    public boolean execute(Long[] ids) {
        boolean res = pumpRoomGateway.deletedPumpRoomByIds(ids);
        if(!res){
            throw new BizException("删除失败");
        }
        return true;
    }
}

