Add download worker and download service
This commit is contained in:
@@ -1,33 +1,55 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Downloader;
|
||||
|
||||
namespace DownloadManager.Models;
|
||||
public class DownloadItemData
|
||||
{
|
||||
public required string FileName
|
||||
public DownloadItemData(string fileName, string filePath, string url, DownloadConfiguration downloadConfig)
|
||||
{
|
||||
Id = Guid.NewGuid();
|
||||
FileName = fileName;
|
||||
FilePath = filePath;
|
||||
Url = url;
|
||||
downloadConfiguration = downloadConfig;
|
||||
}
|
||||
|
||||
public Guid Id
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public string FileName
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public string FilePath
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public string Url
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public DownloadConfiguration downloadConfiguration
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public long FileSize
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public required string Url
|
||||
public double Speed
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public required long FileSize
|
||||
public int Progress
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public required long Speed
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public required int Progress
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public required DownloadStatus Status
|
||||
public DownloadStatus Status
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DownloadManager.Models;
|
||||
public enum DownloadStatus
|
||||
{
|
||||
Downloading,
|
||||
Pausing,
|
||||
Done,
|
||||
Cancel
|
||||
}
|
||||
Reference in New Issue
Block a user