// src/Webshop.Api/Controllers/Admin/AdminShippingMethodsController.cs using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Threading.Tasks; using Webshop.Application.DTOs.Shipping; using Webshop.Application.Services.Admin; namespace Webshop.Api.Controllers.Admin { [ApiController] [Route("api/v1/admin/[controller]")] [Authorize(Roles = "Admin")] public class AdminShippingMethodsController : ControllerBase { private readonly IAdminShippingMethodService _shippingMethodService; public AdminShippingMethodsController(IAdminShippingMethodService shippingMethodService) { _shippingMethodService = shippingMethodService; } [HttpPost] public async Task> CreateShippingMethod([FromBody] ShippingMethodDto shippingMethodDto) { // Implementierung im AdminShippingMethodService var createdMethod = await _shippingMethodService.CreateAsync(shippingMethodDto); return CreatedAtAction(nameof(GetShippingMethodById), new { id = createdMethod.Id }, createdMethod); } [HttpGet("{id}")] public async Task> GetShippingMethodById(Guid id) { // ... return Ok(); } } }