diff --git a/Backend/Controllers/BuildInfoController.cs b/Backend/Controllers/BuildInfoController.cs index f0786fa..0234f57 100644 --- a/Backend/Controllers/BuildInfoController.cs +++ b/Backend/Controllers/BuildInfoController.cs @@ -20,8 +20,6 @@ namespace Backend.Controllers private readonly IBackendRepository backendRepository; private string mapFileSaveAsPath = ""; private string buildMapFileSaveAsPath = ""; - private string tempMapFileSaveAsPath = ""; - private string tempBuildMapFileSaveAsPath = ""; public BuildInfoController(IBackendRepository backendRepository) { @@ -29,8 +27,6 @@ namespace Backend.Controllers mapFileSaveAsPath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "upload", "floor_map"); buildMapFileSaveAsPath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "upload", "build_map"); - tempMapFileSaveAsPath = Path.Combine("wwwroot", "upload", "floor_map"); - tempBuildMapFileSaveAsPath = Path.Combine("wwwroot", "upload", "build_map"); } public IActionResult Index() @@ -180,9 +176,9 @@ namespace Backend.Controllers post.Map3dFile.CopyTo(stream); } - var frontendPath = await backendRepository.GetOneAsync("select system_value from variable where system_type = 'directory' and system_key = 'frontend'"); + var frontendPath = await backendRepository.GetOneAsync("select system_value from variable where system_type = 'directory_build_map' and system_key = 'frontend'"); - fullPath = Path.Combine(Path.GetDirectoryName(Directory.GetCurrentDirectory()), frontendPath, tempBuildMapFileSaveAsPath); + fullPath = frontendPath; if (!System.IO.Directory.Exists(fullPath)) System.IO.Directory.CreateDirectory(fullPath); @@ -306,9 +302,9 @@ namespace Backend.Controllers post.Map3dFile.CopyTo(stream); } - var frontendPath = await backendRepository.GetOneAsync("select system_value from variable where system_type = 'directory' and system_key = 'frontend'"); + var frontendPath = await backendRepository.GetOneAsync("select system_value from variable where system_type = 'directory_build_map' and system_key = 'frontend'"); - fullPath = Path.Combine(Path.GetDirectoryName(Directory.GetCurrentDirectory()), frontendPath, tempBuildMapFileSaveAsPath); + fullPath = frontendPath; if (!System.IO.Directory.Exists(fullPath)) System.IO.Directory.CreateDirectory(fullPath); @@ -571,17 +567,17 @@ namespace Backend.Controllers var fullPath = Path.Combine(mapFileSaveAsPath, fileName); - if (!System.IO.Directory.Exists(buildMapFileSaveAsPath)) - System.IO.Directory.CreateDirectory(buildMapFileSaveAsPath); + if (!System.IO.Directory.Exists(mapFileSaveAsPath)) + System.IO.Directory.CreateDirectory(mapFileSaveAsPath); using (var stream = new FileStream(fullPath, FileMode.Create)) { post.MapFile.CopyTo(stream); } - var frontendPath = await backendRepository.GetOneAsync("select system_value from variable where system_type = 'directory' and system_key = 'frontend'"); + var frontendPath = await backendRepository.GetOneAsync("select system_value from variable where system_type = 'directory_floor_map' and system_key = 'frontend'"); - fullPath = Path.Combine(Path.GetDirectoryName(Directory.GetCurrentDirectory()), frontendPath, tempMapFileSaveAsPath); + fullPath = frontendPath; if (!System.IO.Directory.Exists(fullPath)) System.IO.Directory.CreateDirectory(fullPath); @@ -626,17 +622,17 @@ namespace Backend.Controllers var fullPath = Path.Combine(mapFileSaveAsPath, fileName); - if (!System.IO.Directory.Exists(buildMapFileSaveAsPath)) - System.IO.Directory.CreateDirectory(buildMapFileSaveAsPath); + if (!System.IO.Directory.Exists(mapFileSaveAsPath)) + System.IO.Directory.CreateDirectory(mapFileSaveAsPath); using (var stream = new FileStream(fullPath, FileMode.Create)) { post.MapFile.CopyTo(stream); } - var frontendPath = await backendRepository.GetOneAsync("select system_value from variable where system_type = 'directory' and system_key = 'frontend'"); + var frontendPath = await backendRepository.GetOneAsync("select system_value from variable where system_type = 'directory_floor_map' and system_key = 'frontend'"); + fullPath = frontendPath; - fullPath = Path.Combine(Path.GetDirectoryName(Directory.GetCurrentDirectory()), frontendPath, tempMapFileSaveAsPath); if (!System.IO.Directory.Exists(fullPath)) System.IO.Directory.CreateDirectory(fullPath); diff --git a/Backend/Controllers/DeviceManageController.cs b/Backend/Controllers/DeviceManageController.cs index f660ee5..b96ea21 100644 --- a/Backend/Controllers/DeviceManageController.cs +++ b/Backend/Controllers/DeviceManageController.cs @@ -17,7 +17,6 @@ namespace Backend.Controllers private readonly IDeviceManageRepository deviceManageRepository; private string deviceKindFileSaveAsPath = ""; private string deviceKindFilePath = "upload/device_icon/"; - private string tempDeviceKindFileSaveAsPath = ""; public DeviceManageController(IBackendRepository backendRepository, IDeviceManageRepository deviceManageRepository) @@ -26,7 +25,6 @@ namespace Backend.Controllers this.deviceManageRepository = deviceManageRepository; deviceKindFileSaveAsPath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "upload", "device_icon"); - tempDeviceKindFileSaveAsPath = Path.Combine("wwwroot", "upload", "device_icon"); } public IActionResult Index() @@ -1214,9 +1212,9 @@ namespace Backend.Controllers post.Device_image_file.CopyTo(stream); } - var frontendPath = await backendRepository.GetOneAsync("select system_value from variable where system_type = 'directory' and system_key = 'frontend'"); + var frontendPath = await backendRepository.GetOneAsync("select system_value from variable where system_type = 'directory_device_icon' and system_key = 'frontend'"); - fullPath = Path.Combine(Path.GetDirectoryName(Directory.GetCurrentDirectory()), frontendPath, tempDeviceKindFileSaveAsPath); + fullPath = frontendPath; if (!System.IO.Directory.Exists(fullPath)) System.IO.Directory.CreateDirectory(fullPath); @@ -1326,9 +1324,9 @@ namespace Backend.Controllers post.Device_image_file.CopyTo(stream); } - var frontendPath = await backendRepository.GetOneAsync("select system_value from variable where system_type = 'directory' and system_key = 'frontend'"); + var frontendPath = await backendRepository.GetOneAsync("select system_value from variable where system_type = 'directory_device_icon' and system_key = 'frontend'"); - fullPath = Path.Combine(Path.GetDirectoryName(Directory.GetCurrentDirectory()), frontendPath, tempDeviceKindFileSaveAsPath); + fullPath = frontendPath; if (!System.IO.Directory.Exists(fullPath)) System.IO.Directory.CreateDirectory(fullPath); @@ -1591,9 +1589,9 @@ namespace Backend.Controllers post.Device_master_icon_file.CopyTo(stream); } - var frontendPath = await backendRepository.GetOneAsync("select system_value from variable where system_type = 'directory' and system_key = 'frontend'"); + var frontendPath = await backendRepository.GetOneAsync("select system_value from variable where system_type = 'directory_device_master' and system_key = 'frontend'"); - fullPath = Path.Combine(Path.GetDirectoryName(Directory.GetCurrentDirectory()), frontendPath, tempDeviceKindFileSaveAsPath); + fullPath = frontendPath; if (!System.IO.Directory.Exists(fullPath)) System.IO.Directory.CreateDirectory(fullPath); @@ -1668,9 +1666,9 @@ namespace Backend.Controllers post.Device_master_icon_file.CopyTo(stream); } - var frontendPath = await backendRepository.GetOneAsync("select system_value from variable where system_type = 'directory' and system_key = 'frontend'"); + var frontendPath = await backendRepository.GetOneAsync("select system_value from variable where system_type = 'directory_device_master' and system_key = 'frontend'"); - fullPath = Path.Combine(Path.GetDirectoryName(Directory.GetCurrentDirectory()), frontendPath, tempDeviceKindFileSaveAsPath); + fullPath = frontendPath; if (!System.IO.Directory.Exists(fullPath)) System.IO.Directory.CreateDirectory(fullPath); diff --git a/Backend/wwwroot/upload/floor_map/54ca9e34-9dca-410a-a8fb-69d2b026faf7.svg b/Backend/wwwroot/upload/floor_map/54ca9e34-9dca-410a-a8fb-69d2b026faf7.svg new file mode 100644 index 0000000..e69de29