package com.zcloud.basic.info.command;

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




/**
* web-app
* @Author SondonYong
* @Date 2025-10-31 09:50:41
*/
@Component
@AllArgsConstructor
public class UserQualificationInfoRemoveExe {
    private final UserQualificationInfoGateway userQualificationInfoGateway;

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

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

