package com.zcloud.primeport.command;

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




/**
* web-app
* @Author dearLin
* @Date 2026-03-19 13:59:16
*/
@Component
@AllArgsConstructor
public class ClosedAreaPersonApplyRemoveExe {
    private final ClosedAreaPersonApplyGateway closedAreaPersonApplyGateway;

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

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

