| | | 1 | | using System; |
| | | 2 | | using System.Collections.Generic; |
| | | 3 | | using System.Linq; |
| | | 4 | | using System.Threading.Tasks; |
| | | 5 | | using WinSolutions.Sveta.Server.Data.DataLoading; |
| | | 6 | | |
| | | 7 | | namespace SVETA.Api.Data.DTO |
| | | 8 | | { |
| | | 9 | | public class UploadResultDTO |
| | | 10 | | { |
| | | 11 | | public UploadResultDTO() |
| | | 12 | | { |
| | | 13 | | |
| | | 14 | | } |
| | | 15 | | |
| | | 16 | | public UploadResultDTO(LoadingResult res, string baseUrl) |
| | | 17 | | { |
| | | 18 | | succeed = res.Errors == null || !res.Errors.Any(); |
| | | 19 | | errorCount = res.Errors == null ? 0 : res.Errors.Count(); |
| | | 20 | | reportUrl = $"{baseUrl.TrimEnd('/')}/api/v1/Upload/GetReport?id={res.UploadId}"; |
| | | 21 | | uploadId = res.UploadId; |
| | | 22 | | } |
| | | 23 | | |
| | | 24 | | public bool succeed { get; set; } |
| | | 25 | | |
| | | 26 | | public int errorCount { get; set; } |
| | | 27 | | |
| | | 28 | | public string reportUrl { get; set; } |
| | | 29 | | |
| | | 30 | | public long uploadId { get; set; } |
| | | 31 | | } |
| | | 32 | | |
| | | 33 | | public class UploadStringResultDto : UploadResultDTO |
| | | 34 | | { |
| | 0 | 35 | | public List<string> Result { get; set; } |
| | | 36 | | |
| | 0 | 37 | | public UploadStringResultDto() : base() |
| | 0 | 38 | | { |
| | | 39 | | |
| | 0 | 40 | | } |
| | | 41 | | |
| | 0 | 42 | | public UploadStringResultDto(LoadingResult res, string baseUrl): base (res, baseUrl) |
| | 0 | 43 | | { |
| | | 44 | | |
| | 0 | 45 | | } |
| | | 46 | | } |
| | | 47 | | } |