package com.zcloud.safetyDutyList.command.tasklist;

import com.alibaba.cola.exception.BizException;
import com.zcloud.safetyDutyList.domain.gateway.tasklist.TaskListGateway;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * 清单删除执行器
 * <p>
 * 根据主键ID删除安全责任清单
 */
@Component
@AllArgsConstructor
public class TaskListRemoveExe {
    private final TaskListGateway taskListGateway;

    public void execute(Long id) {
        boolean res = taskListGateway.deleteById(id);
        if (!res) {
            throw new BizException("删除失败");
        }
    }
}
