添加项目文件。
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
using FileService.Domain.ValueObjects;
|
||||
using IM.DomainCommons;
|
||||
|
||||
namespace FileService.Domain.Entities
|
||||
{
|
||||
public class UploadFile:AggregateRootEntity
|
||||
{
|
||||
public Guid OwnerId { get; private set; }
|
||||
public FileName FileName { get; private set; }
|
||||
public long FileSize { get;private set; }
|
||||
public ContentType ContentType { get;private set; }
|
||||
public FileState State { get; private set; }
|
||||
public StorageLocation? StorageLocation { get; private set; }
|
||||
public CheckSum CheckSum { get; private set; }
|
||||
|
||||
private UploadFile() { }
|
||||
public UploadFile(Guid ownerId, string fileName, string contentType)
|
||||
{
|
||||
OwnerId = ownerId;
|
||||
FileName = fileName;
|
||||
ContentType = contentType;
|
||||
State = FileState.Created;
|
||||
}
|
||||
|
||||
public void StartUpload()
|
||||
{
|
||||
State = FileState.Uploading;
|
||||
}
|
||||
|
||||
public void CompleteUpload(StorageLocation storage, CheckSum checkSum)
|
||||
{
|
||||
StorageLocation = storage;
|
||||
CheckSum = checkSum;
|
||||
State = FileState.Uploaded;
|
||||
}
|
||||
|
||||
public void Fail()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user