Add output file type, collect all files
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using AutoMapper;
|
||||
using LeafWeb.Core.Entities;
|
||||
|
||||
@@ -9,15 +10,33 @@ namespace LeafWeb.Core.Remote
|
||||
|
||||
public string Filename { get; set; }
|
||||
public byte[] Contents { get; set; }
|
||||
public string DirectoryName { get; set; }
|
||||
public int LeafInputId => PiscalUtility.GetIdFromDirectoryName(DirectoryName);
|
||||
public string PiscalDirectoryName { get; set; }
|
||||
public int LeafInputId => PiscalUtility.GetIdFromDirectoryName(PiscalDirectoryName);
|
||||
// valid values: "touser", "nottouser", "clninput"
|
||||
public string OutputFileType { get; set; }
|
||||
|
||||
static PiscalLeafOutputFile()
|
||||
{
|
||||
var config =
|
||||
new MapperConfiguration(cfg =>
|
||||
{
|
||||
cfg.CreateMap<PiscalLeafOutputFile, LeafOutputFile>();
|
||||
cfg.CreateMap<PiscalLeafOutputFile, LeafOutputFile>()
|
||||
.ForMember(dest => dest.FileType, opt =>
|
||||
opt.ResolveUsing(src =>
|
||||
{
|
||||
switch (src.OutputFileType)
|
||||
{
|
||||
case "touser":
|
||||
return LeafOutputFileType.ToUser;
|
||||
case "nottouser":
|
||||
return LeafOutputFileType.NotToUser;
|
||||
case "clninput":
|
||||
return LeafOutputFileType.CleanedInput;
|
||||
default:
|
||||
throw new ArgumentException();
|
||||
}
|
||||
|
||||
}));
|
||||
});
|
||||
Mapper = config.CreateMapper();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user