AdminPanel/Netina.AdminPanel.PWA/Services/RestServices/ICrudApiRest.cs

52 lines
1.6 KiB
C#
Raw Normal View History

2024-04-17 16:19:43 +03:30
namespace Netina.AdminPanel.PWA.Services.RestServices;
public interface ICrudApiRest<T, TKey> where T : class
{
[Post("")]
Task<TKey> Create<TCreateCommand>([Body] TCreateCommand payload, [Header("Authorization")] string authorization);
[Get("")]
Task<List<T>> ReadAll([Query] int page,[Header("Authorization")] string authorization);
[Get("/{key}")]
Task<T> ReadOne(TKey key, [Header("Authorization")] string authorization);
[Get("/{key}")]
Task<T> ReadOne(TKey key);
[Put("")]
Task Update<TUpdateCommand>([Body] TUpdateCommand payload, [Header("Authorization")] string authorization);
[Delete("/{key}")]
Task Delete(TKey key, [Header("Authorization")] string authorization);
}
public interface ICrudDtoApiRest<T, TDto, in TKey> where T : class where TDto : class
{
[Post("")]
Refactor and enhance product and order handling - Updated `DiscountActionDialogBoxViewModel` and `FastProductCreateDialogBoxViewModel` to create command objects directly from properties and improved error handling. - Added meta tag management UI and logic in `ProductActionDialogBox.razor` and `ProductActionDialogBoxViewModel`. - Increased max file read stream size to 8 MB in `StorageDialogBoxViewModel`. - Incremented `AssemblyVersion` and `FileVersion` to `1.7.20.34` in `Netina.AdminPanel.PWA.csproj`. - Updated `BrandsPage.razor` and `BrandsPageViewModel` for pagination and service injection. - Updated `CategoriesPageViewModel` to create command objects directly from properties. - Updated `ProductsPage.razor` for service injection and added a button for product details. - Updated `ICrudApiRest` and `ICrudDtoApiRest` interfaces to use generic `Create` methods. - Updated `appsettings.Development.json` for `StorageBaseUrl` and commented out `IsShop`. - Added new project `AppHost.csproj` targeting .NET 8.0 with Aspire hosting. - Added new `appsettings.Development.json` and `appsettings.json` for logging. - Added new `Program.cs` to create and run a distributed application. - Added new `launchSettings.json` for application launch settings. - Added `Extensions.cs` for common .NET Aspire services. - Added new project `ServiceDefaults.csproj` for shared service defaults. - Introduced `ProductMetaTag` class and related migration for meta tag handling. - Updated `OrderController.cs` for additional authorization requirements. - Updated target frameworks to `net8.0` in various projects. - Enhanced `SiteMapService.cs` to include brand site maps. - Added new properties to DTOs for customer and meta tag handling. - Enhanced `Product` class with meta tag management methods. - Refactored `OrderMapper.g.cs` and `ProductMapper.g.cs` for improved mapping logic. - Enhanced command handlers to manage meta tags. - Added `ICurrentUserService` for user permissions in query handlers. - Refactored `StorageService.cs` for paginated storage file fetching.
2024-12-06 17:37:40 +03:30
Task Create<TCreateCommand>([Body] TCreateCommand payload, [Header("Authorization")] string authorization);
[Post("")]
Task Create([Body] TDto payload, [Header("Authorization")] string authorization);
[Get("")]
Task<List<TDto>> ReadAll([Query]int page);
[Get("")]
Task<List<TDto>> ReadAll([Query] int page, [Header("Authorization")] string authorization);
[Get("")]
Task<List<TDto>> ReadAll();
[Get("/{key}")]
Task<TDto> ReadOne(TKey key);
[Put("")]
Task Update([Body] T payload, [Header("Authorization")] string authorization);
[Put("")]
Task Update([Body] TDto payload, [Header("Authorization")] string authorization);
[Delete("/{key}")]
Task Delete(TKey key, [Header("Authorization")] string authorization);
}