using Build_God_Api.DB; using Build_God_Api.Services; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; namespace Build_God_Api.Controllers { [ApiController] [Route("api/god/[controller]")] public class LevelController(ILevelService service) : ControllerBase { private readonly ILevelService service = service; [HttpPost] [Authorize(Roles = "admin")] public async Task> Add([FromBody] Level item) { return await service.Add(item); } [HttpDelete("{id}")] [Authorize(Roles = "admin")] public async Task> Delete(int id) { return await service.Delete(id); } [HttpPut] [Authorize(Roles = "admin")] public async Task> Update([FromBody] Level item) { return await service.Update(item); } [HttpGet("all")] [Authorize] public async Task>> GetAll() { return await service.GetAll(); } } }