using YBEE.EQM.Core;

namespace YBEE.EQM.Application;

/// <summary>
/// 字典数据
/// </summary>
[ApiDescriptionSettings(Name = "sys-dict-data")]
[Route("sys/dict/data")]
public class SysDictDataAppService(ISysDictDataService dictDataService) : IDynamicApiController
{
    /// <summary>
    /// 获取所有字典列表
    /// </summary>
    /// <returns></returns>
    [AllowAnonymous]
    [DisableOpLog]
    public async Task<List<SysDictDataOutput>> GetAllList()
    {
        return await dictDataService.GetAllList();
    }

    /// <summary>
    /// 通过字典类型ID获取字典列表
    /// </summary>
    /// <param name="dictTypeId"></param>
    /// <returns></returns>
    [AllowAnonymous]
    [DisableOpLog]
    public async Task<List<SysDictDataOutput>> GetListByDictTypeId(int dictTypeId)
    {
        return await dictDataService.GetListByDictTypeId(dictTypeId);
    }
}