2024-08-20 17:20:58 +08:00
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
|
|
|
|
namespace asg_form.Controllers
|
2024-08-17 15:38:44 +08:00
|
|
|
|
{
|
2024-08-20 17:20:58 +08:00
|
|
|
|
public class InviteReferee : ControllerBase
|
|
|
|
|
{
|
|
|
|
|
private readonly RoleManager<Role> roleManager;
|
|
|
|
|
private readonly UserManager<User> userManager;
|
|
|
|
|
public InviteReferee(
|
|
|
|
|
RoleManager<Role> roleManager, UserManager<User> userManager)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
this.roleManager = roleManager;
|
|
|
|
|
this.userManager = userManager;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Route("api/v1/Invite")]
|
|
|
|
|
[HttpGet]
|
|
|
|
|
[Authorize]
|
|
|
|
|
public async Task<ActionResult<object>> GetReferee([FromBody] long Inviteeid)
|
2024-08-17 15:38:44 +08:00
|
|
|
|
{
|
2024-08-20 17:20:58 +08:00
|
|
|
|
string Invitorid = this.User.FindFirst(ClaimTypes.NameIdentifier)!.Value;
|
|
|
|
|
var user = await userManager.FindByIdAsync(Invitorid);
|
|
|
|
|
|
2024-08-17 15:38:44 +08:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|