|
1 | | -using System.Threading.Tasks; |
2 | | -using Microsoft.AspNetCore.Mvc; |
3 | | -using Microsoft.Extensions.Options; |
4 | | -using NextGenSoftware.OASIS.API.Core.Helpers; |
5 | | -using NextGenSoftware.OASIS.API.Core.Managers; |
6 | | -using NextGenSoftware.OASIS.API.DNA; |
7 | | -using NextGenSoftware.OASIS.Common; |
8 | | -using System; |
9 | | -using System.Collections.Generic; |
| 1 | +//using System.Threading.Tasks; |
| 2 | +//using Microsoft.AspNetCore.Mvc; |
| 3 | +//using Microsoft.Extensions.Options; |
| 4 | +//using NextGenSoftware.OASIS.API.Core.Helpers; |
| 5 | +//using NextGenSoftware.OASIS.API.Core.Managers; |
| 6 | +//using NextGenSoftware.OASIS.API.DNA; |
| 7 | +//using NextGenSoftware.OASIS.Common; |
| 8 | +//using System; |
| 9 | +//using System.Collections.Generic; |
10 | 10 |
|
11 | | -namespace NextGenSoftware.OASIS.API.ONODE.WebAPI.Controllers |
12 | | -{ |
13 | | - [ApiController] |
14 | | - [Route("api/files")] |
15 | | - public class FilesController : OASISControllerBase |
16 | | - { |
17 | | - /* |
18 | | - OASISDNA _settings; |
| 11 | +//namespace NextGenSoftware.OASIS.API.ONODE.WebAPI.Controllers |
| 12 | +//{ |
| 13 | +// [ApiController] |
| 14 | +// [Route("api/files")] |
| 15 | +// public class FilesController : OASISControllerBase |
| 16 | +// { |
| 17 | +// /* |
| 18 | +// OASISDNA _settings; |
19 | 19 |
|
20 | | - public FilesController(IOptions<OASISDNA> OASISSettings) : base(OASISSettings) |
21 | | - { |
22 | | - _settings = OASISSettings.Value; |
23 | | - }*/ |
| 20 | +// public FilesController(IOptions<OASISDNA> OASISSettings) : base(OASISSettings) |
| 21 | +// { |
| 22 | +// _settings = OASISSettings.Value; |
| 23 | +// }*/ |
24 | 24 |
|
25 | | - public FilesController() |
26 | | - { |
| 25 | +// public FilesController() |
| 26 | +// { |
27 | 27 |
|
28 | | - } |
| 28 | +// } |
29 | 29 |
|
30 | | - /// <summary> |
31 | | - /// Get's all files stored for the currently logged in avatar |
32 | | - /// </summary> |
33 | | - /// <returns></returns> |
34 | | - [Authorize] |
35 | | - [HttpGet("get-all-files-stored-for-current-logged-in-avatar")] |
36 | | - public async Task<OASISResult<List<StoredFile>>> GetAllFilesStoredForCurrentLoggedInAvatar() |
37 | | - { |
38 | | - // Use FilesManager for business logic |
39 | | - return await FilesManager.Instance.GetAllFilesForAvatarAsync(Avatar.Id); |
40 | | - } |
| 30 | +// /// <summary> |
| 31 | +// /// Get's all files stored for the currently logged in avatar |
| 32 | +// /// </summary> |
| 33 | +// /// <returns></returns> |
| 34 | +// [Authorize] |
| 35 | +// [HttpGet("get-all-files-stored-for-current-logged-in-avatar")] |
| 36 | +// public async Task<OASISResult<List<StoredFile>>> GetAllFilesStoredForCurrentLoggedInAvatar() |
| 37 | +// { |
| 38 | +// // Use FilesManager for business logic |
| 39 | +// return await FilesManager.Instance.GetAllFilesForAvatarAsync(Avatar.Id); |
| 40 | +// } |
41 | 41 |
|
42 | | - /// <summary> |
43 | | - /// Upload a file for the current avatar |
44 | | - /// </summary> |
45 | | - /// <param name="fileName">Name of the file</param> |
46 | | - /// <param name="fileData">File data as byte array</param> |
47 | | - /// <param name="contentType">MIME type of the file</param> |
48 | | - /// <param name="metadata">Additional metadata for the file</param> |
49 | | - /// <returns></returns> |
50 | | - [Authorize] |
51 | | - [HttpPost("upload-file")] |
52 | | - public async Task<OASISResult<StoredFile>> UploadFile([FromBody] string fileName, [FromBody] byte[] fileData, [FromBody] string contentType, [FromBody] Dictionary<string, object> metadata = null) |
53 | | - { |
54 | | - // Use FilesManager for business logic |
55 | | - return await FilesManager.Instance.UploadFileAsync(Avatar.Id, fileName, fileData, contentType, metadata); |
56 | | - } |
| 42 | +// /// <summary> |
| 43 | +// /// Upload a file for the current avatar |
| 44 | +// /// </summary> |
| 45 | +// /// <param name="fileName">Name of the file</param> |
| 46 | +// /// <param name="fileData">File data as byte array</param> |
| 47 | +// /// <param name="contentType">MIME type of the file</param> |
| 48 | +// /// <param name="metadata">Additional metadata for the file</param> |
| 49 | +// /// <returns></returns> |
| 50 | +// [Authorize] |
| 51 | +// [HttpPost("upload-file")] |
| 52 | +// public async Task<OASISResult<StoredFile>> UploadFile(string fileName, byte[] fileData, string contentType, Dictionary<string, object> metadata = null) |
| 53 | +// { |
| 54 | +// // Use FilesManager for business logic |
| 55 | +// return await FilesManager.Instance.UploadFileAsync(Avatar.Id, fileName, fileData, contentType, metadata); |
| 56 | +// } |
57 | 57 |
|
58 | | - /// <summary> |
59 | | - /// Download a file by ID |
60 | | - /// </summary> |
61 | | - /// <param name="fileId">ID of the file to download</param> |
62 | | - /// <returns></returns> |
63 | | - [Authorize] |
64 | | - [HttpGet("download-file/{fileId}")] |
65 | | - public async Task<OASISResult<FileDownload>> DownloadFile(Guid fileId) |
66 | | - { |
67 | | - // Use FilesManager for business logic |
68 | | - return await FilesManager.Instance.DownloadFileAsync(Avatar.Id, fileId); |
69 | | - } |
| 58 | +// /// <summary> |
| 59 | +// /// Download a file by ID |
| 60 | +// /// </summary> |
| 61 | +// /// <param name="fileId">ID of the file to download</param> |
| 62 | +// /// <returns></returns> |
| 63 | +// [Authorize] |
| 64 | +// [HttpGet("download-file/{fileId}")] |
| 65 | +// public async Task<OASISResult<FileDownload>> DownloadFile(Guid fileId) |
| 66 | +// { |
| 67 | +// // Use FilesManager for business logic |
| 68 | +// return await FilesManager.Instance.DownloadFileAsync(Avatar.Id, fileId); |
| 69 | +// } |
70 | 70 |
|
71 | | - /// <summary> |
72 | | - /// Delete a file by ID |
73 | | - /// </summary> |
74 | | - /// <param name="fileId">ID of the file to delete</param> |
75 | | - /// <returns></returns> |
76 | | - [Authorize] |
77 | | - [HttpDelete("delete-file/{fileId}")] |
78 | | - public async Task<OASISResult<bool>> DeleteFile(Guid fileId) |
79 | | - { |
80 | | - // Use FilesManager for business logic |
81 | | - return await FilesManager.Instance.DeleteFileAsync(Avatar.Id, fileId); |
82 | | - } |
| 71 | +// /// <summary> |
| 72 | +// /// Delete a file by ID |
| 73 | +// /// </summary> |
| 74 | +// /// <param name="fileId">ID of the file to delete</param> |
| 75 | +// /// <returns></returns> |
| 76 | +// [Authorize] |
| 77 | +// [HttpDelete("delete-file/{fileId}")] |
| 78 | +// public async Task<OASISResult<bool>> DeleteFile(Guid fileId) |
| 79 | +// { |
| 80 | +// // Use FilesManager for business logic |
| 81 | +// return await FilesManager.Instance.DeleteFileAsync(Avatar.Id, fileId); |
| 82 | +// } |
83 | 83 |
|
84 | | - /// <summary> |
85 | | - /// Get file metadata by ID |
86 | | - /// </summary> |
87 | | - /// <param name="fileId">ID of the file</param> |
88 | | - /// <returns></returns> |
89 | | - [Authorize] |
90 | | - [HttpGet("file-metadata/{fileId}")] |
91 | | - public async Task<OASISResult<StoredFile>> GetFileMetadata(Guid fileId) |
92 | | - { |
93 | | - // Use FilesManager for business logic |
94 | | - return await FilesManager.Instance.GetFileMetadataAsync(Avatar.Id, fileId); |
95 | | - } |
| 84 | +// /// <summary> |
| 85 | +// /// Get file metadata by ID |
| 86 | +// /// </summary> |
| 87 | +// /// <param name="fileId">ID of the file</param> |
| 88 | +// /// <returns></returns> |
| 89 | +// [Authorize] |
| 90 | +// [HttpGet("file-metadata/{fileId}")] |
| 91 | +// public async Task<OASISResult<StoredFile>> GetFileMetadata(Guid fileId) |
| 92 | +// { |
| 93 | +// // Use FilesManager for business logic |
| 94 | +// return await FilesManager.Instance.GetFileMetadataAsync(Avatar.Id, fileId); |
| 95 | +// } |
96 | 96 |
|
97 | | - /// <summary> |
98 | | - /// Update file metadata |
99 | | - /// </summary> |
100 | | - /// <param name="fileId">ID of the file</param> |
101 | | - /// <param name="metadata">New metadata for the file</param> |
102 | | - /// <returns></returns> |
103 | | - [Authorize] |
104 | | - [HttpPut("update-file-metadata/{fileId}")] |
105 | | - public async Task<OASISResult<bool>> UpdateFileMetadata(Guid fileId, [FromBody] Dictionary<string, object> metadata) |
106 | | - { |
107 | | - // Use FilesManager for business logic |
108 | | - return await FilesManager.Instance.UpdateFileMetadataAsync(Avatar.Id, fileId, metadata); |
109 | | - } |
110 | | - } |
111 | | -} |
| 97 | +// /// <summary> |
| 98 | +// /// Update file metadata |
| 99 | +// /// </summary> |
| 100 | +// /// <param name="fileId">ID of the file</param> |
| 101 | +// /// <param name="metadata">New metadata for the file</param> |
| 102 | +// /// <returns></returns> |
| 103 | +// [Authorize] |
| 104 | +// [HttpPut("update-file-metadata/{fileId}")] |
| 105 | +// public async Task<OASISResult<bool>> UpdateFileMetadata(Guid fileId, [FromBody] Dictionary<string, object> metadata) |
| 106 | +// { |
| 107 | +// // Use FilesManager for business logic |
| 108 | +// return await FilesManager.Instance.UpdateFileMetadataAsync(Avatar.Id, fileId, metadata); |
| 109 | +// } |
| 110 | +// } |
| 111 | +//} |
0 commit comments