mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 11:44:56 +00:00
AuthSystem
This commit is contained in:
@@ -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
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user