You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.1 KiB

using Ksat.Supplyment.Library.Model.Uploader;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Ksat.Supplyment.Library.Uploader
{
public interface IUploaderOperator<T>
{
/// <summary>
/// 上传数据
/// </summary>
IUploaderRequest<T> UploadData(T data);
T ConvertCacheToRequest(string cache);
string ConvertRequestToCachel(T requestData);
/// <summary>
/// 任务开始前,判断任务是否要开始
/// </summary>
/// <param name="requestModel"></param>
/// <param name="cancelReason"></param>
/// <returns></returns>
bool ShouldStartRequest(UploadModel<T> requestModel, out string cancelReason);
/// <summary>
/// 任务失败以后,判断是否需要重试
/// </summary>
/// <param name="requestModel"></param>
/// <param name="cancelReason"></param>
/// <returns></returns>
bool ShouldRetryRequest(UploadModel<T> requestModel, out string cancelReason);
}
}