api命名规范,字典常量规范
This commit is contained in:
@@ -7,15 +7,14 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using SqlSugar;
|
||||
using Tnb.BasicData.Entitys;
|
||||
using Tnb.BasicData.Entitys.Entity;
|
||||
using Tnb.BasicData.Entitys.Const;
|
||||
|
||||
namespace Tnb.BasicData
|
||||
{
|
||||
/// <summary>
|
||||
/// 物料档案
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Tag = "BasicData", Name = "Material", Order = 700)]
|
||||
[Route("api/basic/[controller]")]
|
||||
[ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 1102)]
|
||||
[Route("api/[area]/[controller]/[action]")]
|
||||
public class MaterialService : IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly ISqlSugarRepository<BasMaterial> _repository;
|
||||
@@ -30,11 +29,11 @@ namespace Tnb.BasicData
|
||||
_dictionaryDataService = dictionaryDataService;
|
||||
}
|
||||
|
||||
[HttpPost("[action]")]
|
||||
[HttpPost]
|
||||
public async Task<Dictionary<string,string>> GetEbomVersionAndRouteName(string materialId)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
var dic = await _dictionaryDataService.GetDicByKey(DicTypeKey.MeasurementUnit);
|
||||
var dic = await _dictionaryDataService.GetDicByKey(DictConst.MeasurementUnit);
|
||||
// var momDbLink = await _repository.AsSugarClient().Queryable<DbLinkEntity>().FirstAsync(x => x.FullName == DbName.TNBMON);
|
||||
// if (momDbLink != null)
|
||||
// {
|
||||
@@ -58,12 +57,12 @@ namespace Tnb.BasicData
|
||||
};
|
||||
}
|
||||
|
||||
[HttpPost("[action]")]
|
||||
[HttpPost]
|
||||
public async Task<List<ElementSelectDto>> GetMaterialUnits(string materialId)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
|
||||
var type = await db.Queryable<DictionaryTypeEntity>().Where(x => x.EnCode == DicTypeKey.MeasurementUnit)
|
||||
var type = await db.Queryable<DictionaryTypeEntity>().Where(x => x.EnCode == DictConst.MeasurementUnit)
|
||||
.SingleAsync();
|
||||
string typeId = type?.Id;
|
||||
var queryable1 = db.Queryable<BasMaterial>()
|
||||
|
||||
Reference in New Issue
Block a user