package com.zcloud.domain.command;

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


/**
 * web-app
 *
 * @Author zhaokai
 * @Date 2026-01-27 11:30:46
 */
@Component
@AllArgsConstructor
public class ProjectTaskScoreInfoRemoveExe {
    private final ProjectTaskScoreInfoGateway projectTaskScoreInfoGateway;

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

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

