This repository has been archived on 2025-05-14. You can view files and clone it, but cannot push or open issues or pull requests.

35 lines
920 B
C#

using Microsoft.AspNetCore.Mvc;
using Oqtane.Models;
using Oqtane.Shared;
using System;
using System.Globalization;
using Oqtane.Infrastructure;
using Oqtane.Services;
using System.Threading.Tasks;
namespace Oqtane.Controllers
{
[Route(ControllerRoutes.ApiRoute)]
public class CookieConsentController : Controller
{
private readonly ICookieConsentService _cookieConsentService;
public CookieConsentController(ICookieConsentService cookieConsentService)
{
_cookieConsentService = cookieConsentService;
}
[HttpGet("CanTrack")]
public async Task<bool> CanTrack()
{
return await _cookieConsentService.CanTrackAsync();
}
[HttpGet("CreateConsentCookie")]
public async Task<string> CreateConsentCookie()
{
return await _cookieConsentService.CreateConsentCookieAsync();
}
}
}