From b635c3bc3b41e9e1083886574171d0bd1a0a1b8f Mon Sep 17 00:00:00 2001 From: Maksym Sadovnychyy Date: Sun, 21 Aug 2022 01:50:33 +0200 Subject: [PATCH] (feat): blog items dataprovider and controllers --- db/DML/blogcatalog.json | 1081 +++++++++++++++++ db/DML/categories.json | 13 + db/DML/shopcart.json | 75 +- db/DML/shopcatalog.json | 369 +++--- postman/reactredux.postman_collection.json | 323 ++++- .../Abstractions/DomainObjects/Category.cs | 13 - .../Abstractions/DomainObjects/PageBase.cs | 1 - .../DomainObjects/PostItemBase.cs | 17 +- .../Abstractions/Models/RequestModelBase.cs | 2 +- webapi/Core/DomainObjects/Category.cs | 13 - .../Core/DomainObjects/Documents/BlogItem.cs | 18 +- .../Core/DomainObjects/Documents/Category.cs | 18 + .../DomainObjects/Documents/ShopCartItem.cs | 21 +- .../Core/DomainObjects/Documents/ShopItem.cs | 17 +- webapi/Core/DomainObjects/Documents/User.cs | 3 + webapi/Core/DomainObjects/Image.cs | 9 +- .../Core/DomainObjects/L10n/CategoryL10n.cs | 24 + webapi/Core/DomainObjects/L10n/ImageL10n.cs | 21 + .../Core/DomainObjects/L10n/PostItemL10n.cs | 31 + .../DomainObjects/Pages/BlogCatalogPage.cs | 1 - .../Core/DomainObjects/Pages/BlogItemPage.cs | 2 - webapi/Core/DomainObjects/Pages/HomePage.cs | 2 - .../Core/DomainObjects/Pages/ShopCartPage.cs | 2 - .../DomainObjects/Pages/ShopCatalogPage.cs | 3 - webapi/Core/Enumerations/ContentTypes.cs | 11 + webapi/Core/Enumerations/Locales.cs | 17 + .../DataProviders/BlogCatalogDataProvider.cs | 59 + webapi/DataProviders/BlogDataProvider.cs | 14 - webapi/DataProviders/CategoryDataProvider.cs | 40 + .../Extensions/ServiceCollectionExtensions.cs | 3 +- webapi/DataProviders/Mappings.cs | 73 +- .../DataProviders/ShopCatalogDataProvider.cs | 4 + .../Controllers/BlogCatalogController.cs | 103 -- .../Controllers/BlogCategoriesController.cs | 34 +- .../Controllers/BlogItemsController.cs | 57 + .../Controllers/ShopCartItemController.cs | 8 +- .../Controllers/ShopCartItemsController.cs | 8 +- .../Controllers/ShopCategoriesController.cs | 36 +- .../Controllers/ShopItemController.cs | 45 +- .../Controllers/ShopItemsController.cs | 19 +- .../Models/Abstractions/PersonModelBase.cs | 6 +- .../Abstractions/PostItemRequestModelBase.cs | 20 +- .../Abstractions/PostItemResponseModelBase.cs | 45 +- .../WeatherForecast/Models/BlogItemModel.cs | 9 +- .../WeatherForecast/Models/CategoryModel.cs | 16 +- webapi/WeatherForecast/Models/ImageModel.cs | 9 +- .../Models/L10n/PostItemL10nModel.cs | 37 + .../Models/PageSections/TitleSectionModel.cs | 4 +- .../Requests/PostShopCartItemRequestModel.cs | 25 +- .../Requests/PostShopItemRequestModel.cs | 32 +- .../Requests/PutShopCartItemRequestModel.cs | 21 +- .../Requests/PutShopItemRequestModel.cs | 31 +- .../Responses/GetBlogCatalogResponseModel.cs | 13 - .../Responses/GetBlogItemResponseModel.cs | 20 + .../Responses/GetBlogItemsResponseModel.cs | 18 + .../Responses/GetShopCartItemResponseModel.cs | 32 +- .../Responses/GetShopItemResponseModel.cs | 13 +- .../Services/BlogItemsService.cs | 56 + .../Services/ShopCartItemService.cs | 21 +- .../Services/ShopCartItemsService.cs | 34 +- .../Services/ShopItemService.cs | 50 +- .../Services/ShopItemsService.cs | 40 +- webapi/WeatherForecast/Startup.cs | 3 +- 63 files changed, 2522 insertions(+), 643 deletions(-) create mode 100644 db/DML/blogcatalog.json create mode 100644 db/DML/categories.json delete mode 100644 webapi/Core/Abstractions/DomainObjects/Category.cs delete mode 100644 webapi/Core/DomainObjects/Category.cs create mode 100644 webapi/Core/DomainObjects/Documents/Category.cs create mode 100644 webapi/Core/DomainObjects/L10n/CategoryL10n.cs create mode 100644 webapi/Core/DomainObjects/L10n/ImageL10n.cs create mode 100644 webapi/Core/DomainObjects/L10n/PostItemL10n.cs create mode 100644 webapi/Core/Enumerations/ContentTypes.cs create mode 100644 webapi/Core/Enumerations/Locales.cs create mode 100644 webapi/DataProviders/BlogCatalogDataProvider.cs delete mode 100644 webapi/DataProviders/BlogDataProvider.cs create mode 100644 webapi/DataProviders/CategoryDataProvider.cs delete mode 100644 webapi/WeatherForecast/Controllers/BlogCatalogController.cs create mode 100644 webapi/WeatherForecast/Controllers/BlogItemsController.cs create mode 100644 webapi/WeatherForecast/Models/L10n/PostItemL10nModel.cs delete mode 100644 webapi/WeatherForecast/Models/Responses/GetBlogCatalogResponseModel.cs create mode 100644 webapi/WeatherForecast/Models/Responses/GetBlogItemResponseModel.cs create mode 100644 webapi/WeatherForecast/Models/Responses/GetBlogItemsResponseModel.cs create mode 100644 webapi/WeatherForecast/Services/BlogItemsService.cs diff --git a/db/DML/blogcatalog.json b/db/DML/blogcatalog.json new file mode 100644 index 0000000..63864d2 --- /dev/null +++ b/db/DML/blogcatalog.json @@ -0,0 +1,1081 @@ +[ + { + "_id": "11f2f5f8-1270-4640-b082-c2e7ea8e60b4", + "siteId": "404c8232-9048-4519-bfba-6e78dc7005ca", + "l10n": [ + { + "locale": 0, + "slug": "privacy-terms-and-conditions", + "description": "Privacy Terms and Conditions", + "title": "Privacy Terms and Conditions", + "shortText": "", + "text": "

MAKS-IT<\/strong> considers user's privacy in a serious way and we take responsibility to respect it.<\/p>\r\n\r\n

This Privacy Policy describes the activities of the processing of personal data carried out by MAKS-IT<\/strong> on the website https:\/\/wwww.maks-it.com<\/strong> and related responsibility carried out by the Company.<\/p>\r\n\r\n

MAKS-IT<\/strong> may process personal data when user visits the website and uses its services and features. In website sections where the user's personal data are collected, a specific information is normally published according to the art. 13\/15 of Reg. UE 2016\/679. Where required by Reg. UE 2016\/679 user's agreement will be requested before proceeding the processing of personal data.\r\n\r\nIn case of providing personal data of third parties, the user must ensure that data communication to MAKS-IT<\/strong> and subsequent processing for the purposes specified in the applicable Privacy Policy complies with Reg. UE 2016\/679 and all applicable legislation.<\/p>\r\n\r\n\r\n\r\n

\r\n\r\n\t