package com.zcloud.fire.check.service;

import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse;
import com.zcloud.fire.check.api.FireRegionServiceI;
import com.zcloud.fire.check.command.FireRegionAddExe;
import com.zcloud.fire.check.command.FireRegionRemoveExe;
import com.zcloud.fire.check.command.FireRegionUpdateExe;
import com.zcloud.fire.check.command.query.FireRegionQueryExe;
import com.zcloud.fire.check.dto.*;
import com.zcloud.fire.check.dto.clientobject.FireRegionCO;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * web-app
 *
 * @Author zhaokai
 * @Date 2025-11-26 10:13:10
 */
@Service
@AllArgsConstructor
public class FireRegionServiceImpl implements FireRegionServiceI {
    private final FireRegionAddExe fireRegionAddExe;
    private final FireRegionUpdateExe fireRegionUpdateExe;
    private final FireRegionRemoveExe fireRegionRemoveExe;
    private final FireRegionQueryExe fireRegionQueryExe;

    @Override
    public PageResponse<FireRegionCO> listPage(FireRegionPageQry qry) {

        return fireRegionQueryExe.execute(qry);
    }

    @Override
    public SingleResponse add(FireRegionAddCmd cmd) {

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

    @Override
    public void edit(FireRegionUpdateCmd fireRegionUpdateCmd) {
        fireRegionUpdateExe.execute(fireRegionUpdateCmd);
    }

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

    @Override
    public void removeBatch(Long[] ids) {
        fireRegionRemoveExe.execute(ids);
    }
    @Override
    public FireRegionCO getInfoById(Long id) {
        return fireRegionQueryExe.getInfoById(id);
    }

    @Override
    public void editStatus(FireRegionUpdateStatusCmd fireRegionUpdateStatusCmd) {
        fireRegionUpdateExe.editStatus(fireRegionUpdateStatusCmd);
    }
    @Override
    public void editAllDepartment(FireRegionUpdateDepartmentCmd fireRegionUpdateDepartmentCmd) {
        fireRegionUpdateExe.editAllDepartment(fireRegionUpdateDepartmentCmd);
    }
    @Override
    public List<FireRegionCO> listAll(Long corpinfoId) {
        return fireRegionQueryExe.listAll(corpinfoId);
    }
}

