-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactored Image uploading process * Refactored image uploading process * Added updating workshop Images * Created WorkshopImagesService, added ErrorDescriber for determing errors * Created ImageResultsHelper for controllers results * Added checking workshop images' limits before uploading. Improved xml docs. * Changed amount validation for images * Deleted unnecessary method * Deleted image options from development settings, changed describer lifetime * Added types for workshops' creation/updating responses * Changed resources logic * Changed code while creating operation error * Changed limits of images' amount * Optimized images responses * Changed creating operation errors * Fixed types * Added xml docs for changed logic for resources
- Loading branch information
provicevko
authored
Jan 11, 2022
1 parent
b111033
commit 0d383dc
Showing
53 changed files
with
1,276 additions
and
450 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 0 additions & 12 deletions
12
OutOfSchool/OutOfSchool.DataAccess/Repository/IImageRepository.cs
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
OutOfSchool/OutOfSchool.DataAccess/Repository/ImageRepository.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 0 additions & 23 deletions
23
OutOfSchool/OutOfSchool.WebApi/Common/Resources/Codes/ImageResourceCodes.cs
This file was deleted.
Oops, something went wrong.
86 changes: 86 additions & 0 deletions
86
OutOfSchool/OutOfSchool.WebApi/Common/Resources/Codes/ImagesOperationErrorCode.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
namespace OutOfSchool.WebApi.Common.Resources.Codes | ||
{ | ||
/// <summary> | ||
/// Contains error codes of all operations with images. | ||
/// </summary> | ||
public enum ImagesOperationErrorCode | ||
{ | ||
/// <summary> | ||
/// The default error. | ||
/// </summary> | ||
[ResourcesKey(nameof(DefaultError))] | ||
DefaultError = 0, | ||
|
||
/// <summary> | ||
/// The error that can be used when something wrong has happened while uploading images. | ||
/// </summary> | ||
[ResourcesKey(nameof(UploadingError))] | ||
UploadingError = 1, | ||
|
||
/// <summary> | ||
/// The error that can be used when something wrong has happened while removing images. | ||
/// </summary> | ||
[ResourcesKey(nameof(RemovingError))] | ||
RemovingError = 2, | ||
|
||
/// <summary> | ||
/// The error that can be used when unable to make some operation because of an image storage. | ||
/// </summary> | ||
[ResourcesKey(nameof(ImageStorageError))] | ||
ImageStorageError = 3, | ||
|
||
/// <summary> | ||
/// The error that can be used when some image has not found. | ||
/// </summary> | ||
[ResourcesKey(nameof(ImageNotFoundError))] | ||
ImageNotFoundError = 4, | ||
|
||
/// <summary> | ||
/// The error that can be used when some image hasn't passed the validation process because of unexpected factors. | ||
/// </summary> | ||
[ResourcesKey(nameof(UnexpectedValidationError))] | ||
UnexpectedValidationError = 5, | ||
|
||
/// <summary> | ||
/// The error that can be used when some image hasn't passed the validation process because of the invalid image size. | ||
/// </summary> | ||
[ResourcesKey(nameof(InvalidSizeError))] | ||
InvalidSizeError = 6, | ||
|
||
/// <summary> | ||
/// The error that can be used when some image hasn't passed the validation process because of the invalid image format. | ||
/// </summary> | ||
[ResourcesKey(nameof(InvalidFormatError))] | ||
InvalidFormatError = 7, | ||
|
||
/// <summary> | ||
/// The error that can be used when some image hasn't passed the validation process because of the invalid image resolution. | ||
/// </summary> | ||
[ResourcesKey(nameof(InvalidResolutionError))] | ||
InvalidResolutionError = 8, | ||
|
||
/// <summary> | ||
/// The error that can be used when cannot find the entity for operations with images. | ||
/// </summary> | ||
[ResourcesKey(nameof(EntityNotFoundError))] | ||
EntityNotFoundError = 9, | ||
|
||
/// <summary> | ||
/// The error that can be used when no images were given for making operations. | ||
/// </summary> | ||
[ResourcesKey(nameof(NoGivenImagesError))] | ||
NoGivenImagesError = 10, | ||
|
||
/// <summary> | ||
/// The error that can be used when something wrong has happened while updating the entity with changed images. | ||
/// </summary> | ||
[ResourcesKey(nameof(UpdateEntityError))] | ||
UpdateEntityError = 11, | ||
|
||
/// <summary> | ||
/// The error that can be used when count of images is more than allowed for this type of entity. | ||
/// </summary> | ||
[ResourcesKey(nameof(ExceedingCountOfImagesError))] | ||
ExceedingCountOfImagesError = 12, | ||
} | ||
} |
41 changes: 0 additions & 41 deletions
41
OutOfSchool/OutOfSchool.WebApi/Common/Resources/References/ImageResource.cs
This file was deleted.
Oops, something went wrong.
35 changes: 0 additions & 35 deletions
35
OutOfSchool/OutOfSchool.WebApi/Common/Resources/References/Resource.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
OutOfSchool/OutOfSchool.WebApi/Common/Resources/ResourceNames.cs
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
OutOfSchool/OutOfSchool.WebApi/Common/Resources/Resources.cs
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
OutOfSchool/OutOfSchool.WebApi/Common/Resources/ResourcesKeyAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System; | ||
|
||
namespace OutOfSchool.WebApi.Common.Resources | ||
{ | ||
[AttributeUsage(AttributeTargets.Field)] | ||
public class ResourcesKeyAttribute : Attribute | ||
{ | ||
public ResourcesKeyAttribute(string appResourcesKey) => ResourcesKey = appResourcesKey; | ||
|
||
public string ResourcesKey { get; set; } | ||
} | ||
} |
Oops, something went wrong.