package com.zcloud.personnel.positioning.service;

import com.zcloud.personnel.positioning.api.AlarmRuleFenceRelServiceI;
import com.zcloud.personnel.positioning.command.AlarmRuleFenceRelAddExe;
import com.zcloud.personnel.positioning.command.AlarmRuleFenceRelRemoveExe;
import com.zcloud.personnel.positioning.command.AlarmRuleFenceRelUpdateExe;
import com.zcloud.personnel.positioning.command.query.AlarmRuleFenceRelQueryExe;
import com.zcloud.personnel.positioning.dto.AlarmRuleFenceRelAddCmd;
import com.zcloud.personnel.positioning.dto.AlarmRuleFenceRelPageQry;
import com.zcloud.personnel.positioning.dto.AlarmRuleFenceRelUpdateCmd;
import com.zcloud.personnel.positioning.dto.clientobject.AlarmRuleFenceRelCO;
import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * web-app
 *
 * @Author fangjiakai
 * @Date 2026-07-07
 */
@Service
@AllArgsConstructor
public class AlarmRuleFenceRelServiceImpl implements AlarmRuleFenceRelServiceI {
    private final AlarmRuleFenceRelAddExe alarmRuleFenceRelAddExe;
    private final AlarmRuleFenceRelUpdateExe alarmRuleFenceRelUpdateExe;
    private final AlarmRuleFenceRelRemoveExe alarmRuleFenceRelRemoveExe;
    private final AlarmRuleFenceRelQueryExe alarmRuleFenceRelQueryExe;

    @Override
    public PageResponse<AlarmRuleFenceRelCO> listPage(AlarmRuleFenceRelPageQry qry) {
        return alarmRuleFenceRelQueryExe.execute(qry);
    }

    @Override
    public List<AlarmRuleFenceRelCO> listAll() {
        return alarmRuleFenceRelQueryExe.listAll();
    }

    @Override
    public AlarmRuleFenceRelCO queryById(Long id) {
        return alarmRuleFenceRelQueryExe.queryById(id);
    }

    @Override
    public SingleResponse<AlarmRuleFenceRelCO> add(AlarmRuleFenceRelAddCmd cmd) {
        alarmRuleFenceRelAddExe.execute(cmd);
        return SingleResponse.buildSuccess();
    }

    @Override
    public void edit(AlarmRuleFenceRelUpdateCmd cmd) {
        alarmRuleFenceRelUpdateExe.execute(cmd);
    }

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

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