package com.zcloud.zcGbsServicer.service;

import com.zcloud.zcGbsServicer.api.ControlRoomServiceI;
import com.zcloud.zcGbsServicer.command.ControlRoomAddExe;
import com.zcloud.zcGbsServicer.command.ControlRoomRemoveExe;
import com.zcloud.zcGbsServicer.command.ControlRoomUpdateExe;
import com.zcloud.zcGbsServicer.command.query.ControlRoomQueryExe;
import com.zcloud.zcGbsServicer.dto.ControlRoomAddCmd;
import com.zcloud.zcGbsServicer.dto.ControlRoomPageQry;
import com.zcloud.zcGbsServicer.dto.ControlRoomScreenQry;
import com.zcloud.zcGbsServicer.dto.ControlRoomUpdateCmd;
import com.zcloud.zcGbsServicer.dto.clientobject.ControlRoomCO;
import com.zcloud.zcGbsServicer.dto.clientobject.ControlRoomScreenCO;

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:21:51
*/
@Service
@AllArgsConstructor
public class ControlRoomServiceImpl implements ControlRoomServiceI {
    private final ControlRoomAddExe controlRoomAddExe;
    private final ControlRoomUpdateExe controlRoomUpdateExe;
    private final ControlRoomRemoveExe controlRoomRemoveExe;
    private final ControlRoomQueryExe controlRoomQueryExe;

    @Override
    public PageResponse<ControlRoomCO> listPage(ControlRoomPageQry qry){

        return controlRoomQueryExe.execute(qry);
    }

    @Override
    public PageResponse<ControlRoomScreenCO> listScreen(ControlRoomScreenQry qry) {
        return controlRoomQueryExe.listScreen(qry);
    }

    @Override
    public ControlRoomCO getInfoById(Long id) {
        return controlRoomQueryExe.getById(id);
    }

    @Override
    public SingleResponse add(ControlRoomAddCmd cmd) {

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

    @Override
    public void edit(ControlRoomUpdateCmd controlRoomUpdateCmd) {
        controlRoomUpdateExe.execute(controlRoomUpdateCmd);
    }

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

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

