package com.zcloud.fire.check.command;

import com.alibaba.cola.exception.BizException;
import com.zcloud.fire.check.domain.gateway.FireCheckRecordHiddenGateway;
import com.zcloud.fire.check.domain.model.FireCheckRecordHiddenE;
import com.zcloud.fire.check.dto.FireCheckRecordHiddenUpdateCmd;
import lombok.AllArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;


/**
 * web-app
 *
 * @Author zhaokai
 * @Date 2025-12-12 11:11:16
 */
@Component
@AllArgsConstructor
public class FireCheckRecordHiddenUpdateExe {
    private final FireCheckRecordHiddenGateway fireCheckRecordHiddenGateway;

    @Transactional(rollbackFor = Exception.class)
    public void execute(FireCheckRecordHiddenUpdateCmd fireCheckRecordHiddenUpdateCmd) {
        FireCheckRecordHiddenE fireCheckRecordHiddenE = new FireCheckRecordHiddenE();
        BeanUtils.copyProperties(fireCheckRecordHiddenUpdateCmd, fireCheckRecordHiddenE);
        boolean res = fireCheckRecordHiddenGateway.update(fireCheckRecordHiddenE);
        if (!res) {
            throw new BizException("修改失败");
        }
    }
}

