This commit is contained in:
Tizian.Breuch
2025-07-23 21:08:30 +02:00
parent d20a6d6ae6
commit ce69373adb
85 changed files with 2311 additions and 332 deletions

View File

@@ -0,0 +1,17 @@
// Auto-generiert von CreateWebshopFiles.ps1
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Webshop.Application.Services.Public
{
public class CategoryService : ICategoryService
{
// Fügen Sie hier Abhängigkeiten per Dependency Injection hinzu (z.B. Repositories)
// public CategoryService(IYourRepository repository) { }
// Fügen Sie hier Service-Methoden hinzu
}
}

View File

@@ -0,0 +1,16 @@
// Auto-generiert von CreateWebshopFiles.ps1
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Webshop.Application.DTOs;
using Webshop.Application.DTOs.Auth;
using Webshop.Application.DTOs.Users;
namespace Webshop.Application.Services.Public
{
public interface ICategoryService
{
// Fügen Sie hier Methodensignaturen hinzu
}
}

View File

@@ -0,0 +1,14 @@
// src/Webshop.Application/Services/Public/IProductService.cs
using System.Collections.Generic;
using System.Threading.Tasks;
using Webshop.Application.DTOs; // ProductDto
namespace Webshop.Application.Services.Public
{
public interface IProductService
{
Task<IEnumerable<ProductDto>> GetAllProductsAsync();
// Task<ProductDto?> GetProductByIdAsync(Guid id); // Wenn Sie eine einzelne öffentliche Produktansicht brauchen
// Task<ProductDto> CreateProductAsync(ProductDto productDto); // Nur wenn Public Service auch Erstellung erlaubt
}
}

View File

@@ -1,12 +1,15 @@
// src/Webshop.Application/Services/Public/ProductService.cs
using Webshop.Application.DTOs; // ProductDto
// Auto-generiert von CreateWebshopFiles.ps1
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Webshop.Application.DTOs;
using Webshop.Domain.Interfaces;
using System.Collections.Generic; // Sicherstellen, dass für IEnumerable vorhanden
using Webshop.Domain.Entities;
namespace Webshop.Application.Services.Public
{
public class ProductService // Sie haben den Namen "ProductService" beibehalten
public class ProductService : IProductService
{
private readonly IProductRepository _productRepository;
@@ -15,22 +18,9 @@ namespace Webshop.Application.Services.Public
_productRepository = productRepository;
}
public async Task<IEnumerable<ProductDto>> GetAllProductsAsync()
{
var productsFromDb = await _productRepository.GetAllProductsAsync();
return productsFromDb.Select(p => new ProductDto
{
Id = p.Id,
Name = p.Name,
Description = p.Description,
Price = p.Price,
SKU = p.SKU,
IsActive = p.IsActive,
IsInStock = p.IsInStock,
StockQuantity = p.StockQuantity,
ImageUrl = p.ImageUrl
}).ToList();
}
// HIER KOMMT DER VORHERIGE PRODUCTSERVICE CODE HIN (GetAllProductsAsync, CreateProductAsync etc.)
// Hier sind Platzhalter-Implementierungen, die Sie durch den vollständigen Code ersetzen müssen:
public async Task<IEnumerable<ProductDto>> GetAllProductsAsync() { return new List<ProductDto>(); }
public async Task<ProductDto> CreateProductAsync(ProductDto productDto) { return null; }
}
}
}