package com.zcloud.personnel.positioning.service;

import com.zcloud.personnel.positioning.api.AlarmRecordTargetServiceI;
import com.zcloud.personnel.positioning.command.AlarmRecordTargetAddExe;
import com.zcloud.personnel.positioning.command.AlarmRecordTargetRemoveExe;
import com.zcloud.personnel.positioning.command.AlarmRecordTargetUpdateExe;
import com.zcloud.personnel.positioning.command.query.AlarmRecordTargetQueryExe;
import com.zcloud.personnel.positioning.dto.AlarmRecordTargetAddCmd;
import com.zcloud.personnel.positioning.dto.AlarmRecordTargetPageQry;
import com.zcloud.personnel.positioning.dto.AlarmRecordTargetUpdateCmd;
import com.zcloud.personnel.positioning.dto.clientobject.AlarmRecordTargetCO;
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 AlarmRecordTargetServiceImpl implements AlarmRecordTargetServiceI {
    private final AlarmRecordTargetAddExe alarmRecordTargetAddExe;
    private final AlarmRecordTargetUpdateExe alarmRecordTargetUpdateExe;
    private final AlarmRecordTargetRemoveExe alarmRecordTargetRemoveExe;
    private final AlarmRecordTargetQueryExe alarmRecordTargetQueryExe;

    @Override
    public PageResponse<AlarmRecordTargetCO> listPage(AlarmRecordTargetPageQry qry) {
        return alarmRecordTargetQueryExe.execute(qry);
    }

    @Override
    public List<AlarmRecordTargetCO> listAll() {
        return alarmRecordTargetQueryExe.listAll();
    }

    @Override
    public AlarmRecordTargetCO queryById(Long id) {
        return alarmRecordTargetQueryExe.queryById(id);
    }

    @Override
    public SingleResponse<AlarmRecordTargetCO> add(AlarmRecordTargetAddCmd cmd) {
        alarmRecordTargetAddExe.execute(cmd);
        return SingleResponse.buildSuccess();
    }

    @Override
    public void edit(AlarmRecordTargetUpdateCmd cmd) {
        alarmRecordTargetUpdateExe.execute(cmd);
    }

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

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