@@ -19,8 +19,8 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Bimix.Application\Bimix.Application.csproj" />
|
<ProjectReference Include="..\BimAI.Application\BimAI.Application.csproj" />
|
||||||
<ProjectReference Include="..\Bimix.Infrastructure\Bimix.Infrastructure.csproj" />
|
<ProjectReference Include="..\BimAI.Infrastructure\BimAI.Infrastructure.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
6
BimAI.API/BimAI.API.http
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
@BimAI.API_HostAddress = http://localhost:5090
|
||||||
|
|
||||||
|
GET {{BimAI.API_HostAddress}}/weatherforecast/
|
||||||
|
Accept: application/json
|
||||||
|
|
||||||
|
###
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using Bimix.API.Services;
|
using BimAI.API.Services;
|
||||||
using Bimix.Application.DTOModels;
|
using BimAI.Application.DTOModels;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace Bimix.API.Controllers;
|
namespace BimAI.API.Controllers;
|
||||||
|
|
||||||
public class AuthController(
|
public class AuthController(
|
||||||
GoogleAuthService googleAuthService,
|
GoogleAuthService googleAuthService,
|
||||||
@@ -1,17 +1,16 @@
|
|||||||
using Bimix.Application.DTOModels;
|
using BimAI.Application.DTOModels;
|
||||||
using Bimix.Application.DTOModels.Common;
|
using BimAI.Application.DTOModels.Common;
|
||||||
|
using BimAI.Infrastructure.Data;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Bimix.Infrastructure.Data;
|
|
||||||
using Bimix.Domain.Entities;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace Bimix.API.Controllers;
|
namespace BimAI.API.Controllers;
|
||||||
|
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Route("api/[controller]")]
|
[Route("api/[controller]")]
|
||||||
public class ProductsController(BimixDbContext context) : ControllerBase
|
public class ProductsController(BimAIDbContext context) : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly BimixDbContext _context = context;
|
private readonly BimAIDbContext _context = context;
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public async Task<ActionResult<IEnumerable<ProductDto>>> GetProducts([FromQuery] ProductFilterRequest request)
|
public async Task<ActionResult<IEnumerable<ProductDto>>> GetProducts([FromQuery] ProductFilterRequest request)
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using Bimix.Infrastructure.Sync;
|
using BimAI.Infrastructure.Sync;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace Bimix.API.Controllers;
|
namespace BimAI.API.Controllers;
|
||||||
|
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Route("api/[controller]")]
|
[Route("api/[controller]")]
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using Bimix.API.Services;
|
using BimAI.API.Services;
|
||||||
using Bimix.Infrastructure.Data;
|
using BimAI.Infrastructure.Data;
|
||||||
using Bimix.Infrastructure.Sync;
|
using BimAI.Infrastructure.Sync;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||||
using Microsoft.IdentityModel.Tokens;
|
using Microsoft.IdentityModel.Tokens;
|
||||||
@@ -10,7 +10,7 @@ using Microsoft.IdentityModel.Tokens;
|
|||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
var connectionString = builder.Configuration.GetConnectionString("DefaultConnection");
|
var connectionString = builder.Configuration.GetConnectionString("DefaultConnection");
|
||||||
builder.Services.AddDbContext<BimixDbContext>(options => options.UseSqlServer(connectionString));
|
builder.Services.AddDbContext<BimAIDbContext>(options => options.UseSqlServer(connectionString));
|
||||||
builder.Services.AddScoped<ProductSyncService>();
|
builder.Services.AddScoped<ProductSyncService>();
|
||||||
|
|
||||||
builder.Services.AddHttpClient();
|
builder.Services.AddHttpClient();
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
using Bimix.Domain.Entities;
|
using BimAI.Domain.Entities;
|
||||||
using Bimix.Infrastructure.Data;
|
using BimAI.Infrastructure.Data;
|
||||||
using Google.Apis.Auth;
|
using Google.Apis.Auth;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace Bimix.API.Services;
|
namespace BimAI.API.Services;
|
||||||
|
|
||||||
public class GoogleAuthService(BimixDbContext context, IConfiguration configuration, ILogger<GoogleAuthService> logger)
|
public class GoogleAuthService(BimAIDbContext context, IConfiguration configuration, ILogger<GoogleAuthService> logger)
|
||||||
{
|
{
|
||||||
private readonly BimixDbContext _context = context;
|
private readonly BimAIDbContext _context = context;
|
||||||
private readonly IConfiguration _configuration = configuration;
|
private readonly IConfiguration _configuration = configuration;
|
||||||
private readonly ILogger<GoogleAuthService> _logger = logger;
|
private readonly ILogger<GoogleAuthService> _logger = logger;
|
||||||
|
|
||||||
@@ -35,8 +35,8 @@ public class GoogleAuthService(BimixDbContext context, IConfiguration configurat
|
|||||||
|
|
||||||
if (user == null)
|
if (user == null)
|
||||||
{
|
{
|
||||||
_logger.LogError("User not found in Bimix database: {Email}", payload.Email);
|
_logger.LogError("User not found in BimAI database: {Email}", payload.Email);
|
||||||
return (false, null, "User not found in Bimix database");
|
return (false, null, "User not found in BimAI database");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!user.IsActive)
|
if (!user.IsActive)
|
||||||
@@ -1,11 +1,10 @@
|
|||||||
using Microsoft.IdentityModel.Tokens;
|
|
||||||
using System.IdentityModel.Tokens.Jwt;
|
using System.IdentityModel.Tokens.Jwt;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Bimix.Domain.Entities;
|
using BimAI.Domain.Entities;
|
||||||
|
using Microsoft.IdentityModel.Tokens;
|
||||||
|
|
||||||
|
namespace BimAI.API.Services;
|
||||||
namespace Bimix.API.Services;
|
|
||||||
|
|
||||||
public class JwtTokenService(IConfiguration configuration, ILogger<JwtTokenService> logger)
|
public class JwtTokenService(IConfiguration configuration, ILogger<JwtTokenService> logger)
|
||||||
{
|
{
|
||||||
27
BimAI.API/appsettings.Development.json
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"AllowedHosts": "*",
|
||||||
|
"ConnectionStrings": {
|
||||||
|
"DefaultConnection": "Server=localhost,1433;Database=bimai;User Id=sa;Password=9832&^*&huihj;TrustServerCertificate=True;"
|
||||||
|
},
|
||||||
|
"E5_CRM": {
|
||||||
|
"ApiKey": "7e50a8a5-f01f-4fbc-8c1b-59f3fc474bb5"
|
||||||
|
},
|
||||||
|
"GoogleAuth": {
|
||||||
|
"ClientId": "1037727384847-t1l2au6du34kdckamro81guklk17cjah.apps.googleusercontent.com"
|
||||||
|
},
|
||||||
|
"JwtSettings": {
|
||||||
|
"SecretKey": "BimAISuperSecretKeyThatMustBeAtLeast32CharactersLong123456789",
|
||||||
|
"Issuer": "BimAI.API",
|
||||||
|
"Audience": "BimAI.Clients",
|
||||||
|
"ExpiryDays": 7
|
||||||
|
},
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.AspNetCore": "Warning",
|
||||||
|
"Microsoft.EntityFrameworkCore": "Warning",
|
||||||
|
"Microsoft.EntityFrameworkCore.Database.Command": "Warning",
|
||||||
|
"Microsoft.EntityFrameworkCore.Infrastructure": "Warning"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Bimix.Domain\Bimix.Domain.csproj" />
|
<ProjectReference Include="..\BimAI.Domain\BimAI.Domain.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Bimix.Application.DTOModels;
|
namespace BimAI.Application.DTOModels;
|
||||||
|
|
||||||
public class GoogleAuthRequest
|
public class GoogleAuthRequest
|
||||||
{
|
{
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Bimix.Application.DTOModels.Common;
|
namespace BimAI.Application.DTOModels.Common;
|
||||||
|
|
||||||
public class PagedResult<T>
|
public class PagedResult<T>
|
||||||
{
|
{
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Bimix.Application.DTOModels;
|
namespace BimAI.Application.DTOModels;
|
||||||
|
|
||||||
public class ProductDto
|
public class ProductDto
|
||||||
{
|
{
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Bimix.Domain.Entities;
|
namespace BimAI.Domain.Entities;
|
||||||
|
|
||||||
public abstract class BaseEntity
|
public abstract class BaseEntity
|
||||||
{
|
{
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Bimix.Domain.Entities;
|
namespace BimAI.Domain.Entities;
|
||||||
|
|
||||||
public class Product : BaseEntity
|
public class Product : BaseEntity
|
||||||
{
|
{
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Bimix.Domain.Entities;
|
namespace BimAI.Domain.Entities;
|
||||||
|
|
||||||
public class SyncState
|
public class SyncState
|
||||||
{
|
{
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Bimix.Domain.Entities;
|
namespace BimAI.Domain.Entities;
|
||||||
|
|
||||||
public class User : BaseEntity
|
public class User : BaseEntity
|
||||||
{
|
{
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Bimix.Domain\Bimix.Domain.csproj" />
|
<ProjectReference Include="..\BimAI.Domain\BimAI.Domain.csproj" />
|
||||||
<ProjectReference Include="..\Bimix.Application\Bimix.Application.csproj" />
|
<ProjectReference Include="..\BimAI.Application\BimAI.Application.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
using Bimix.Domain.Entities;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using BimAI.Domain.Entities;
|
||||||
|
|
||||||
namespace Bimix.Infrastructure.Data;
|
namespace BimAI.Infrastructure.Data;
|
||||||
|
|
||||||
public class BimixDbContext(DbContextOptions<BimixDbContext> options) : DbContext(options)
|
public class BimAIDbContext(DbContextOptions<BimAIDbContext> options) : DbContext(options)
|
||||||
{
|
{
|
||||||
public DbSet<Product> Products { get; set; }
|
public DbSet<Product> Products { get; set; }
|
||||||
public DbSet<SyncState> SyncStates { get; set; }
|
public DbSet<SyncState> SyncStates { get; set; }
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
// <auto-generated />
|
// <auto-generated />
|
||||||
using System;
|
using System;
|
||||||
using Bimix.Infrastructure.Data;
|
using BimAI.Infrastructure.Data;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
@@ -9,9 +9,9 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
namespace Bimix.Infrastructure.Migrations
|
namespace BimAI.Infrastructure.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(BimixDbContext))]
|
[DbContext(typeof(BimAIDbContext))]
|
||||||
[Migration("20250619185202_InitDatabase")]
|
[Migration("20250619185202_InitDatabase")]
|
||||||
partial class InitDatabase
|
partial class InitDatabase
|
||||||
{
|
{
|
||||||
@@ -25,7 +25,7 @@ namespace Bimix.Infrastructure.Migrations
|
|||||||
|
|
||||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||||
|
|
||||||
modelBuilder.Entity("Bimix.Domain.Entities.Product", b =>
|
modelBuilder.Entity("BimAI.Domain.Entities.Product", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
@@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
namespace Bimix.Infrastructure.Migrations
|
namespace BimAI.Infrastructure.Migrations
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public partial class InitDatabase : Migration
|
public partial class InitDatabase : Migration
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
// <auto-generated />
|
// <auto-generated />
|
||||||
using System;
|
using System;
|
||||||
using Bimix.Infrastructure.Data;
|
using BimAI.Infrastructure.Data;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
@@ -9,9 +9,9 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
namespace Bimix.Infrastructure.Migrations
|
namespace BimAI.Infrastructure.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(BimixDbContext))]
|
[DbContext(typeof(BimAIDbContext))]
|
||||||
[Migration("20250623184943_AddSyncState")]
|
[Migration("20250623184943_AddSyncState")]
|
||||||
partial class AddSyncState
|
partial class AddSyncState
|
||||||
{
|
{
|
||||||
@@ -25,7 +25,7 @@ namespace Bimix.Infrastructure.Migrations
|
|||||||
|
|
||||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||||
|
|
||||||
modelBuilder.Entity("Bimix.Domain.Entities.Product", b =>
|
modelBuilder.Entity("BimAI.Domain.Entities.Product", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
@@ -47,7 +47,7 @@ namespace Bimix.Infrastructure.Migrations
|
|||||||
b.ToTable("Products");
|
b.ToTable("Products");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Bimix.Domain.Entities.SyncState", b =>
|
modelBuilder.Entity("BimAI.Domain.Entities.SyncState", b =>
|
||||||
{
|
{
|
||||||
b.Property<string>("Entity")
|
b.Property<string>("Entity")
|
||||||
.HasColumnType("nvarchar(450)");
|
.HasColumnType("nvarchar(450)");
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
namespace Bimix.Infrastructure.Migrations
|
namespace BimAI.Infrastructure.Migrations
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public partial class AddSyncState : Migration
|
public partial class AddSyncState : Migration
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
// <auto-generated />
|
// <auto-generated />
|
||||||
using System;
|
using System;
|
||||||
using Bimix.Infrastructure.Data;
|
using BimAI.Infrastructure.Data;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
@@ -9,9 +9,9 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
namespace Bimix.Infrastructure.Migrations
|
namespace BimAI.Infrastructure.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(BimixDbContext))]
|
[DbContext(typeof(BimAIDbContext))]
|
||||||
[Migration("20250623194653_ResizeProductName")]
|
[Migration("20250623194653_ResizeProductName")]
|
||||||
partial class ResizeProductName
|
partial class ResizeProductName
|
||||||
{
|
{
|
||||||
@@ -25,7 +25,7 @@ namespace Bimix.Infrastructure.Migrations
|
|||||||
|
|
||||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||||
|
|
||||||
modelBuilder.Entity("Bimix.Domain.Entities.Product", b =>
|
modelBuilder.Entity("BimAI.Domain.Entities.Product", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
@@ -47,7 +47,7 @@ namespace Bimix.Infrastructure.Migrations
|
|||||||
b.ToTable("Products");
|
b.ToTable("Products");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Bimix.Domain.Entities.SyncState", b =>
|
modelBuilder.Entity("BimAI.Domain.Entities.SyncState", b =>
|
||||||
{
|
{
|
||||||
b.Property<string>("Entity")
|
b.Property<string>("Entity")
|
||||||
.HasColumnType("nvarchar(450)");
|
.HasColumnType("nvarchar(450)");
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
namespace Bimix.Infrastructure.Migrations
|
namespace BimAI.Infrastructure.Migrations
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public partial class ResizeProductName : Migration
|
public partial class ResizeProductName : Migration
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
// <auto-generated />
|
// <auto-generated />
|
||||||
using System;
|
using System;
|
||||||
using Bimix.Infrastructure.Data;
|
using BimAI.Infrastructure.Data;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
@@ -9,9 +9,9 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
namespace Bimix.Infrastructure.Migrations
|
namespace BimAI.Infrastructure.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(BimixDbContext))]
|
[DbContext(typeof(BimAIDbContext))]
|
||||||
[Migration("20250624193445_Products-NewFields")]
|
[Migration("20250624193445_Products-NewFields")]
|
||||||
partial class ProductsNewFields
|
partial class ProductsNewFields
|
||||||
{
|
{
|
||||||
@@ -25,7 +25,7 @@ namespace Bimix.Infrastructure.Migrations
|
|||||||
|
|
||||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||||
|
|
||||||
modelBuilder.Entity("Bimix.Domain.Entities.Product", b =>
|
modelBuilder.Entity("BimAI.Domain.Entities.Product", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
@@ -62,7 +62,7 @@ namespace Bimix.Infrastructure.Migrations
|
|||||||
b.ToTable("Products");
|
b.ToTable("Products");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Bimix.Domain.Entities.SyncState", b =>
|
modelBuilder.Entity("BimAI.Domain.Entities.SyncState", b =>
|
||||||
{
|
{
|
||||||
b.Property<string>("Entity")
|
b.Property<string>("Entity")
|
||||||
.HasColumnType("nvarchar(450)");
|
.HasColumnType("nvarchar(450)");
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
namespace Bimix.Infrastructure.Migrations
|
namespace BimAI.Infrastructure.Migrations
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public partial class ProductsNewFields : Migration
|
public partial class ProductsNewFields : Migration
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
// <auto-generated />
|
// <auto-generated />
|
||||||
using System;
|
using System;
|
||||||
using Bimix.Infrastructure.Data;
|
using BimAI.Infrastructure.Data;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
@@ -9,9 +9,9 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
namespace Bimix.Infrastructure.Migrations
|
namespace BimAI.Infrastructure.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(BimixDbContext))]
|
[DbContext(typeof(BimAIDbContext))]
|
||||||
[Migration("20250718162313_AddUsersTable")]
|
[Migration("20250718162313_AddUsersTable")]
|
||||||
partial class AddUsersTable
|
partial class AddUsersTable
|
||||||
{
|
{
|
||||||
@@ -25,7 +25,7 @@ namespace Bimix.Infrastructure.Migrations
|
|||||||
|
|
||||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||||
|
|
||||||
modelBuilder.Entity("Bimix.Domain.Entities.Product", b =>
|
modelBuilder.Entity("BimAI.Domain.Entities.Product", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
@@ -66,7 +66,7 @@ namespace Bimix.Infrastructure.Migrations
|
|||||||
b.ToTable("Products");
|
b.ToTable("Products");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Bimix.Domain.Entities.SyncState", b =>
|
modelBuilder.Entity("BimAI.Domain.Entities.SyncState", b =>
|
||||||
{
|
{
|
||||||
b.Property<string>("Entity")
|
b.Property<string>("Entity")
|
||||||
.HasColumnType("nvarchar(450)");
|
.HasColumnType("nvarchar(450)");
|
||||||
@@ -79,7 +79,7 @@ namespace Bimix.Infrastructure.Migrations
|
|||||||
b.ToTable("SyncStates");
|
b.ToTable("SyncStates");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Bimix.Domain.Entities.User", b =>
|
modelBuilder.Entity("BimAI.Domain.Entities.User", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
@@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
namespace Bimix.Infrastructure.Migrations
|
namespace BimAI.Infrastructure.Migrations
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public partial class AddUsersTable : Migration
|
public partial class AddUsersTable : Migration
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
// <auto-generated />
|
// <auto-generated />
|
||||||
using System;
|
using System;
|
||||||
using Bimix.Infrastructure.Data;
|
using BimAI.Infrastructure.Data;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
@@ -8,10 +8,10 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
namespace Bimix.Infrastructure.Migrations
|
namespace BimAI.Infrastructure.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(BimixDbContext))]
|
[DbContext(typeof(BimAIDbContext))]
|
||||||
partial class BimixDbContextModelSnapshot : ModelSnapshot
|
partial class BimAIDbContextModelSnapshot : ModelSnapshot
|
||||||
{
|
{
|
||||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
@@ -22,7 +22,7 @@ namespace Bimix.Infrastructure.Migrations
|
|||||||
|
|
||||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||||
|
|
||||||
modelBuilder.Entity("Bimix.Domain.Entities.Product", b =>
|
modelBuilder.Entity("BimAI.Domain.Entities.Product", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
@@ -63,7 +63,7 @@ namespace Bimix.Infrastructure.Migrations
|
|||||||
b.ToTable("Products");
|
b.ToTable("Products");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Bimix.Domain.Entities.SyncState", b =>
|
modelBuilder.Entity("BimAI.Domain.Entities.SyncState", b =>
|
||||||
{
|
{
|
||||||
b.Property<string>("Entity")
|
b.Property<string>("Entity")
|
||||||
.HasColumnType("nvarchar(450)");
|
.HasColumnType("nvarchar(450)");
|
||||||
@@ -76,7 +76,7 @@ namespace Bimix.Infrastructure.Migrations
|
|||||||
b.ToTable("SyncStates");
|
b.ToTable("SyncStates");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Bimix.Domain.Entities.User", b =>
|
modelBuilder.Entity("BimAI.Domain.Entities.User", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
@@ -1,14 +1,12 @@
|
|||||||
using System.Reflection.Metadata.Ecma335;
|
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using Bimix.Domain.Entities;
|
using BimAI.Domain.Entities;
|
||||||
using Bimix.Infrastructure.Data;
|
using BimAI.Infrastructure.Data;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
|
|
||||||
namespace Bimix.Infrastructure.Sync;
|
namespace BimAI.Infrastructure.Sync;
|
||||||
|
|
||||||
public class ProductSyncService(HttpClient httpClient, BimixDbContext db, IConfiguration configuration)
|
public class ProductSyncService(HttpClient httpClient, BimAIDbContext db, IConfiguration configuration)
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Dekoduje encje HTML w ciągu znaków (np. " na ")
|
/// Dekoduje encje HTML w ciągu znaków (np. " na ")
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Bimix.UI.Mobile;
|
namespace BimAI.UI.Mobile;
|
||||||
|
|
||||||
public partial class App : Microsoft.Maui.Controls.Application
|
public partial class App : Microsoft.Maui.Controls.Application
|
||||||
{
|
{
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->
|
<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->
|
||||||
|
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<RootNamespace>Bimix.UI.Mobile</RootNamespace>
|
<RootNamespace>BimAI.UI.Mobile</RootNamespace>
|
||||||
<UseMaui>true</UseMaui>
|
<UseMaui>true</UseMaui>
|
||||||
<SingleProject>true</SingleProject>
|
<SingleProject>true</SingleProject>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
@@ -23,10 +23,10 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
|
|
||||||
<!-- Display name -->
|
<!-- Display name -->
|
||||||
<ApplicationTitle>Bimix</ApplicationTitle>
|
<ApplicationTitle>BimAI</ApplicationTitle>
|
||||||
|
|
||||||
<!-- App Identifier -->
|
<!-- App Identifier -->
|
||||||
<ApplicationId>cloud.bimit.bimix</ApplicationId>
|
<ApplicationId></ApplicationId>
|
||||||
|
|
||||||
<!-- Versions -->
|
<!-- Versions -->
|
||||||
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
|
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
|
||||||
@@ -41,31 +41,12 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Platform)' == 'iPhone'">
|
<PropertyGroup Condition="'$(Platform)' == 'iPhone'">
|
||||||
<ApplicationId>cloud.bimit.bimix</ApplicationId>
|
<ApplicationId></ApplicationId>
|
||||||
<CodesignKey>Apple Development: Michal Zielinski (2F35ZHMBTB)</CodesignKey>
|
<CodesignKey>Apple Development: Michal Zielinski (2F35ZHMBTB)</CodesignKey>
|
||||||
<CodesignProvision>bimix-local</CodesignProvision>
|
<CodesignProvision>bimai-local</CodesignProvision>
|
||||||
<RuntimeIdentifier>ios-arm64</RuntimeIdentifier>
|
<RuntimeIdentifier>ios-arm64</RuntimeIdentifier>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<None Remove="appsettings.json" />
|
|
||||||
<None Remove="appsettings.Development.json" />
|
|
||||||
|
|
||||||
<Content Include="appsettings.json">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
|
||||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
|
||||||
</Content>
|
|
||||||
|
|
||||||
<Content Include="appsettings.Development.json">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
|
||||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
|
||||||
<DependentUpon>appsettings.json</DependentUpon>
|
|
||||||
</Content>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<!-- App Icon -->
|
<!-- App Icon -->
|
||||||
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4"/>
|
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4"/>
|
||||||
@@ -103,7 +84,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Bimix.UI.Shared\Bimix.UI.Shared.csproj"/>
|
<ProjectReference Include="..\BimAI.UI.Shared\BimAI.UI.Shared.csproj"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Bimix.UI.Mobile;
|
namespace BimAI.UI.Mobile;
|
||||||
|
|
||||||
public partial class MainPage : ContentPage
|
public partial class MainPage : ContentPage
|
||||||
{
|
{
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using Bimix.UI.Mobile.Services;
|
using BimAI.UI.Mobile.Services;
|
||||||
using Bimix.UI.Shared.Extensions;
|
using BimAI.UI.Shared.Extensions;
|
||||||
using Bimix.UI.Shared.Interfaces;
|
using BimAI.UI.Shared.Interfaces;
|
||||||
using Bimix.UI.Shared.Services;
|
using BimAI.UI.Shared.Services;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
@@ -12,7 +12,7 @@ using Microsoft.Maui.Hosting;
|
|||||||
using MudBlazor.Services;
|
using MudBlazor.Services;
|
||||||
using ZXing.Net.Maui.Controls;
|
using ZXing.Net.Maui.Controls;
|
||||||
|
|
||||||
namespace Bimix.UI.Mobile;
|
namespace BimAI.UI.Mobile;
|
||||||
|
|
||||||
public static class MauiProgram
|
public static class MauiProgram
|
||||||
{
|
{
|
||||||
|
Before Width: | Height: | Size: 228 B After Width: | Height: | Size: 228 B |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
@@ -1,8 +1,8 @@
|
|||||||
using Bimix.UI.Shared.Interfaces;
|
using BimAI.UI.Shared.Interfaces;
|
||||||
using ZXing.Net.Maui;
|
using ZXing.Net.Maui;
|
||||||
using ZXing.Net.Maui.Controls;
|
using ZXing.Net.Maui.Controls;
|
||||||
|
|
||||||
namespace Bimix.UI.Mobile.Services;
|
namespace BimAI.UI.Mobile.Services;
|
||||||
|
|
||||||
public class ScannerService : IScannerService
|
public class ScannerService : IScannerService
|
||||||
{
|
{
|
||||||
@@ -19,8 +19,8 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Bimix.Domain\Bimix.Domain.csproj" />
|
<ProjectReference Include="..\BimAI.Domain\BimAI.Domain.csproj" />
|
||||||
<ProjectReference Include="..\Bimix.Application\Bimix.Application.csproj" />
|
<ProjectReference Include="..\BimAI.Application\BimAI.Application.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
@using Bimix.UI.Shared.Services
|
@using BimAI.UI.Shared.Services
|
||||||
@inject AuthService AuthService
|
@inject AuthService AuthService
|
||||||
@inject NavigationManager Navigation
|
@inject NavigationManager Navigation
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
|
@using BimAI.UI.Shared.Services
|
||||||
@using Microsoft.Extensions.Configuration
|
@using Microsoft.Extensions.Configuration
|
||||||
@using Bimix.UI.Shared.Services
|
|
||||||
@inject IJSRuntime JS
|
@inject IJSRuntime JS
|
||||||
@inject IConfiguration Configuration
|
@inject IConfiguration Configuration
|
||||||
@inject AuthService AuthService
|
@inject AuthService AuthService
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<MudCard Class="login-card" Elevation="8">
|
<MudCard Class="login-card" Elevation="8">
|
||||||
<MudCardContent Class="pa-8 d-flex flex-column align-center">
|
<MudCardContent Class="pa-8 d-flex flex-column align-center">
|
||||||
<MudText Typo="Typo.h4" Class="mb-4">Witaj w Bimix</MudText>
|
<MudText Typo="Typo.h4" Class="mb-4">Witaj w BimAI</MudText>
|
||||||
<MudText Typo="Typo.body1" Class="mb-6 text-center">
|
<MudText Typo="Typo.body1" Class="mb-6 text-center">
|
||||||
Zaloguj się używając konta Google
|
Zaloguj się używając konta Google
|
||||||
</MudText>
|
</MudText>
|
||||||
@@ -1,12 +1,11 @@
|
|||||||
using Bimix.Application.DTOModels;
|
using BimAI.UI.Shared.Interfaces;
|
||||||
using Bimix.Application.DTOModels.Common;
|
using BimAI.UI.Shared.Services;
|
||||||
using Bimix.UI.Shared.Interfaces;
|
|
||||||
using Bimix.UI.Shared.Services;
|
|
||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using BimAI.Application.DTOModels;
|
||||||
|
using BimAI.Application.DTOModels.Common;
|
||||||
using MudBlazor;
|
using MudBlazor;
|
||||||
|
|
||||||
|
namespace BimAI.UI.Shared.Components;
|
||||||
namespace Bimix.UI.Shared.Components;
|
|
||||||
|
|
||||||
public partial class ProductListComponent : ComponentBase
|
public partial class ProductListComponent : ComponentBase
|
||||||
{
|
{
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using Bimix.UI.Shared.Services;
|
using BimAI.UI.Shared.Services;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
|
||||||
namespace Bimix.UI.Shared.Extensions;
|
namespace BimAI.UI.Shared.Extensions;
|
||||||
|
|
||||||
public static class ServiceCollectionExtensions
|
public static class ServiceCollectionExtensions
|
||||||
{
|
{
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Bimix.UI.Shared.Interfaces;
|
namespace BimAI.UI.Shared.Interfaces;
|
||||||
|
|
||||||
public interface IScannerService
|
public interface IScannerService
|
||||||
{
|
{
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
OnClick="ToggleDrawer"
|
OnClick="ToggleDrawer"
|
||||||
Class="mud-hidden-md-up"/>
|
Class="mud-hidden-md-up"/>
|
||||||
<MudSpacer/>
|
<MudSpacer/>
|
||||||
<MudText Typo="Typo.h6">Bimix</MudText>
|
<MudText Typo="Typo.h6">BimAI</MudText>
|
||||||
</MudAppBar>
|
</MudAppBar>
|
||||||
|
|
||||||
<MudDrawer @bind-Open="_drawerOpen"
|
<MudDrawer @bind-Open="_drawerOpen"
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), url('_content/Bimix.UI.Shared/images/login-background.jpg') no-repeat center;
|
background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), url('_content/BimAI.UI.Shared/images/login-background.jpg') no-repeat center;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
@page "/products"
|
@page "/products"
|
||||||
|
@using BimAI.UI.Shared.Components
|
||||||
|
|
||||||
<PageTitle>Produkty</PageTitle>
|
<PageTitle>Produkty</PageTitle>
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using Microsoft.JSInterop;
|
using Microsoft.JSInterop;
|
||||||
|
|
||||||
namespace Bimix.UI.Shared.Services;
|
namespace BimAI.UI.Shared.Services;
|
||||||
|
|
||||||
public class UserInfo
|
public class UserInfo
|
||||||
{
|
{
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Bimix.UI.Shared.Services;
|
namespace BimAI.UI.Shared.Services;
|
||||||
|
|
||||||
// TODO it's a good place for this file?
|
// TODO it's a good place for this file?
|
||||||
public class GoogleAuthConfig
|
public class GoogleAuthConfig
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
using Bimix.UI.Shared.Interfaces;
|
using BimAI.UI.Shared.Interfaces;
|
||||||
|
|
||||||
|
namespace BimAI.UI.Shared.Services;
|
||||||
|
|
||||||
public class NoOpScannerService : IScannerService
|
public class NoOpScannerService : IScannerService
|
||||||
{
|
{
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using Bimix.Application.DTOModels;
|
using BimAI.Application.DTOModels;
|
||||||
using Bimix.Application.DTOModels.Common;
|
using BimAI.Application.DTOModels.Common;
|
||||||
using Microsoft.AspNetCore.WebUtilities;
|
using Microsoft.AspNetCore.WebUtilities;
|
||||||
|
|
||||||
namespace Bimix.UI.Shared.Services;
|
namespace BimAI.UI.Shared.Services;
|
||||||
|
|
||||||
public class ProductService(HttpClient httpClient)
|
public class ProductService(HttpClient httpClient)
|
||||||
{
|
{
|
||||||
@@ -6,8 +6,7 @@
|
|||||||
@using static Microsoft.AspNetCore.Components.Web.RenderMode
|
@using static Microsoft.AspNetCore.Components.Web.RenderMode
|
||||||
@using Microsoft.AspNetCore.Components.Web.Virtualization
|
@using Microsoft.AspNetCore.Components.Web.Virtualization
|
||||||
@using Microsoft.JSInterop
|
@using Microsoft.JSInterop
|
||||||
@using Bimix.UI.Web
|
@using BimAI.UI.Shared
|
||||||
@using Bimix.UI.Web.Components
|
@using MudBlazor@using BimAI.Application.DTOModels
|
||||||
@using Bimix.UI.Shared
|
@using BimAI.Application.DTOModels.Common
|
||||||
@using Bimix.UI.Shared.Components
|
@using BimAI.UI.Shared.Components
|
||||||
@using MudBlazor
|
|
||||||
|
Before Width: | Height: | Size: 965 KiB After Width: | Height: | Size: 965 KiB |
@@ -28,7 +28,7 @@ async function handleAuthError(error, context = '') {
|
|||||||
const errorMessage = error?.message || error?.type || error?.toString() || 'Unknown error';
|
const errorMessage = error?.message || error?.type || error?.toString() || 'Unknown error';
|
||||||
const fullError = `${context}: ${errorMessage}`;
|
const fullError = `${context}: ${errorMessage}`;
|
||||||
console.error('Google Auth Error:', { context, error, fullError });
|
console.error('Google Auth Error:', { context, error, fullError });
|
||||||
await DotNet.invokeMethodAsync('Bimix.UI.Shared', 'OnGoogleSignInError', fullError);
|
await DotNet.invokeMethodAsync('Bimai.UI.Shared', 'OnGoogleSignInError', fullError);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchUserInfo(accessToken) {
|
async function fetchUserInfo(accessToken) {
|
||||||
@@ -39,7 +39,7 @@ async function fetchUserInfo(accessToken) {
|
|||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
const errorText = await response.text();
|
const errorText = await response.text();
|
||||||
console.error('Failed to fetch user info:', errorText);
|
console.error('Failed to fetch user info:', errorText);
|
||||||
await DotNet.invokeMethodAsync('Bimix.UI.Shared', 'OnGoogleSignInError',
|
await DotNet.invokeMethodAsync('Bimai.UI.Shared', 'OnGoogleSignInError',
|
||||||
`Failed to fetch user info: HTTP ${response.status}`);
|
`Failed to fetch user info: HTTP ${response.status}`);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -62,7 +62,7 @@ window.initGoogleSignIn = async function(clientId) {
|
|||||||
try {
|
try {
|
||||||
if (tokenResponse.error) {
|
if (tokenResponse.error) {
|
||||||
console.error('Token response error:', tokenResponse.error);
|
console.error('Token response error:', tokenResponse.error);
|
||||||
await DotNet.invokeMethodAsync('Bimix.UI.Shared', 'OnGoogleSignInError',
|
await DotNet.invokeMethodAsync('Bimai.UI.Shared', 'OnGoogleSignInError',
|
||||||
tokenResponse.error);
|
tokenResponse.error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -70,7 +70,7 @@ window.initGoogleSignIn = async function(clientId) {
|
|||||||
const userInfo = await fetchUserInfo(tokenResponse.access_token);
|
const userInfo = await fetchUserInfo(tokenResponse.access_token);
|
||||||
if (!userInfo) return;
|
if (!userInfo) return;
|
||||||
|
|
||||||
await DotNet.invokeMethodAsync('Bimix.UI.Shared', 'OnGoogleSignInSuccess',
|
await DotNet.invokeMethodAsync('Bimai.UI.Shared', 'OnGoogleSignInSuccess',
|
||||||
tokenResponse.access_token,
|
tokenResponse.access_token,
|
||||||
userInfo.name || '',
|
userInfo.name || '',
|
||||||
userInfo.email || '',
|
userInfo.email || '',
|
||||||
@@ -78,7 +78,7 @@ window.initGoogleSignIn = async function(clientId) {
|
|||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Callback error:', error);
|
console.error('Callback error:', error);
|
||||||
await DotNet.invokeMethodAsync('Bimix.UI.Shared', 'OnGoogleSignInError',
|
await DotNet.invokeMethodAsync('Bimai.UI.Shared', 'OnGoogleSignInError',
|
||||||
error.message || 'Unknown callback error');
|
error.message || 'Unknown callback error');
|
||||||
} finally {
|
} finally {
|
||||||
isSigningIn = false;
|
isSigningIn = false;
|
||||||
@@ -86,7 +86,7 @@ window.initGoogleSignIn = async function(clientId) {
|
|||||||
},
|
},
|
||||||
error_callback: async (error) => {
|
error_callback: async (error) => {
|
||||||
console.error('OAuth flow error:', error);
|
console.error('OAuth flow error:', error);
|
||||||
await DotNet.invokeMethodAsync('Bimix.UI.Shared', 'OnGoogleSignInError',
|
await DotNet.invokeMethodAsync('Bimai.UI.Shared', 'OnGoogleSignInError',
|
||||||
error.type || 'OAuth flow error');
|
error.type || 'OAuth flow error');
|
||||||
isSigningIn = false;
|
isSigningIn = false;
|
||||||
}
|
}
|
||||||
@@ -95,7 +95,7 @@ window.initGoogleSignIn = async function(clientId) {
|
|||||||
return googleClient;
|
return googleClient;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Initiaxcrun xctrace list deviceslization error:', error);
|
console.error('Initiaxcrun xctrace list deviceslization error:', error);
|
||||||
await DotNet.invokeMethodAsync('Bimix.UI.Shared', 'OnGoogleSignInError',
|
await DotNet.invokeMethodAsync('Bimai.UI.Shared', 'OnGoogleSignInError',
|
||||||
error.message || 'Failed to initialize Google Sign-In');
|
error.message || 'Failed to initialize Google Sign-In');
|
||||||
isSigningIn = false;
|
isSigningIn = false;
|
||||||
}
|
}
|
||||||
@@ -109,7 +109,7 @@ window.requestGoogleSignIn = async function() {
|
|||||||
|
|
||||||
if (!googleClient) {
|
if (!googleClient) {
|
||||||
console.error('Google Sign-In not initialized');
|
console.error('Google Sign-In not initialized');
|
||||||
await DotNet.invokeMethodAsync('Bimix.UI.Shared', 'OnGoogleSignInError',
|
await DotNet.invokeMethodAsync('Bimai.UI.Shared', 'OnGoogleSignInError',
|
||||||
'Google Sign-In not initialized. Call initGoogleSignIn first.');
|
'Google Sign-In not initialized. Call initGoogleSignIn first.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Bimix.UI.Shared\Bimix.UI.Shared.csproj" />
|
<ProjectReference Include="..\BimAI.UI.Shared\BimAI.UI.Shared.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -8,13 +8,13 @@
|
|||||||
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet" />
|
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet" />
|
||||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
|
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
|
||||||
<link href="_content/MudBlazor/MudBlazor.min.css" rel="stylesheet" />
|
<link href="_content/MudBlazor/MudBlazor.min.css" rel="stylesheet" />
|
||||||
<link href="Bimix.UI.Web.styles.css" rel="stylesheet" />
|
<link href="BimAI.UI.Web.styles.css" rel="stylesheet" />
|
||||||
<script src="https://accounts.google.com/gsi/client" async defer></script>
|
<script src="https://accounts.google.com/gsi/client" async defer></script>
|
||||||
<HeadOutlet />
|
<HeadOutlet />
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<Bimix.UI.Shared.Components.Routes @rendermode="InteractiveServer" />
|
<BimAI.UI.Shared.Components.Routes @rendermode="InteractiveServer" />
|
||||||
|
|
||||||
|
|
||||||
<div id="blazor-error-ui">
|
<div id="blazor-error-ui">
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
<script src="_framework/blazor.web.js"></script>
|
<script src="_framework/blazor.web.js"></script>
|
||||||
<script src="_content/MudBlazor/MudBlazor.min.js"></script>
|
<script src="_content/MudBlazor/MudBlazor.min.js"></script>
|
||||||
<script src="_content/Bimix.UI.Shared/js/auth.js"></script>
|
<script src="_content/BimAI.UI.Shared/js/auth.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -6,6 +6,8 @@
|
|||||||
@using static Microsoft.AspNetCore.Components.Web.RenderMode
|
@using static Microsoft.AspNetCore.Components.Web.RenderMode
|
||||||
@using Microsoft.AspNetCore.Components.Web.Virtualization
|
@using Microsoft.AspNetCore.Components.Web.Virtualization
|
||||||
@using Microsoft.JSInterop
|
@using Microsoft.JSInterop
|
||||||
@using Bimix.UI.Shared
|
@using BimAI.UI.Web
|
||||||
@using Bimix.UI.Shared.Components
|
@using BimAI.UI.Web.Components
|
||||||
|
@using BimAI.UI.Shared
|
||||||
|
@using BimAI.UI.Shared.Components
|
||||||
@using MudBlazor
|
@using MudBlazor
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
using Bimix.UI.Shared;
|
using BimAI.UI.Shared;
|
||||||
using Bimix.UI.Shared.Extensions;
|
using BimAI.UI.Shared.Extensions;
|
||||||
using Bimix.UI.Shared.Interfaces;
|
using BimAI.UI.Shared.Interfaces;
|
||||||
using Bimix.UI.Shared.Services;
|
using BimAI.UI.Shared.Services;
|
||||||
using Bimix.UI.Web.Components;
|
using BimAI.UI.Web.Components;
|
||||||
using MudBlazor.Services;
|
using MudBlazor.Services;
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
11
BimAI.UI.Web/appsettings.Development.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.AspNetCore": "Warning"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"GoogleAuth": {
|
||||||
|
"ClientId": "1037727384847-t1l2au6du34kdckamro81guklk17cjah.apps.googleusercontent.com"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,19 +3,19 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
|||||||
# Visual Studio Version 17
|
# Visual Studio Version 17
|
||||||
VisualStudioVersion = 17.0.31903.59
|
VisualStudioVersion = 17.0.31903.59
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bimix.Domain", "Bimix.Domain\Bimix.Domain.csproj", "{190E3B1F-C91F-430F-BE32-4E7221574D36}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BimAI.Domain", "BimAI.Domain\BimAI.Domain.csproj", "{190E3B1F-C91F-430F-BE32-4E7221574D36}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bimix.Application", "Bimix.Application\Bimix.Application.csproj", "{2E61A11C-851F-47D6-A8B6-329078CF1AFC}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BimAI.Application", "BimAI.Application\BimAI.Application.csproj", "{2E61A11C-851F-47D6-A8B6-329078CF1AFC}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bimix.Infrastructure", "Bimix.Infrastructure\Bimix.Infrastructure.csproj", "{1049E8B5-6965-4CCD-A989-88E44D40BF48}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BimAI.Infrastructure", "BimAI.Infrastructure\BimAI.Infrastructure.csproj", "{1049E8B5-6965-4CCD-A989-88E44D40BF48}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bimix.API", "Bimix.API\Bimix.API.csproj", "{02FF9A1C-6D22-4CD1-8FE6-DD5BCDD621DA}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BimAI.API", "BimAI.API\BimAI.API.csproj", "{02FF9A1C-6D22-4CD1-8FE6-DD5BCDD621DA}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bimix.UI.Shared", "Bimix.UI.Shared\Bimix.UI.Shared.csproj", "{0EB8CFFF-97BA-48D1-BEC1-2DFD6C934946}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BimAI.UI.Shared", "BimAI.UI.Shared\BimAI.UI.Shared.csproj", "{0EB8CFFF-97BA-48D1-BEC1-2DFD6C934946}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bimix.UI.Web", "Bimix.UI.Web\Bimix.UI.Web.csproj", "{7ACBFE74-E72C-4033-9172-30512233A518}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BimAI.UI.Web", "BimAI.UI.Web\BimAI.UI.Web.csproj", "{7ACBFE74-E72C-4033-9172-30512233A518}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bimix.UI.Mobile", "Bimix.UI.Mobile\Bimix.UI.Mobile.csproj", "{12FB8E56-08C1-47CF-B0FC-4BE9F01F020A}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BimAI.UI.Mobile", "BimAI.UI.Mobile\BimAI.UI.Mobile.csproj", "{12FB8E56-08C1-47CF-B0FC-4BE9F01F020A}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
@Bimix.API_HostAddress = http://localhost:5090
|
|
||||||
|
|
||||||
GET {{Bimix.API_HostAddress}}/weatherforecast/
|
|
||||||
Accept: application/json
|
|
||||||
|
|
||||||
###
|
|
||||||