mirror of
https://github.com/azaion/admin.git
synced 2026-04-22 10:56:34 +00:00
structure app by rest api standards
add getusers tidy up BusinessException
This commit is contained in:
@@ -28,7 +28,7 @@ public class ResourcesService(IOptions<ResourcesConfig> resourcesConfig) : IReso
|
||||
public async Task SaveResource(ResourceEnum resourceEnum, IFormFile data, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (data == null)
|
||||
throw new BusinessException(ExceptionEnum.NoFile, "No file provided!");
|
||||
throw new BusinessException(ExceptionEnum.NoFileProvided);
|
||||
if (!Directory.Exists(resourcesConfig.Value.ResourcesFolder))
|
||||
Directory.CreateDirectory(resourcesConfig.Value.ResourcesFolder);
|
||||
|
||||
@@ -40,7 +40,7 @@ public class ResourcesService(IOptions<ResourcesConfig> resourcesConfig) : IReso
|
||||
{
|
||||
var resource = resourcesConfig.Value.Resources.GetValueOrDefault(resourceEnum.ToString());
|
||||
if (resource == null)
|
||||
throw new BusinessException(ExceptionEnum.WrongResourceType, "Wrong resource type!");
|
||||
throw new BusinessException(ExceptionEnum.WrongResourceType);
|
||||
return Path.Combine(resourcesConfig.Value.ResourcesFolder, resource);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user