aboutsummaryrefslogtreecommitdiff
path: root/backend/api/api/Interfaces
diff options
context:
space:
mode:
authorDanijel Andjelkovic <adanijel99@gmail.com>2022-05-05 00:46:39 +0000
committerDanijel Andjelkovic <adanijel99@gmail.com>2022-05-05 00:46:39 +0000
commitc77c5289d01f1f02a57a060dc2166b449e597881 (patch)
treecb64f2775335cdd856e81ec9e8ba0bed93fa0985 /backend/api/api/Interfaces
parent6f48458e058d3e5a8d559adc22adbe78cba9a253 (diff)
parent15c60cb0c179d2d3c353ab3e19370e16d02176eb (diff)
Merge branch 'redesign' into 'master'
merge See merge request igrannonica/neuronstellar!29
Diffstat (limited to 'backend/api/api/Interfaces')
-rw-r--r--backend/api/api/Interfaces/IAuthService.cs12
-rw-r--r--backend/api/api/Interfaces/IDatasetService.cs23
-rw-r--r--backend/api/api/Interfaces/IExperimentService.cs16
-rw-r--r--backend/api/api/Interfaces/IFileService.cs13
-rw-r--r--backend/api/api/Interfaces/IJwtToken.cs13
-rw-r--r--backend/api/api/Interfaces/IMLWebSocketService.cs7
-rw-r--r--backend/api/api/Interfaces/IMlConnectionService.cs16
-rw-r--r--backend/api/api/Interfaces/IModelService.cs23
-rw-r--r--backend/api/api/Interfaces/IPredictorService.cs16
-rw-r--r--backend/api/api/Interfaces/IUserService.cs16
10 files changed, 155 insertions, 0 deletions
diff --git a/backend/api/api/Interfaces/IAuthService.cs b/backend/api/api/Interfaces/IAuthService.cs
new file mode 100644
index 00000000..570ce0a4
--- /dev/null
+++ b/backend/api/api/Interfaces/IAuthService.cs
@@ -0,0 +1,12 @@
+using api.Models.Users;
+
+namespace api.Services
+{
+ public interface IAuthService
+ {
+ string Login(AuthRequest user);
+ string Register(RegisterRequest user, string id);
+ string RenewToken(string token);
+ public string GuestToken();
+ }
+} \ No newline at end of file
diff --git a/backend/api/api/Interfaces/IDatasetService.cs b/backend/api/api/Interfaces/IDatasetService.cs
new file mode 100644
index 00000000..2f7d0010
--- /dev/null
+++ b/backend/api/api/Interfaces/IDatasetService.cs
@@ -0,0 +1,23 @@
+
+using api.Models;
+
+namespace api.Services
+{
+ public interface IDatasetService
+ {
+ Dataset GetOneDataset(string userId, string id);
+ Dataset GetOneDatasetN(string userId, string name);
+ Dataset GetOneDataset(string id);
+ List<Dataset> SearchDatasets(string name);
+ List<Dataset> GetMyDatasets(string userId);
+ List<Dataset> SortDatasets(string userId, bool ascdsc, int latest);
+ List<Dataset> GetPublicDatasets();
+ Dataset Create(Dataset dataset);
+ void Update(string userId, string id, Dataset dataset);
+ void Delete(string userId, string id);
+ public List<Dataset> GetGuestDatasets();
+ public void Update(Dataset dataset);
+ string GetDatasetId(string fileId);
+ //bool CheckDb();
+ }
+}
diff --git a/backend/api/api/Interfaces/IExperimentService.cs b/backend/api/api/Interfaces/IExperimentService.cs
new file mode 100644
index 00000000..7e59ace3
--- /dev/null
+++ b/backend/api/api/Interfaces/IExperimentService.cs
@@ -0,0 +1,16 @@
+using api.Models;
+
+namespace api.Services
+{
+ public interface IExperimentService
+ {
+ Experiment Create(Experiment experiment);
+ public Experiment Get(string id);
+ public List<Experiment> GetMyExperiments(string id);
+ public Experiment Get(string uploaderId, string name);
+ Experiment GetOneExperiment(string userId, string id);
+ Experiment Update(string userId, string id, Experiment experiment);
+ void Delete(string userId, string id);
+
+ }
+} \ No newline at end of file
diff --git a/backend/api/api/Interfaces/IFileService.cs b/backend/api/api/Interfaces/IFileService.cs
new file mode 100644
index 00000000..e061dfdb
--- /dev/null
+++ b/backend/api/api/Interfaces/IFileService.cs
@@ -0,0 +1,13 @@
+using api.Models;
+
+namespace api.Services
+{
+ public interface IFileService
+ {
+ FileModel Create(FileModel file);
+ string GetFilePath(string id, string uploaderId);
+ public FileModel getFile(string id);
+ bool CheckDb();
+ string GetFileId(string fullPath);
+ }
+} \ No newline at end of file
diff --git a/backend/api/api/Interfaces/IJwtToken.cs b/backend/api/api/Interfaces/IJwtToken.cs
new file mode 100644
index 00000000..5c54e4e3
--- /dev/null
+++ b/backend/api/api/Interfaces/IJwtToken.cs
@@ -0,0 +1,13 @@
+using api.Models.Users;
+
+namespace api.Models
+{
+ public interface IJwtToken
+ {
+ string GenGuestToken(string id);
+ string GenToken(User user);
+ string RenewToken(string existingToken);
+ string TokenToUsername(string token);
+ public string TokenToId(string token);
+ }
+} \ No newline at end of file
diff --git a/backend/api/api/Interfaces/IMLWebSocketService.cs b/backend/api/api/Interfaces/IMLWebSocketService.cs
new file mode 100644
index 00000000..52efb7fc
--- /dev/null
+++ b/backend/api/api/Interfaces/IMLWebSocketService.cs
@@ -0,0 +1,7 @@
+namespace api.Services
+{
+ public interface IMLWebSocketService
+ {
+ void Send(string message);
+ }
+}
diff --git a/backend/api/api/Interfaces/IMlConnectionService.cs b/backend/api/api/Interfaces/IMlConnectionService.cs
new file mode 100644
index 00000000..d5dda9f2
--- /dev/null
+++ b/backend/api/api/Interfaces/IMlConnectionService.cs
@@ -0,0 +1,16 @@
+
+using api.Models;
+
+namespace api.Services
+{
+ public interface IMlConnectionService
+ {
+ Task<string> SendModelAsync(object model, object dataset);
+ Task PreProcess(Dataset dataset, string filePath,string id);
+ Task TrainModel(Model model, Experiment experiment, string filePath, Dataset dataset, string id);
+
+ Task<string> Predict(Predictor predictor, Experiment experiment, PredictorColumns[] inputs);
+
+ //Task<Dataset> PreProcess(Dataset dataset, byte[] file, string filename);
+ }
+} \ No newline at end of file
diff --git a/backend/api/api/Interfaces/IModelService.cs b/backend/api/api/Interfaces/IModelService.cs
new file mode 100644
index 00000000..8c4543de
--- /dev/null
+++ b/backend/api/api/Interfaces/IModelService.cs
@@ -0,0 +1,23 @@
+using System;
+using api.Models;
+
+namespace api.Services
+{
+ public interface IModelService
+ {
+ Model GetOneModel(string userId, string name);
+ Model GetOneModel(string id);
+ List<Model> GetMyModels(string userId);
+ List<Model> GetMyModelsByType(string userId, string problemType);
+ List<Model> GetLatestModels(string userId);
+ List<Model> GetPublicModels();
+ Model Create(Model model);
+ Model Replace(Model model);
+ void Update(string userId, string name, Model model);
+ public void Update(string id, Model model);
+ void Delete(string userId, string name);
+ bool CheckHyperparameters(int inputNeurons, int hiddenLayerNeurons, int hiddenLayers, int outputNeurons);
+ bool CheckDb();
+ }
+}
+
diff --git a/backend/api/api/Interfaces/IPredictorService.cs b/backend/api/api/Interfaces/IPredictorService.cs
new file mode 100644
index 00000000..16f0432a
--- /dev/null
+++ b/backend/api/api/Interfaces/IPredictorService.cs
@@ -0,0 +1,16 @@
+using api.Models;
+
+namespace api.Services
+{
+ public interface IPredictorService
+ {
+ Predictor Create(Predictor predictor);
+ void Delete(string id, string userId);
+ List<Predictor> GetMyPredictors(string userId);
+ Predictor GetOnePredictor(string id);
+ Predictor GetPredictor(string userId, string id);
+ List<Predictor> GetPublicPredictors();
+ List<Predictor> SortPredictors(string userId, bool ascdsc, int latest);
+ void Update(string id, Predictor predictor);
+ }
+} \ No newline at end of file
diff --git a/backend/api/api/Interfaces/IUserService.cs b/backend/api/api/Interfaces/IUserService.cs
new file mode 100644
index 00000000..d34d410a
--- /dev/null
+++ b/backend/api/api/Interfaces/IUserService.cs
@@ -0,0 +1,16 @@
+using api.Models;
+using Microsoft.AspNetCore.Mvc;
+
+namespace api.Services
+{
+ public interface IUserService
+ {
+ List<User> Get();// daje sve korisnike
+ User GetUserUsername(string username); //daje korisnika po korisnickom imenu
+ User Create(User user); // kreira korisnika
+ bool Update(string username, User user); //apdejtuje korisnika po idu
+ void Delete(string username);//brise korisnika
+ public User GetUserByUsername(string username);//Uzima jednog korisnika po username-u
+ public User GetUserById(string id);//Uzima jednog korisnika po id-u
+ }
+}