package com.zcloud.safetyDutyList.command.tasklist;

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

/**
 * 反馈删除执行器
 * <p>
 * 根据主键ID删除反馈记录
 */
@Component
@AllArgsConstructor
public class FeedbackDeleteExe {
    private final FeedbackGateway feedbackGateway;

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