Add instanceId to config, section and resource

This commit is contained in:
Fransolet Thomas 2022-10-20 16:09:34 +02:00
parent 3b6c480cc6
commit 79be291113
5 changed files with 11 additions and 2 deletions

View File

@ -110,6 +110,7 @@ namespace ManagerService.Controllers
// Todo add some verification ? // Todo add some verification ?
Configuration configuration = new Configuration(); Configuration configuration = new Configuration();
configuration.InstanceId = newConfiguration.instanceId;
configuration.Label = newConfiguration.label; configuration.Label = newConfiguration.label;
configuration.Title = new List<TranslationDTO>(); configuration.Title = new List<TranslationDTO>();
configuration.ImageId = newConfiguration.imageId; configuration.ImageId = newConfiguration.imageId;
@ -168,6 +169,7 @@ namespace ManagerService.Controllers
throw new KeyNotFoundException("Configuration does not exist"); throw new KeyNotFoundException("Configuration does not exist");
// Todo add some verification ? // Todo add some verification ?
configuration.InstanceId = updatedConfiguration.instanceId;
configuration.Label = updatedConfiguration.label; configuration.Label = updatedConfiguration.label;
configuration.Title = updatedConfiguration.title; configuration.Title = updatedConfiguration.title;
configuration.ImageId = updatedConfiguration.imageId; configuration.ImageId = updatedConfiguration.imageId;

View File

@ -204,6 +204,7 @@ namespace ManagerService.Controllers
// Todo add some verification ? // Todo add some verification ?
Resource resource = new Resource(); Resource resource = new Resource();
resource.InstanceId = newResource.instanceId;
resource.Label = newResource.label; resource.Label = newResource.label;
resource.Type = newResource.type; resource.Type = newResource.type;
resource.DateCreation = DateTime.Now; resource.DateCreation = DateTime.Now;
@ -251,6 +252,7 @@ namespace ManagerService.Controllers
throw new KeyNotFoundException("Resource does not exist"); throw new KeyNotFoundException("Resource does not exist");
// Todo add some verification ? // Todo add some verification ?
resource.InstanceId = updatedResource.instanceId;
resource.Label = updatedResource.label; resource.Label = updatedResource.label;
resource.Type = updatedResource.type; resource.Type = updatedResource.type;
resource.Data = updatedResource.data; resource.Data = updatedResource.data;

View File

@ -233,6 +233,7 @@ namespace ManagerService.Controllers
// Todo add some verification ? // Todo add some verification ?
Section section = new Section(); Section section = new Section();
section.InstanceId = newSection.instanceId;
section.Label = newSection.label; section.Label = newSection.label;
section.ImageId = newSection.imageId; section.ImageId = newSection.imageId;
section.ImageSource = newSection.imageSource; section.ImageSource = newSection.imageSource;
@ -456,6 +457,7 @@ namespace ManagerService.Controllers
throw new KeyNotFoundException("Section does not exist"); throw new KeyNotFoundException("Section does not exist");
// Todo add some verification ? // Todo add some verification ?
section.InstanceId = updatedSection.instanceId;
section.Label = updatedSection.label; section.Label = updatedSection.label;
section.Title = updatedSection.title; section.Title = updatedSection.title;
section.Description = updatedSection.description; section.Description = updatedSection.description;

View File

@ -99,6 +99,9 @@ namespace ManagerService.Controllers
if (newUser == null) if (newUser == null)
throw new ArgumentNullException("User param is null"); throw new ArgumentNullException("User param is null");
if (newUser.InstanceId == null)
throw new ArgumentNullException("InstanceId is null");
newUser.Token = _tokenService.GenerateToken(newUser.Email).ToString(); newUser.Token = _tokenService.GenerateToken(newUser.Email).ToString();
newUser.DateCreation = DateTime.Now; newUser.DateCreation = DateTime.Now;

View File

@ -2,9 +2,9 @@
"ConnectionStrings": { "ConnectionStrings": {
//"TabletDb": "mongodb://admin:MioTech4ever!@localhost:27017" //DEV //"TabletDb": "mongodb://admin:MioTech4ever!@localhost:27017" //DEV
//"TabletDb": "mongodb://admin:MioTech4ever!@localhost:27017", //PROD - Thomas //"TabletDb": "mongodb://admin:MioTech4ever!@localhost:27017", //PROD - Thomas
"TabletDb": "mongodb://admin:MioTech4ever!@192.168.31.140:27017" //PROD - Thomas //"TabletDb": "mongodb://admin:MioTech4ever!@192.168.31.140:27017" //PROD - Thomas
//"TabletDb": "mongodb://admin:mdlf2021!@localhost:27017" //PROD MDLF //"TabletDb": "mongodb://admin:mdlf2021!@localhost:27017" //PROD MDLF
//"TabletDb": "mongodb://admin:MyMuseum2022!@51.77.222.154:27017" //PROD MyMuseum "TabletDb": "mongodb://admin:MyMuseum2022!@51.77.222.154:27017" //PROD MyMuseum
}, },
"Logging": { "Logging": {
"LogLevel": { "LogLevel": {