Skip to content

Commit 91904ac

Browse files
Merge pull request #47 from phamtiendungcw/dungcw
Update project dependencies, configs, and UI components
2 parents 1949c29 + a0ade19 commit 91904ac

26 files changed

+16271
-62
lines changed

src/MLS.Api/MLS.Api.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
</PackageReference>
1515
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="6.36.0" />
1616
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
17+
<PackageReference Include="System.Formats.Asn1" Version="6.0.1" />
1718
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.36.0" />
1819
</ItemGroup>
1920

src/MLS.Api/Program.cs

+5-31
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
builder.Services.AddEndpointsApiExplorer();
2020
builder.Services.AddSwaggerGen(c =>
2121
{
22-
c.SwaggerDoc("v1", new OpenApiInfo() { Title = "MatLidStore ASP .NET Core 6 API", Version = "v1" });
23-
c.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme()
22+
c.SwaggerDoc("v1", new OpenApiInfo { Title = "MatLidStore ASP .NET Core 6 API", Version = "v1" });
23+
c.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme
2424
{
2525
In = ParameterLocation.Header,
2626
Description = "Hãy nhập token người dùng sử dụng lược đồ Bearer. Ví dụ: \"Authorization: Bearer {token}\"",
@@ -29,12 +29,12 @@
2929
BearerFormat = "JWT",
3030
Scheme = "Bearer"
3131
});
32-
c.AddSecurityRequirement(new OpenApiSecurityRequirement()
32+
c.AddSecurityRequirement(new OpenApiSecurityRequirement
3333
{
3434
{
35-
new OpenApiSecurityScheme()
35+
new OpenApiSecurityScheme
3636
{
37-
Reference = new OpenApiReference()
37+
Reference = new OpenApiReference
3838
{
3939
Type = ReferenceType.SecurityScheme,
4040
Id = "Bearer"
@@ -45,32 +45,6 @@
4545
});
4646
});
4747

48-
//var key = Encoding.ASCII.GetBytes(builder.Configuration["Jwt:Key"]);
49-
//builder.Services.AddAuthentication(options =>
50-
//{
51-
// options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
52-
// options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
53-
//}).AddJwtBearer(options =>
54-
//{
55-
// options.RequireHttpsMetadata = false;
56-
// options.SaveToken = true;
57-
// options.TokenValidationParameters = new TokenValidationParameters
58-
// {
59-
// ValidateIssuer = true,
60-
// ValidateAudience = true,
61-
// ValidateLifetime = true,
62-
// ValidateIssuerSigningKey = true,
63-
// ValidIssuer = builder.Configuration["Jwt:Issuer"],
64-
// ValidAudience = builder.Configuration["Jwt:Audience"],
65-
// IssuerSigningKey = new SymmetricSecurityKey(key)
66-
// };
67-
//});
68-
//builder.Services.AddAuthorization(options =>
69-
//{
70-
// options.AddPolicy("AdminPolicy", policy => policy.RequireRole("Admin"));
71-
// options.AddPolicy("UserPolicy", policy => policy.RequireRole("AppUser"));
72-
//});
73-
7448
var app = builder.Build();
7549

7650
// Configure the HTTP request pipeline.

src/MLS.Api/Properties/launchSettings.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"dotnetRunMessages": true,
1515
"launchBrowser": true,
1616
"launchUrl": "swagger",
17-
"applicationUrl": "https://localhost:7173;http://localhost:5049",
17+
"applicationUrl": "https://localhost:8100;http://localhost:8000",
1818
"environmentVariables": {
1919
"ASPNETCORE_ENVIRONMENT": "Development"
2020
},
@@ -36,7 +36,6 @@
3636
"environmentVariables": {
3737
"ASPNETCORE_ENVIRONMENT": "Development"
3838
}
39-
4039
},
4140
"IIS Express": {
4241
"commandName": "IISExpress",
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
6+
}
7+
},
8+
"AllowedHosts": "*",
9+
"ConnectionStrings": {
10+
"MatLidConnectionString": "Data Source=localhost:1521/mlsdb;User Id=system;Password=Matliddev2024@"
11+
}
12+
}

src/MLS.Domain/Entities/OrderDetail.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using System.ComponentModel.DataAnnotations.Schema;
2-
using MLS.Domain.Common;
1+
using MLS.Domain.Common;
2+
using System.ComponentModel.DataAnnotations.Schema;
33

44
namespace MLS.Domain.Entities;
55

src/MLS.Domain/Entities/ShoppingCartItem.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using System.ComponentModel.DataAnnotations.Schema;
2-
using MLS.Domain.Common;
1+
using MLS.Domain.Common;
2+
using System.ComponentModel.DataAnnotations.Schema;
33

44
namespace MLS.Domain.Entities;
55

src/MLS.Domain/Entities/Supply.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using System.ComponentModel.DataAnnotations.Schema;
2-
using MLS.Domain.Common;
1+
using MLS.Domain.Common;
2+
using System.ComponentModel.DataAnnotations.Schema;
33

44
namespace MLS.Domain.Entities;
55

src/MLS.Persistence/Configurations/EntityConfigurations.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static void Configure(ModelBuilder modelBuilder, string tablePrefix)
3636
modelBuilder.Entity<WishList>(b => { b.ToTable($"{tablePrefix}WishLists"); });
3737
modelBuilder.Entity<WishListItem>(b => { b.ToTable($"{tablePrefix}WishListItems"); });
3838

39-
#endregion Configure to table name
39+
#endregion Customize table name
4040

4141
#region Ensure relationships and delete cascading rules
4242

src/MLS.Persistence/DatabaseContext/MatLidStoreDatabaseContext.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public MatLidStoreDatabaseContext(DbContextOptions<MatLidStoreDatabaseContext> o
4242
public DbSet<WishList> WishLists { get; set; } = null!;
4343
public DbSet<WishListItem> WishListItems { get; set; } = null!;
4444

45-
#endregion Configure table in DB
45+
#endregion Defines a set of entities in the database
4646

4747
public override Task<int> SaveChangesAsync(CancellationToken cancellationToken = new())
4848
{

src/MLS.Persistence/IdentityServiceRegistration.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public static class IdentityServiceRegistration
1111
{
1212
public static IServiceCollection AddIdentityServices(this IServiceCollection services, IConfiguration configuration)
1313
{
14-
services.AddDbContext<MatLidStoreDatabaseContext>(options => options.UseOracle(configuration.GetConnectionString("MatLidConnectionString")));
14+
services.AddDbContext<MatLidStoreDatabaseContext>(options => { options.UseOracle(configuration.GetConnectionString("MatLidConnectionString")); });
1515

1616
services.AddIdentity<AppUser, AppRole>()
1717
.AddEntityFrameworkStores<MatLidStoreDatabaseContext>()

src/MLS.Persistence/MLS.Persistence.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="6.0.0" />
2626
<PackageReference Include="Oracle.EntityFrameworkCore" Version="6.21.150" />
2727
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.32" />
28+
<PackageReference Include="System.Formats.Asn1" Version="6.0.1" />
2829
</ItemGroup>
2930

3031
</Project>

src/MLS.Persistence/Migrations/20240803070055_InitialMigrationDatabase.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System;
2-
using Microsoft.EntityFrameworkCore.Migrations;
1+
using Microsoft.EntityFrameworkCore.Migrations;
32

43
#nullable disable
54

@@ -910,4 +909,4 @@ protected override void Down(MigrationBuilder migrationBuilder)
910909
name: "MATLID_Users");
911910
}
912911
}
913-
}
912+
}

src/MLS.WebUI/.vscode/launch.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"configurations": [
55
{
66
"name": "ng serve",
7-
"type": "pwa-chrome",
7+
"type": "pwa-edge",
88
"request": "launch",
99
"preLaunchTask": "npm: start",
1010
"url": "http://localhost:4200/"

src/MLS.WebUI/karma.conf.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,7 @@ module.exports = function (config) {
55
config.set({
66
basePath: '',
77
frameworks: ['jasmine', '@angular-devkit/build-angular'],
8-
plugins: [
9-
require('karma-jasmine'),
10-
require('karma-chrome-launcher'),
11-
require('karma-jasmine-html-reporter'),
12-
require('karma-coverage'),
13-
require('@angular-devkit/build-angular/plugins/karma'),
14-
],
8+
plugins: [require('karma-jasmine'), require('karma-chrome-launcher'), require('karma-jasmine-html-reporter'), require('karma-coverage'), require('@angular-devkit/build-angular/plugins/karma')],
159
client: {
1610
jasmine: {
1711
// you can add configuration options for Jasmine here

0 commit comments

Comments
 (0)