Revize f053c1b6
Přidáno uživatelem Vojtěch Bartička před asi 3 roky(ů)
Backend/Models/Documents/DocumentAddInfo.cs | ||
---|---|---|
1 |
using Models.Enums; |
|
2 |
using System; |
|
3 |
using System.Collections.Generic; |
|
4 |
using System.Linq; |
|
5 |
using System.Text; |
|
6 |
using System.Threading.Tasks; |
|
7 | ||
8 |
namespace Models.Documents; |
|
9 | ||
10 |
/** |
|
11 |
* If the file is plaintext, we except it to be a single document |
|
12 |
* If the file is base64, we expect it to be a ZIP file with plaintext documents in its root |
|
13 |
*/ |
|
14 |
public class DocumentAddInfo |
|
15 |
{ |
|
16 |
public string Name { get; set; } |
|
17 |
public EAddDocumentFormat Format { get; set; } |
|
18 |
public string Content { get; set; } |
|
19 |
} |
Backend/Models/Documents/DocumentAddRequest.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using System.Threading.Tasks; |
|
6 | ||
7 |
namespace Models.Documents; |
|
8 | ||
9 |
public class DocumentAddRequest |
|
10 |
{ |
|
11 |
public List<DocumentAddInfo> Documents { get; set; } |
|
12 |
} |
Backend/Models/Documents/DocumentListInfo.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using System.Threading.Tasks; |
|
6 | ||
7 |
namespace Models.Documents; |
|
8 | ||
9 |
public class DocumentListInfo |
|
10 |
{ |
|
11 |
public Guid Id { get; set; } |
|
12 |
public string Name { get; set; } |
|
13 |
public int Length { get; set; } |
|
14 | ||
15 |
public int RequiredAnnotations { get; set; } |
|
16 |
} |
Backend/Models/Documents/DocumentListRequest.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using System.Threading.Tasks; |
|
6 | ||
7 |
namespace Models.Documents; |
|
8 | ||
9 |
public class DocumentListRequest |
|
10 |
{ |
|
11 |
public int PageIndex { get; set; } |
|
12 |
public int PageSize { get; set; } |
|
13 |
} |
|
14 |
Backend/Models/Documents/DocumentListResponse.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using System.Threading.Tasks; |
|
6 | ||
7 |
namespace Models.Documents; |
|
8 | ||
9 |
public class DocumentListResponse |
|
10 |
{ |
|
11 |
/** Total number of results */ |
|
12 |
public int TotalCount { get; set; } |
|
13 |
/** Number of pages */ |
|
14 |
public int PageCount { get; set; } |
|
15 |
/** Current page index */ |
|
16 |
public int PageIndex { get; set; } |
|
17 | ||
18 |
public List<DocumentListInfo> Documents { get; set; } = new(); |
|
19 |
} |
|
20 |
Backend/Models/Enums/EAddDocumentFormat.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using System.Threading.Tasks; |
|
6 | ||
7 |
namespace Models.Enums; |
|
8 | ||
9 |
public enum EAddDocumentFormat |
|
10 |
{ |
|
11 |
BASE64, |
|
12 |
PLAINTEXT |
|
13 |
} |
Také k dispozici: Unified diff
Added Document API related DTOs