diff --git a/src/VirtoCommerce.GDPR.Data/Repositories/GDPRModuleDbContext.cs b/src/VirtoCommerce.GDPR.Data/Repositories/GDPRModuleDbContext.cs new file mode 100644 index 0000000..a43970a --- /dev/null +++ b/src/VirtoCommerce.GDPR.Data/Repositories/GDPRModuleDbContext.cs @@ -0,0 +1,25 @@ +using EntityFrameworkCore.Triggers; +using Microsoft.EntityFrameworkCore; + +namespace VirtoCommerce.GDPR.Data.Repositories +{ + public class GDPRModuleDbContext : DbContextWithTriggers + { + public GDPRModuleDbContext(DbContextOptions options) + : base(options) + { + } + + protected GDPRModuleDbContext(DbContextOptions options) + : base(options) + { + } + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + // modelBuilder.Entity().ToTable("MyModule").HasKey(x => x.Id); + // modelBuilder.Entity().Property(x => x.Id).HasMaxLength(128); + // base.OnModelCreating(modelBuilder); + } + } +} + diff --git a/src/VirtoCommerce.GDPR.Web/Controllers/Api/GDPRModuleController.cs b/src/VirtoCommerce.GDPR.Web/Controllers/Api/GDPRModuleController.cs new file mode 100644 index 0000000..a1c7345 --- /dev/null +++ b/src/VirtoCommerce.GDPR.Web/Controllers/Api/GDPRModuleController.cs @@ -0,0 +1,24 @@ +using VirtoCommerce.GDPR.Core; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; + + +namespace VirtoCommerce.GDPR.Web.Controllers.Api +{ + [Route("api/GDPRModule")] + public class GDPRModuleController : Controller + { + // GET: api/VirtoCommerce.GDPR + /// + /// Get message + /// + /// Return "Hello world!" message + [HttpGet] + [Route("")] + [Authorize(ModuleConstants.Security.Permissions.Read)] + public ActionResult Get() + { + return Ok(new { result = "Hello world!" }); + } + } +} diff --git a/src/VirtoCommerce.GDPR.Web/Scripts/blades/hello-world.html b/src/VirtoCommerce.GDPR.Web/Scripts/blades/hello-world.html new file mode 100644 index 0000000..e8a8175 --- /dev/null +++ b/src/VirtoCommerce.GDPR.Web/Scripts/blades/hello-world.html @@ -0,0 +1,7 @@ +
+
+
+
{{blade.data}}
+
+
+
\ No newline at end of file diff --git a/src/VirtoCommerce.GDPR.Web/Scripts/blades/hello-world.js b/src/VirtoCommerce.GDPR.Web/Scripts/blades/hello-world.js new file mode 100644 index 0000000..f8adbb5 --- /dev/null +++ b/src/VirtoCommerce.GDPR.Web/Scripts/blades/hello-world.js @@ -0,0 +1,15 @@ +angular.module('GDPRModule') + .controller('GDPRModule.helloWorldController', ['$scope', 'GDPRModule.webApi', function ($scope, api) { + var blade = $scope.blade; + blade.title = 'GDPRModule'; + + blade.refresh = function () { + api.get(function (data) { + blade.title = 'GDPRModule.blades.hello-world.title'; + blade.data = data.result; + blade.isLoading = false; + }); + }; + + blade.refresh(); + }]);