//using FrameworkBLL.Menu; //using FrameworkBLL.User; //using FrameworkSL.Controllers.User; //using GB5Shared.DaprCache; //using GB5Shared.DTO.Framework.Login; //using GB5Shared.DTO.Framework.ResponseStandard; //using GB5Shared.DTO.Framework.SuccessORError; //using GoodBooks.FrameworkBLL.Authentication; //using k8s.KubeConfigModels; //using Microsoft.AspNetCore.Mvc; //using static GB5Shared.GB5Constant.Constant; //namespace FrameworkSL.Controllers.Menu //{ // /// // /// Provides menu services. // /// // [ApiController] // [Route("[controller]")] // public class MenuService : ControllerBase // { // private readonly IMenuBLL _MenuBLL; // private readonly Dapr.Client.DaprClient _daprClient; // /// // /// Initializes a new instance of the class. // /// // /// The Menu BLL. // public MenuService(IMenuBLL IMenuBLL , Dapr.Client.DaprClient DaprClient) // { // _MenuBLL = IMenuBLL; // _daprClient = DaprClient; // } // /// // /// Gets the menu for a specific user and module. // /// // /// The ID of the user. // /// The ID of the module. // /// The login DTO in JSON format. // /// A response containing the menu tree. // [HttpGet("GetMenuForUserModule")] // public async Task> GetMenuForUserModule(int UserId, int ModuleId, [FromHeader(Name = "Login")] string loginDtoJson) // { // CacheKeyGeneration Key = new(); // try // { // var LoginDTO = Newtonsoft.Json.JsonConvert.DeserializeObject(loginDtoJson); // // string key = Key.KeyGeneration(new { UserId, ModuleId }, EntityConstant.MENU, CacheKeyLevel.UserLevel, LoginDTO!); // // string CachedJson = await _daprClient.GetStateAsync("statestore", key); // // if (CachedJson == null) // //{ // string Json = await _MenuBLL.GetMenuForUserModule(UserId, ModuleId, LoginDTO!); // var metadata = new Dictionary // { // { "ttlInSeconds", "60" } // }; // // await _daprClient.SaveStateAsync("statestore", key, Json, metadata: metadata); // return await FrameworkSL.Middleware.ResponseStandard.Response.CreateSuccessResponse(Json); // //} // //return await FrameworkSL.Middleware.ResponseStandard.Response.CreateSuccessResponse(CachedJson); // } // catch (Exception ex) // { // return await FrameworkSL.Middleware.ResponseStandard.Response.CreateExceptionError( // ex, ex.Message, 500 // ); // } // } // } //}