feat: added implementation of HeadHunter hook for user registration

This commit is contained in:
2025-07-12 19:51:34 +03:00
parent 6ffbe67d0d
commit dee7942f20
7 changed files with 184 additions and 7 deletions

View File

@@ -0,0 +1,23 @@
using JOBot.Backend.Services;
using Microsoft.AspNetCore.Mvc;
namespace JOBot.Backend.Controllers;
[ApiController]
[Route("auth")]
public class HeadHunterHookController(HeadHunterService hhService)
: ControllerBase
{
[HttpGet]
public async Task<IActionResult> Get(int userId, string? error, string authorizationCode)
{
var res = await hhService.AuthUser(userId, authorizationCode, error);
return res switch
{
HeadHunterService.Status.Success => Ok("Авторизация завершена успешно. Вернитесь в Telegram для продолжения."),
HeadHunterService.Status.UserNotFoundError => NotFound("Пользователь не найден."),
_ => BadRequest("Авторизация завершена с ошибкой. Вернитесь в Telegram для продолжения.") //TODO: Add resource
};
}
}