package com.zcloud.personnel.positioning.service;

import com.zcloud.personnel.positioning.api.SyncLogServiceI;
import com.zcloud.personnel.positioning.command.SyncLogAddExe;
import com.zcloud.personnel.positioning.command.SyncLogRemoveExe;
import com.zcloud.personnel.positioning.command.SyncLogUpdateExe;
import com.zcloud.personnel.positioning.command.query.SyncLogQueryExe;
import com.zcloud.personnel.positioning.dto.SyncLogAddCmd;
import com.zcloud.personnel.positioning.dto.SyncLogPageQry;
import com.zcloud.personnel.positioning.dto.SyncLogUpdateCmd;
import com.zcloud.personnel.positioning.dto.clientobject.SyncLogCO;
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 SyncLogServiceImpl implements SyncLogServiceI {
    private final SyncLogAddExe syncLogAddExe;
    private final SyncLogUpdateExe syncLogUpdateExe;
    private final SyncLogRemoveExe syncLogRemoveExe;
    private final SyncLogQueryExe syncLogQueryExe;

    @Override
    public PageResponse<SyncLogCO> listPage(SyncLogPageQry qry) {
        return syncLogQueryExe.execute(qry);
    }

    @Override
    public List<SyncLogCO> listAll() {
        return syncLogQueryExe.listAll();
    }

    @Override
    public SyncLogCO queryById(Long id) {
        return syncLogQueryExe.queryById(id);
    }

    @Override
    public SingleResponse<SyncLogCO> add(SyncLogAddCmd cmd) {
        syncLogAddExe.execute(cmd);
        return SingleResponse.buildSuccess();
    }

    @Override
    public void edit(SyncLogUpdateCmd cmd) {
        syncLogUpdateExe.execute(cmd);
    }

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

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