diff options
author | Danijel Andjelkovic <adanijel99@gmail.com> | 2022-03-27 05:13:29 +0200 |
---|---|---|
committer | Danijel Andjelkovic <adanijel99@gmail.com> | 2022-03-27 05:13:29 +0200 |
commit | cab50e2c5272c1599e3b3e30522985b912a19ab7 (patch) | |
tree | d28ffc8f1e385a1427f004691b74960c6444ecf1 /backend | |
parent | 982a04c28dcb401fa722cb48976379a1cf6298d8 (diff) | |
parent | a315d3c0bc44c091d7c85697c9c8135b314ebc06 (diff) |
Merge branch 'dev' of http://gitlab.pmf.kg.ac.rs/igrannonica/neuronstellar into dev
# Conflicts:
# frontend/src/app/app.module.ts
Diffstat (limited to 'backend')
-rw-r--r-- | backend/api/api/Controllers/ModelController.cs | 1 | ||||
-rw-r--r-- | backend/api/api/Models/Dataset.cs | 1 | ||||
-rw-r--r-- | backend/api/api/Services/FileService.cs | 8 |
3 files changed, 9 insertions, 1 deletions
diff --git a/backend/api/api/Controllers/ModelController.cs b/backend/api/api/Controllers/ModelController.cs index b4a4b4f2..b997efa3 100644 --- a/backend/api/api/Controllers/ModelController.cs +++ b/backend/api/api/Controllers/ModelController.cs @@ -126,6 +126,7 @@ namespace api.Controllers public ActionResult<Model> Post([FromBody] Model model) { //username="" ako je GUEST + model.inputNeurons = model.inputColumns.Length; if (_modelService.CheckHyperparameters(model.inputNeurons, model.hiddenLayerNeurons, model.hiddenLayers, model.outputNeurons) == false) return BadRequest("Bad parameters!"); diff --git a/backend/api/api/Models/Dataset.cs b/backend/api/api/Models/Dataset.cs index 67ef8cfe..dcfde3b1 100644 --- a/backend/api/api/Models/Dataset.cs +++ b/backend/api/api/Models/Dataset.cs @@ -21,6 +21,7 @@ namespace api.Models public DateTime dateCreated { get; set; } public DateTime lastUpdated { get; set; } public string delimiter { get; set; } + public bool hasHeader { get; set; } } } diff --git a/backend/api/api/Services/FileService.cs b/backend/api/api/Services/FileService.cs index b02d0da4..c5759953 100644 --- a/backend/api/api/Services/FileService.cs +++ b/backend/api/api/Services/FileService.cs @@ -8,11 +8,13 @@ namespace api.Services { private readonly IMongoCollection<FileModel> _file; + private readonly IMongoCollection<Dataset> _dataset; public FileService(IUserStoreDatabaseSettings settings, IMongoClient mongoClient) { var database = mongoClient.GetDatabase(settings.DatabaseName); _file = database.GetCollection<FileModel>(settings.FilesCollectionName); + _dataset = database.GetCollection<Dataset>(settings.DatasetCollectionName); } public FileModel Create(FileModel file) @@ -25,7 +27,11 @@ namespace api.Services } public string GetFilePath(string id, string username) { - FileModel file = _file.Find(x => x._id == id && x.username == username).FirstOrDefault(); + FileModel file; + if (_dataset.Find(x=>x.fileId==id && x.isPublic==true).FirstOrDefault()!=null) + file = _file.Find(x => x._id == id).FirstOrDefault(); + else + file = _file.Find(x => x._id == id && x.username == username).FirstOrDefault(); if (file == null) return null; return file.path; |