using Microsoft.AspNetCore.Authorization; namespace IStation.Application { /// /// Certificate /// [Route("SQI/Certificate/Std")] [ApiDescriptionSettings("SQI", Name = "证书(Std)", Order = 79900)] public class Certificate_StdController : IDynamicApiController { /// /// 获取所有 /// [Route("GetAll@V1.0")] [HttpGet] public List GetAll() { var keyContent = $"SQI_Certificate_Std_GetAll"; var cacheKey = $"{MemoryCacheKeyHelper.GetPrefix(MemoryCacheKey.WebApiLevel, MemoryCacheKey.Module)}_{keyContent}"; var vm_list = MemoryCacheHelper.GetSet(cacheKey, () => { var allList = new Service.Certificate().GetAll(); Service.Certificate.PublishCache(cacheKey); var vmList = allList?.Select(x => new CertificateStdDto(x)).ToList(); return vmList; }, CacheHelper.CacheLevel5); return vm_list; } /// /// 获取所有 (不需要Token验证) /// [AllowAnonymous] [Route("GetAll@V2.0")] [HttpGet] public List GetAll_V2_0() { var keyContent = $"SQI_Certificate_Std_GetAll_V2_0"; var cacheKey = $"{MemoryCacheKeyHelper.GetPrefix(MemoryCacheKey.WebApiLevel, MemoryCacheKey.Module)}_{keyContent}"; var vm_list = MemoryCacheHelper.GetSet(cacheKey, () => { var allList = new Service.Certificate().GetAll(); Service.Certificate.PublishCache(cacheKey); var vmList = allList?.Select(x => new CertificateStdDto(x)).ToList(); return vmList; }, CacheHelper.CacheLevel5); return vm_list; } } }