ningshuxia
2024-05-27 f51ccee7e76f598c1f718190d216f96b5ea1ca46
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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;
        }
 
 
 
    }
}