package com.zcloud.fire.check.service;

import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse;
import com.zcloud.fire.check.api.FireCheckRecordDeviceServiceI;
import com.zcloud.fire.check.command.FireCheckRecordDeviceAddExe;
import com.zcloud.fire.check.command.FireCheckRecordDeviceRemoveExe;
import com.zcloud.fire.check.command.FireCheckRecordDeviceUpdateExe;
import com.zcloud.fire.check.command.query.FireCheckRecordDeviceQueryExe;
import com.zcloud.fire.check.dto.FireCheckRecordDeviceAddCmd;
import com.zcloud.fire.check.dto.FireCheckRecordDevicePageQry;
import com.zcloud.fire.check.dto.FireCheckRecordDeviceUpdateCmd;
import com.zcloud.fire.check.dto.clientobject.FireCheckRecordDeviceCO;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * web-app
 *
 * @Author zhaokai
 * @Date 2025-12-12 11:10:03
 */
@Service
@AllArgsConstructor
public class FireCheckRecordDeviceServiceImpl implements FireCheckRecordDeviceServiceI {
    private final FireCheckRecordDeviceAddExe fireCheckRecordDeviceAddExe;
    private final FireCheckRecordDeviceUpdateExe fireCheckRecordDeviceUpdateExe;
    private final FireCheckRecordDeviceRemoveExe fireCheckRecordDeviceRemoveExe;
    private final FireCheckRecordDeviceQueryExe fireCheckRecordDeviceQueryExe;

    @Override
    public PageResponse<FireCheckRecordDeviceCO> listPage(FireCheckRecordDevicePageQry qry) {

        return fireCheckRecordDeviceQueryExe.execute(qry);
    }

    @Override
    public SingleResponse add(FireCheckRecordDeviceAddCmd cmd) {

        fireCheckRecordDeviceAddExe.execute(cmd);
        return SingleResponse.buildSuccess();
    }

    @Override
    public void edit(FireCheckRecordDeviceUpdateCmd fireCheckRecordDeviceUpdateCmd) {
        fireCheckRecordDeviceUpdateExe.execute(fireCheckRecordDeviceUpdateCmd);
    }

    @Override
    public void remove(Long id) {
        fireCheckRecordDeviceRemoveExe.execute(id);
    }

    @Override
    public void removeBatch(Long[] ids) {
        fireCheckRecordDeviceRemoveExe.execute(ids);
    }
}

