package com.centreproject.system.service.sync;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.centreproject.common.enums.SyncStatus;
import com.centreproject.system.domain.sync.kpi.DataSyncLog;

/**
 * 同步日志
 * @author zhonglei.xu
 * @date 2025/08/21 14:53
 */
public interface IDataSyncLogService extends IService<DataSyncLog> {


    /**
     * 获取同步日志分页
     * @param dataSyncLog  查询条件
     * @param pageNum 页码
     * @param pageSize 大小
     * @return Page<DataSyncLog>
     */
    Page<DataSyncLog> getDataSyncLogPage(DataSyncLog dataSyncLog, int pageNum, int pageSize);
    /**
     * 同步任务开始
     * @param jobId 任务ID
     * @param traceId 跟踪ID
     * @param sourceSystem 源系统
     * @param sourceTable 源表
     * @param targetTable 目标表
     */
    void startSync(Long jobId,String traceId, String sourceSystem,
              String sourceTable, String targetTable);

    /**
     * 同步任务结束
     * @param traceId
     * @param dataCount
     * @param status
     * @param errorMsg
     */
    void endSync(String traceId, int dataCount,
                 SyncStatus status, String errorMsg);

    /**
     * 规则相关日志
     * @param jobId jobID
     * @param traceId traceID
     * @param sourceSystem sourceSystem
     * @param sourceTable sourceTable
     * @param targetTable targetTable
     * @param msg errorMsg
     */
     void ruleSync(Long jobId, String traceId, String sourceSystem,
                         String sourceTable, String targetTable,String msg);



}
