diff options
author | Ognjen Cirkovic <ciraboxkg@gmail.com> | 2022-05-04 20:29:40 +0200 |
---|---|---|
committer | Ognjen Cirkovic <ciraboxkg@gmail.com> | 2022-05-04 20:29:40 +0200 |
commit | 2c852c832bf310feeb6045380a533bb4f832ccfd (patch) | |
tree | 6fa81c0c45a4e0e2550e10371050c07b32a74dd0 /backend/api/api/Interfaces | |
parent | 45c519d53fee1124c2882c7b353cd930fd311f9e (diff) | |
parent | 3ac7a37690765d6c116463dc8a6ef08b18afea50 (diff) |
Mergovana grana sa granom redesign. Sredjeni konflikti.
Diffstat (limited to 'backend/api/api/Interfaces')
-rw-r--r-- | backend/api/api/Interfaces/IAuthService.cs | 12 | ||||
-rw-r--r-- | backend/api/api/Interfaces/IDatasetService.cs | 22 | ||||
-rw-r--r-- | backend/api/api/Interfaces/IExperimentService.cs | 15 | ||||
-rw-r--r-- | backend/api/api/Interfaces/IFileService.cs | 13 | ||||
-rw-r--r-- | backend/api/api/Interfaces/IJwtToken.cs | 13 | ||||
-rw-r--r-- | backend/api/api/Interfaces/IMLWebSocketService.cs | 7 | ||||
-rw-r--r-- | backend/api/api/Interfaces/IMlConnectionService.cs | 16 | ||||
-rw-r--r-- | backend/api/api/Interfaces/IModelService.cs | 23 | ||||
-rw-r--r-- | backend/api/api/Interfaces/IPredictorService.cs | 16 | ||||
-rw-r--r-- | backend/api/api/Interfaces/IUserService.cs | 16 |
10 files changed, 153 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..9a109208 --- /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 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..f493a2ec --- /dev/null +++ b/backend/api/api/Interfaces/IDatasetService.cs @@ -0,0 +1,22 @@ + +using api.Models; + +namespace api.Services +{ + public interface IDatasetService + { + Dataset GetOneDataset(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..2a69cff9 --- /dev/null +++ b/backend/api/api/Interfaces/IExperimentService.cs @@ -0,0 +1,15 @@ +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 name); + void Update(string userId, string id, Experiment experiment); + + } +}
\ 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..00299979 --- /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 + } +} |