From 31087a57c98536de963762111dec23ef7c41f7d5 Mon Sep 17 00:00:00 2001 From: Polianin Nikita Date: Sat, 24 Aug 2024 02:27:05 +0300 Subject: [PATCH] feat: add cache for api --- Endpoint/Controllers/V1/CampusController.cs | 1 + Endpoint/Controllers/V1/DisciplineController.cs | 1 + Endpoint/Controllers/V1/FacultyController.cs | 1 + Endpoint/Controllers/V1/GroupController.cs | 1 + Endpoint/Controllers/V1/LectureHallController.cs | 1 + Endpoint/Controllers/V1/ProfessorController.cs | 1 + 6 files changed, 6 insertions(+) diff --git a/Endpoint/Controllers/V1/CampusController.cs b/Endpoint/Controllers/V1/CampusController.cs index 4f4f101..a5dce32 100644 --- a/Endpoint/Controllers/V1/CampusController.cs +++ b/Endpoint/Controllers/V1/CampusController.cs @@ -12,6 +12,7 @@ using System.Threading.Tasks; namespace Mirea.Api.Endpoint.Controllers.V1; [ApiVersion("1.0")] +[CacheMaxAge(true)] public class CampusController(IMediator mediator) : BaseController { /// diff --git a/Endpoint/Controllers/V1/DisciplineController.cs b/Endpoint/Controllers/V1/DisciplineController.cs index 1de1136..7ab686a 100644 --- a/Endpoint/Controllers/V1/DisciplineController.cs +++ b/Endpoint/Controllers/V1/DisciplineController.cs @@ -12,6 +12,7 @@ using System.Threading.Tasks; namespace Mirea.Api.Endpoint.Controllers.V1; [ApiVersion("1.0")] +[CacheMaxAge(true)] public class DisciplineController(IMediator mediator) : BaseController { /// diff --git a/Endpoint/Controllers/V1/FacultyController.cs b/Endpoint/Controllers/V1/FacultyController.cs index 9652551..7d71fd1 100644 --- a/Endpoint/Controllers/V1/FacultyController.cs +++ b/Endpoint/Controllers/V1/FacultyController.cs @@ -12,6 +12,7 @@ using System.Threading.Tasks; namespace Mirea.Api.Endpoint.Controllers.V1; [ApiVersion("1.0")] +[CacheMaxAge(true)] public class FacultyController(IMediator mediator) : BaseController { /// diff --git a/Endpoint/Controllers/V1/GroupController.cs b/Endpoint/Controllers/V1/GroupController.cs index c12f3da..6197047 100644 --- a/Endpoint/Controllers/V1/GroupController.cs +++ b/Endpoint/Controllers/V1/GroupController.cs @@ -13,6 +13,7 @@ using System.Threading.Tasks; namespace Mirea.Api.Endpoint.Controllers.V1; [ApiVersion("1.0")] +[CacheMaxAge(true)] public class GroupController(IMediator mediator) : BaseController { private static int GetCourseNumber(string groupName) diff --git a/Endpoint/Controllers/V1/LectureHallController.cs b/Endpoint/Controllers/V1/LectureHallController.cs index c6e67b8..a5e62ba 100644 --- a/Endpoint/Controllers/V1/LectureHallController.cs +++ b/Endpoint/Controllers/V1/LectureHallController.cs @@ -12,6 +12,7 @@ using System.Threading.Tasks; namespace Mirea.Api.Endpoint.Controllers.V1; [ApiVersion("1.0")] +[CacheMaxAge(true)] public class LectureHallController(IMediator mediator) : BaseController { /// diff --git a/Endpoint/Controllers/V1/ProfessorController.cs b/Endpoint/Controllers/V1/ProfessorController.cs index 3093a38..7e3d8b6 100644 --- a/Endpoint/Controllers/V1/ProfessorController.cs +++ b/Endpoint/Controllers/V1/ProfessorController.cs @@ -12,6 +12,7 @@ using System.Threading.Tasks; namespace Mirea.Api.Endpoint.Controllers.V1; [ApiVersion("1.0")] +[CacheMaxAge(true)] public class ProfessorController(IMediator mediator) : BaseController { ///