netcore-blueprint 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BlueprintTemplate/Host.API/Extensions/ApplicationBuilderExtensions.cs +26 -0
- package/BlueprintTemplate/Host.API/Extensions/DatabaseExtensions.cs +37 -0
- package/BlueprintTemplate/Host.API/Extensions/ServiceCollectionExtensions.cs +54 -0
- package/BlueprintTemplate/Host.API/Extensions/ThirdPartyExtensions.cs +30 -0
- package/BlueprintTemplate/Host.API/Host.API.csproj +29 -0
- package/BlueprintTemplate/Host.API/Host.API.csproj.user +6 -0
- package/BlueprintTemplate/Host.API/Host.API.http +6 -0
- package/BlueprintTemplate/Host.API/Program.cs +25 -0
- package/BlueprintTemplate/Host.API/Properties/launchSettings.json +23 -0
- package/BlueprintTemplate/Host.API/appsettings.Development.json +8 -0
- package/BlueprintTemplate/Host.API/appsettings.json +15 -0
- package/BlueprintTemplate/ItemModule.API/Controllers/Public/ItemController.cs +65 -0
- package/BlueprintTemplate/ItemModule.API/ItemModule.API.csproj +26 -0
- package/BlueprintTemplate/ItemModule.API/Mappers/DtoItemMappingProfile.cs +26 -0
- package/BlueprintTemplate/ItemModule.Core/Dtos/Admin/ItemRequestDto.cs +8 -0
- package/BlueprintTemplate/ItemModule.Core/Dtos/Admin/ItemResponseDto.cs +8 -0
- package/BlueprintTemplate/ItemModule.Core/Entities/Item.cs +8 -0
- package/BlueprintTemplate/ItemModule.Core/Interfaces/API/IItemService.cs +9 -0
- package/BlueprintTemplate/ItemModule.Core/Interfaces/SPI/IItemInfra.cs +9 -0
- package/BlueprintTemplate/ItemModule.Core/ItemModule.Core.csproj +18 -0
- package/BlueprintTemplate/ItemModule.Core/Services/ItemService.cs +20 -0
- package/BlueprintTemplate/ItemModule.Infrastructure/Database/ItemConfiguration.cs +22 -0
- package/BlueprintTemplate/ItemModule.Infrastructure/Database/Seeder.cs +21 -0
- package/BlueprintTemplate/ItemModule.Infrastructure/ItemDependencyInjection.cs +27 -0
- package/BlueprintTemplate/ItemModule.Infrastructure/ItemModule.Infrastructure.csproj +14 -0
- package/BlueprintTemplate/ItemModule.Infrastructure/Services/MySQLItemInfra.cs +16 -0
- package/BlueprintTemplate/MyBlueprint.slnx +23 -0
- package/BlueprintTemplate/README.md +22 -0
- package/BlueprintTemplate/Shared.Core/Dtos/Requests/BaseRequestDto.cs +27 -0
- package/BlueprintTemplate/Shared.Core/Dtos/Responses/BaseResponseDto.cs +27 -0
- package/BlueprintTemplate/Shared.Core/Entities/BaseEntity.cs +15 -0
- package/BlueprintTemplate/Shared.Core/Enums/EntityStatus.cs +9 -0
- package/BlueprintTemplate/Shared.Core/Exceptions/Errors.cs +20 -0
- package/BlueprintTemplate/Shared.Core/Interfaces/API/IItemService.cs +14 -0
- package/BlueprintTemplate/Shared.Core/Interfaces/SPI/IItemInfra.cs +14 -0
- package/BlueprintTemplate/Shared.Core/Interfaces/SPI/IModuleSeeder.cs +9 -0
- package/BlueprintTemplate/Shared.Core/Interfaces/SPI/IRepositoryFactory.cs +7 -0
- package/BlueprintTemplate/Shared.Core/Models/Error.cs +69 -0
- package/BlueprintTemplate/Shared.Core/Models/ErrorDetail.cs +8 -0
- package/BlueprintTemplate/Shared.Core/Models/PagerData.cs +8 -0
- package/BlueprintTemplate/Shared.Core/Models/PagingParams.cs +8 -0
- package/BlueprintTemplate/Shared.Core/Services/ItemService.cs +53 -0
- package/BlueprintTemplate/Shared.Core/Shared.Core.csproj +13 -0
- package/BlueprintTemplate/Shared.Infrastructure/DbInitializer.cs +18 -0
- package/BlueprintTemplate/Shared.Infrastructure/Migrations/20260131121133_SeedInitialData.Designer.cs +123 -0
- package/BlueprintTemplate/Shared.Infrastructure/Migrations/20260131121133_SeedInitialData.cs +82 -0
- package/BlueprintTemplate/Shared.Infrastructure/Migrations/MyDbContextModelSnapshot.cs +120 -0
- package/BlueprintTemplate/Shared.Infrastructure/MyDbContext.cs +24 -0
- package/BlueprintTemplate/Shared.Infrastructure/Services/Mongo/MongoItemInfra.cs +117 -0
- package/BlueprintTemplate/Shared.Infrastructure/Services/MySQL/MySQLItemInfra.cs +132 -0
- package/BlueprintTemplate/Shared.Infrastructure/Services/RepositoryFactory.cs +36 -0
- package/BlueprintTemplate/Shared.Infrastructure/Shared.Infrastructure.csproj +28 -0
- package/BlueprintTemplate/Shared.Infrastructure/SharedDependencyInjection.cs +19 -0
- package/BlueprintTemplate/User.API/Controllers/Admin/UserController.cs +153 -0
- package/BlueprintTemplate/User.API/Mappers/DtoUserMappingProfile.cs +27 -0
- package/BlueprintTemplate/User.API/UserModule.API.csproj +26 -0
- package/BlueprintTemplate/User.Core/Dtos/Admin/UserRequestDto.cs +12 -0
- package/BlueprintTemplate/User.Core/Dtos/Admin/UserResponseDto.cs +12 -0
- package/BlueprintTemplate/User.Core/Entities/User.cs +13 -0
- package/BlueprintTemplate/User.Core/Enums/UserRole.cs +8 -0
- package/BlueprintTemplate/User.Core/Interfaces/API/IUserService.cs +9 -0
- package/BlueprintTemplate/User.Core/Interfaces/SPI/IUserInfra.cs +9 -0
- package/BlueprintTemplate/User.Core/Services/UserService.cs +20 -0
- package/BlueprintTemplate/User.Core/UserModule.Core.csproj +17 -0
- package/BlueprintTemplate/User.Infrastructure/Database/ItemConfiguration.cs +27 -0
- package/BlueprintTemplate/User.Infrastructure/Database/Seeder.cs +44 -0
- package/BlueprintTemplate/User.Infrastructure/Services/MySQLUserInfra.cs +16 -0
- package/BlueprintTemplate/User.Infrastructure/UserDependencyInjection.cs +22 -0
- package/BlueprintTemplate/User.Infrastructure/UserModule.Infrastructure.csproj +14 -0
- package/README.md +7 -18
- package/package.json +2 -2
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
using Microsoft.EntityFrameworkCore;
|
|
2
|
+
using Shared.Core.Enums;
|
|
3
|
+
using Shared.Core.Interfaces.SPI;
|
|
4
|
+
using UserModule.Core.Entities;
|
|
5
|
+
using UserModule.Core.Enums;
|
|
6
|
+
|
|
7
|
+
namespace UserModule.Infrastructure.Database
|
|
8
|
+
{
|
|
9
|
+
public class Seeder : IModuleSeeder
|
|
10
|
+
{
|
|
11
|
+
public void Seed(ModelBuilder modelBuilder)
|
|
12
|
+
{
|
|
13
|
+
modelBuilder.Entity<User>().HasData(
|
|
14
|
+
new User
|
|
15
|
+
{
|
|
16
|
+
Id = Guid.Parse("11111111-1111-1111-1111-111111111111"),
|
|
17
|
+
Name = "Test",
|
|
18
|
+
Email = "",
|
|
19
|
+
Picture = null,
|
|
20
|
+
Role = UserRole.Admin,
|
|
21
|
+
Status = EntityStatus.Active,
|
|
22
|
+
},
|
|
23
|
+
new User
|
|
24
|
+
{
|
|
25
|
+
Id = Guid.Parse("22222222-2222-2222-2222-222222222222"),
|
|
26
|
+
Name = "Truong Dang",
|
|
27
|
+
Email = "truongdxfx08031@funix.edu.vn",
|
|
28
|
+
Picture = null,
|
|
29
|
+
Role = UserRole.User,
|
|
30
|
+
Status = EntityStatus.Active,
|
|
31
|
+
},
|
|
32
|
+
new User
|
|
33
|
+
{
|
|
34
|
+
Id = Guid.Parse("33333333-3333-3333-3333-333333333333"),
|
|
35
|
+
Name = "Thai Son",
|
|
36
|
+
Email = "truonghusk17aws1@gmail.com",
|
|
37
|
+
Picture = null,
|
|
38
|
+
Role = UserRole.User,
|
|
39
|
+
Status = EntityStatus.Active,
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
using Microsoft.Extensions.Logging;
|
|
2
|
+
using Shared.Infrastructure;
|
|
3
|
+
using Shared.Infrastructure.Services.MySQL;
|
|
4
|
+
using UserModule.Core.Entities;
|
|
5
|
+
using UserModule.Core.Interfaces.SPI;
|
|
6
|
+
|
|
7
|
+
namespace UserModule.Infrastructure.Services
|
|
8
|
+
{
|
|
9
|
+
public class MySQLUserInfra : MySQLItemInfra<User>, IUserInfra
|
|
10
|
+
{
|
|
11
|
+
public MySQLUserInfra(MyDbContext dbContext, ILogger<MySQLUserInfra> logger)
|
|
12
|
+
: base(dbContext, logger)
|
|
13
|
+
{
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
using Microsoft.Extensions.DependencyInjection;
|
|
2
|
+
using Shared.Core.Interfaces.SPI;
|
|
3
|
+
using UserModule.Core.Interfaces.API;
|
|
4
|
+
using UserModule.Core.Interfaces.SPI;
|
|
5
|
+
using UserModule.Core.Services;
|
|
6
|
+
using UserModule.Infrastructure.Database;
|
|
7
|
+
using UserModule.Infrastructure.Services;
|
|
8
|
+
|
|
9
|
+
namespace UserModule.Infrastructure
|
|
10
|
+
{
|
|
11
|
+
public static class UserDependencyInjection
|
|
12
|
+
{
|
|
13
|
+
public static IServiceCollection AddUserModuleInfra(
|
|
14
|
+
this IServiceCollection services)
|
|
15
|
+
{
|
|
16
|
+
services.AddScoped<IModuleSeeder, Seeder>();
|
|
17
|
+
services.AddScoped<IUserInfra, MySQLUserInfra>();
|
|
18
|
+
services.AddScoped<IUserService, UserService>();
|
|
19
|
+
return services;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<Project Sdk="Microsoft.NET.Sdk">
|
|
2
|
+
|
|
3
|
+
<ItemGroup>
|
|
4
|
+
<ProjectReference Include="..\User.Core\UserModule.Core.csproj" />
|
|
5
|
+
<ProjectReference Include="..\Shared.Infrastructure\Shared.Infrastructure.csproj" />
|
|
6
|
+
</ItemGroup>
|
|
7
|
+
|
|
8
|
+
<PropertyGroup>
|
|
9
|
+
<TargetFramework>net10.0</TargetFramework>
|
|
10
|
+
<ImplicitUsings>enable</ImplicitUsings>
|
|
11
|
+
<Nullable>enable</Nullable>
|
|
12
|
+
</PropertyGroup>
|
|
13
|
+
|
|
14
|
+
</Project>
|
package/README.md
CHANGED
|
@@ -1,18 +1,7 @@
|
|
|
1
|
-
How to make a blueprint
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
3. Add git to the blueprint, and change the root branch from master to main
|
|
9
|
-
- git branch -m master main
|
|
10
|
-
4. Create new repo in git
|
|
11
|
-
- Add environment variables into the git repo: Project > Settings > CI/CD > Variables
|
|
12
|
-
+ NPM_TOKEN: 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
|
|
13
|
-
+ PACKAGE_NAME: python-blueprint
|
|
14
|
-
- push the blueprint to main branch
|
|
15
|
-
5. Use the lib from npm:
|
|
16
|
-
- npm install -g python-blueprint
|
|
17
|
-
- npm list -g python-blueprint
|
|
18
|
-
- python-blueprint thmoney
|
|
1
|
+
How to make a blueprint
|
|
2
|
+
|
|
3
|
+
1. Use the lib from npm:
|
|
4
|
+
- npm uninstall -g netcore-blueprint
|
|
5
|
+
- npm install -g netcore-blueprint
|
|
6
|
+
- npm list -g netcore-blueprint
|
|
7
|
+
- init-blueprint test
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "netcore-blueprint",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "A custom project blueprint",
|
|
5
5
|
"main": "create.js",
|
|
6
6
|
"bin": {
|
|
@@ -16,6 +16,6 @@
|
|
|
16
16
|
"author": "",
|
|
17
17
|
"license": "ISC",
|
|
18
18
|
"files": [
|
|
19
|
-
"
|
|
19
|
+
"BlueprintTemplate/**"
|
|
20
20
|
]
|
|
21
21
|
}
|