Fix #4936: add the cookie consent theme control.

This commit is contained in:
Ben
2025-02-22 09:49:33 +08:00
parent 7a4ea8cf1b
commit 982f3b1943
14 changed files with 322 additions and 0 deletions

View File

@ -0,0 +1,34 @@
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();
}
}
}