shop info

This commit is contained in:
Tizian.Breuch
2025-08-12 11:07:15 +02:00
parent 0a43b1d7e8
commit 1692fe198e
13 changed files with 387 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
// src/Webshop.Api/Controllers/Admin/AdminShopInfoController.cs
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using Webshop.Application.DTOs.Shop;
using Webshop.Application.Services.Admin;
namespace Webshop.Api.Controllers.Admin
{
[ApiController]
[Route("api/v1/admin/[controller]")]
[Authorize(Roles = "Admin")]
public class AdminShopInfoController : ControllerBase
{
private readonly IAdminShopInfoService _shopInfoService;
public AdminShopInfoController(IAdminShopInfoService shopInfoService)
{
_shopInfoService = shopInfoService;
}
[HttpGet]
public async Task<ActionResult<AdminShopInfoDto>> GetShopInfo()
{
var info = await _shopInfoService.GetShopInfoAsync();
return Ok(info);
}
[HttpPut]
public async Task<IActionResult> UpdateShopInfo([FromBody] AdminShopInfoDto shopInfoDto)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
await _shopInfoService.UpdateShopInfoAsync(shopInfoDto);
return NoContent();
}
}
}