namespace Yw.Application { /// /// Project /// [Route("Auth/Project/Std")] [ApiDescriptionSettings("Auth", Name = "项目(Std)", Order = 7990)] public class Project_StdController : IDynamicApiController { /// /// 通过 ProductID 获取 /// [Route("GetByProductID@V1.0")] [HttpGet] public List GetByProductID([FromQuery][Required] ProductIDInput input) { var productId = input.ProductID; var keyContent = $"Auth_Project_Std_GetByProductID_{productId}"; var cacheKey = MemoryCacheKeyHelper.GetKey(MemoryCacheKey.WebApiLevel, MemoryCacheKey.Module, keyContent); var vm_list = MemoryCacheHelper.GetSet(cacheKey, () => { var allList = new Service.Project().GetByProductID(productId); Service.Project.PublishCache(cacheKey); allList = allList?.Where(x => x.UseStatus == Model.eUseStatus.Enable).ToList(); var vmList = allList?.Select(x => new ProjectStdDto(x)).ToList(); return vmList; }, Yw.Service.ConfigHelper.CacheLevel2); return vm_list; } /// /// 通过 CorpID 获取 /// [Route("GetByCorpID@V1.0")] [HttpGet] public List GetByCorpID([FromQuery][Required] CorpIDInput input) { var corpId = input.CorpID; var keyContent = $"Auth_Project_Std_GetByCorpID_{corpId}"; var cacheKey = MemoryCacheKeyHelper.GetKey(MemoryCacheKey.WebApiLevel, MemoryCacheKey.Module, keyContent); var vm_list = MemoryCacheHelper.GetSet(cacheKey, () => { var allList = new Service.Project().GetByCorpID(corpId); Service.Project.PublishCache(cacheKey); allList = allList?.Where(x => x.UseStatus == Model.eUseStatus.Enable).ToList(); var vmList = allList?.Select(x => new ProjectStdDto(x)).ToList(); return vmList; }, Yw.Service.ConfigHelper.CacheLevel2); return vm_list; } } }