package com.bcxin.autodownloadupload.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.bcxin.autodownloadupload.configs.PullConfig;
import com.bcxin.autodownloadupload.dtos.ChangeLogsRequestDto;
import com.bcxin.autodownloadupload.entity.PullRecord;

import java.util.Date;

/**
 * description: 拉取记录表service
 * author: linchunpeng
 * date:  2023-04-19 14:08
 */
public interface PullRecordService extends IService<PullRecord> {

    /**
     * description: 新增拉取记录
     * author: linchunpeng
     * date:  2023-04-21 10:27
     */
    PullRecord createRecord(Long autoFerryTaskId, PullConfig pullConfig, ChangeLogsRequestDto requestDto, int pullType, String regionCode);

    /**
     * description: 根据requestId查询拉取记录
     * author: linchunpeng
     * date:  2023-04-25 9:43
     */
    PullRecord getByRequestId(String requestId);

    /**
     * description：获取最后一条拉取记录
     * author：linchunpeng
     * date：2025/6/17
     */
    PullRecord getLastRecord(String regionCode);

    /**
     * description：获取最后一条同个时间的拉取记录
     * author：linchunpeng
     * date：2025/6/17
     */
    PullRecord getLastSameTimeRecord(String regionCode, Date startTime, Long id);

    /**
     * description：获取change-log那边是否有报错
     * author：linchunpeng
     * date：2025/6/17
     */
    String selectErrorSyncChangeLogs(String id);
}
