package com.zcloud.zcGbsServicer.service;

import com.zcloud.zcGbsServicer.api.ResourceDeviceServiceI;
import com.zcloud.zcGbsServicer.command.ResourceDeviceAddExe;
import com.zcloud.zcGbsServicer.command.ResourceDeviceRemoveExe;
import com.zcloud.zcGbsServicer.command.ResourceDeviceUpdateExe;
import com.zcloud.zcGbsServicer.command.query.ResourceDeviceQueryExe;
import com.zcloud.zcGbsServicer.dto.ResourceDeviceAddCmd;
import com.zcloud.zcGbsServicer.dto.ResourceDevicePageQry;
import com.zcloud.zcGbsServicer.dto.ResourceDeviceUpdateCmd;
import com.zcloud.zcGbsServicer.dto.clientobject.ResourceDeviceCO;

import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
* web-app
* @Author makejava
* @Date 2026-01-21 17:23:16
*/
@Service
@AllArgsConstructor
public class ResourceDeviceServiceImpl implements ResourceDeviceServiceI {
    private final ResourceDeviceAddExe resourceDeviceAddExe;
    private final ResourceDeviceUpdateExe resourceDeviceUpdateExe;
    private final ResourceDeviceRemoveExe resourceDeviceRemoveExe;
    private final ResourceDeviceQueryExe resourceDeviceQueryExe;

    @Override
    public PageResponse<ResourceDeviceCO> listPage(ResourceDevicePageQry qry){

        return resourceDeviceQueryExe.execute(qry);
    }

    @Override
    public SingleResponse add(ResourceDeviceAddCmd cmd) {

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

    @Override
    public void edit(ResourceDeviceUpdateCmd resourceDeviceUpdateCmd) {
        resourceDeviceUpdateExe.execute(resourceDeviceUpdateCmd);
    }

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

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

