41 lines
1.4 KiB
C#
41 lines
1.4 KiB
C#
// src/Webshop.Api/Controllers/Public/ShopInfoController.cs
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using System.Threading.Tasks;
|
|
using Webshop.Application.DTOs.Shop;
|
|
using Webshop.Application.Services.Public;
|
|
|
|
namespace Webshop.Api.Controllers.Public
|
|
{
|
|
/// <summary>
|
|
/// API-Endpunkte zum Abrufen öffentlicher Shop-Informationen.
|
|
/// </summary>
|
|
[ApiController]
|
|
[Route("api/v1/public/[controller]")]
|
|
[AllowAnonymous]
|
|
public class ShopInfoController : ControllerBase
|
|
{
|
|
private readonly IShopInfoService _shopInfoService;
|
|
|
|
public ShopInfoController(IShopInfoService shopInfoService)
|
|
{
|
|
_shopInfoService = shopInfoService;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ruft die öffentlichen Stammdaten des Shops ab.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Diese Informationen sind für jeden Besucher sichtbar und werden typischerweise im Footer, auf der Kontaktseite oder im Impressum verwendet.
|
|
/// </remarks>
|
|
[HttpGet]
|
|
[ProducesResponseType(typeof(PublicShopInfoDto), StatusCodes.Status200OK)]
|
|
public async Task<IActionResult> GetPublicShopInfo()
|
|
{
|
|
var result = await _shopInfoService.GetPublicShopInfoAsync();
|
|
// Dieser Service-Aufruf ist so konzipiert, dass er immer ein erfolgreiches Ergebnis liefert.
|
|
return Ok(result.Value);
|
|
}
|
|
}
|
|
} |