AuthSystem

This commit is contained in:
Artemy
2025-06-18 12:08:21 +07:00
parent de8d97e5bf
commit 2c2c2b805c
12 changed files with 230 additions and 10 deletions
+31
View File
@@ -0,0 +1,31 @@
using Govor.Core.Services;
using Microsoft.AspNetCore.Mvc;
namespace Govor.API.Controllers;
[ApiController]
[Route("invite")]
public class InviteController : ControllerBase
{
private readonly IGroupService _groupService;
public InviteController(IGroupService groupService)
{
_groupService = groupService;
}
[HttpGet("{code}")]
public IActionResult JoinGroup(string code)
{
var group = _groupService.GetGroupByInvite(code);
if (group == null) return NotFound();
// Вернуть инфу, которая откроется в MAUI-клиенте
return Ok(new
{
groupId = group.Id,
name = group.Name,
isChannel = group.IsChannel
});
}
}