namespace Yw.Application
|
{
|
/// <summary>
|
/// Product
|
/// </summary>
|
[Route("Auth/Product/Std")]
|
[ApiDescriptionSettings("Auth", Name = "产品(Std)", Order = 9990)]
|
public class Product_StdController : IDynamicApiController
|
{
|
|
/// <summary>
|
/// 获取所有
|
/// </summary>
|
[Route("GetAll@V1.0")]
|
[HttpGet]
|
public List<ProductStdDto> GetAll()
|
{
|
var keyContent = "Auth_Product_Std_GetAll";
|
var cacheKey = MemoryCacheKeyHelper.GetKey(MemoryCacheKey.WebApiLevel, MemoryCacheKey.Module, keyContent);
|
|
var vm_list = MemoryCacheHelper.GetSet(cacheKey, () =>
|
{
|
var allList = new Service.Product().GetAll();
|
Service.Product.PublishCache(cacheKey);
|
allList = allList?.Where(x => x.UseStatus == Model.eUseStatus.Enable).ToList();
|
var vmList = allList?.Select(x => new ProductStdDto(x)).ToList();
|
return vmList;
|
}, Yw.Service.ConfigHelper.CacheLevel1);
|
return vm_list;
|
}
|
|
|
|
}
|
}
|