Files
tnb.server/app/Tnb.Apps/AppMenuService.cs
2024-04-23 10:16:16 +08:00

48 lines
1.2 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using JNPF.Apps.Entitys.Dto;
using JNPF.Apps.Interfaces;
using JNPF.Common.Security;
using JNPF.DependencyInjection;
using JNPF.DynamicApiController;
using Mapster;
using Microsoft.AspNetCore.Mvc;
namespace JNPF.Apps;
/// <summary>
/// App菜单
/// 版 本V3.2
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2021-06-01 .
/// </summary>
[ApiDescriptionSettings(Tag = "App", Name = "Menu", Order = 800)]
[Route("api/App/[controller]")]
public class AppMenuService : IDynamicApiController, ITransient
{
/// <summary>
/// App常用数据.
/// </summary>
private readonly IAppDataService _appDataService;
/// <summary>
/// 初始化一个<see cref="AppMenuService"/>类型的新实例.
/// </summary>
public AppMenuService(IAppDataService appDataService)
{
_appDataService = appDataService;
}
#region Get
/// <summary>
/// 获取菜单列表.
/// </summary>
/// <returns></returns>
[HttpGet("")]
public async Task<dynamic> GetList(string keyword)
{
List<AppMenuListOutput>? list = (await _appDataService.GetAppMenuList(keyword)).Adapt<List<AppMenuListOutput>>();
return new { list = list.ToTree("-1") };
}
#endregion
}