28 lines
909 B
C#
28 lines
909 B
C#
using JNPF.DependencyInjection;
|
|
using JNPF.DynamicApiController;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using SqlSugar;
|
|
using Tnb.EquipMgr.Entities;
|
|
using Tnb.EquipMgr.Interfaces;
|
|
|
|
namespace Tnb.EquipMgr
|
|
{
|
|
/// <summary>
|
|
/// 模具库房服务
|
|
/// </summary>
|
|
[ApiDescriptionSettings(Tag = ModuleConsts.Tag, Area = ModuleConsts.Area, Order = 700)]
|
|
[Route("api/[area]/[controller]/[action]")]
|
|
public class ToolMoldHouseService : IToolMoldHouseService, IDynamicApiController, ITransient
|
|
{
|
|
private readonly ISqlSugarClient _db;
|
|
public ToolMoldHouseService(ISqlSugarRepository<ToolWarehouse> repository)
|
|
{
|
|
_db = repository.AsSugarClient();
|
|
}
|
|
public async Task<Dictionary<string, object>> GetHouseDictionary()
|
|
{
|
|
return await _db.Queryable<ToolWarehouse>().ToDictionaryAsync(x => x.id, x => x.whcode);
|
|
}
|
|
}
|
|
}
|