pr1/presence/presence_api/Controllers/GroupController.cs

27 lines
706 B
C#
Raw Normal View History

2024-12-23 09:12:26 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
2024-11-20 17:50:01 +00:00
using Microsoft.AspNetCore.Mvc;
2024-12-23 09:12:26 +00:00
using presence.domain.Models;
using presence.domain.UseCase;
namespace presence.presence_api.Controllers;
2024-11-20 17:50:01 +00:00
[ApiController]
2024-12-23 09:12:26 +00:00
[Route("api/[controller]")]
2024-11-20 17:50:01 +00:00
public class GroupController : ControllerBase
{
private readonly GroupUseCase _groupUseCase;
public GroupController(GroupUseCase groupUseCase)
{
_groupUseCase = groupUseCase;
}
2024-12-23 09:12:26 +00:00
2024-11-20 17:50:01 +00:00
[HttpGet]
2024-12-23 09:12:26 +00:00
public ActionResult<IEnumerable<Group>> GetAllGroups() //Метод контроллера для получения всех групп
2024-11-20 17:50:01 +00:00
{
2024-12-05 09:30:01 +00:00
return Ok(_groupUseCase.GetAllGroups());
2024-11-20 17:50:01 +00:00
}
2024-12-23 09:12:26 +00:00
}