From cb75196455b23e345ab9b3a50a5c1bc2a7b75890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=B7=B3?= Date: Wed, 19 Apr 2023 11:19:36 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=B7=BB=E5=8A=A0=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E7=9B=91=E6=8E=A7=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Rbac/Services/IMonitorCacheService.cs | 12 ++++++ .../Rbac/Services/Impl/MonitorCacheService.cs | 42 +++++++++++++++++++ .../MonitorCacheGetListOutputDto.cs | 16 +++++++ .../MonitorCacheNameGetListOutputDto.cs | 14 +++++++ Yi.RuoYi.Vue3/src/api/monitor/cache.js | 6 +-- 5 files changed, 87 insertions(+), 3 deletions(-) create mode 100644 Yi.Furion.Net6/Yi.Furion.Application/Rbac/Services/IMonitorCacheService.cs create mode 100644 Yi.Furion.Net6/Yi.Furion.Application/Rbac/Services/Impl/MonitorCacheService.cs create mode 100644 Yi.Furion.Net6/Yi.Furion.Core/Rbac/Dtos/MonitorCache/MonitorCacheGetListOutputDto.cs create mode 100644 Yi.Furion.Net6/Yi.Furion.Core/Rbac/Dtos/MonitorCache/MonitorCacheNameGetListOutputDto.cs diff --git a/Yi.Furion.Net6/Yi.Furion.Application/Rbac/Services/IMonitorCacheService.cs b/Yi.Furion.Net6/Yi.Furion.Application/Rbac/Services/IMonitorCacheService.cs new file mode 100644 index 00000000..2d510aa8 --- /dev/null +++ b/Yi.Furion.Net6/Yi.Furion.Application/Rbac/Services/IMonitorCacheService.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Furion.Application.Rbac.Services +{ + public interface IMonitorCacheService + { + } +} diff --git a/Yi.Furion.Net6/Yi.Furion.Application/Rbac/Services/Impl/MonitorCacheService.cs b/Yi.Furion.Net6/Yi.Furion.Application/Rbac/Services/Impl/MonitorCacheService.cs new file mode 100644 index 00000000..e44f43fa --- /dev/null +++ b/Yi.Furion.Net6/Yi.Furion.Application/Rbac/Services/Impl/MonitorCacheService.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.Extensions.Caching.Memory; +using Yi.Furion.Core.Rbac.Dtos.MonitorCache; + +namespace Yi.Furion.Application.Rbac.Services.Impl +{ + public class MonitorCacheService : IMonitorCacheService,IDynamicApiController,ITransient + { + private IMemoryCache _memoryCache; + public MonitorCacheService(IMemoryCache memoryCache) + { + _memoryCache = memoryCache; + } + //cacheKey value为空,只要name和备注 + + public List GetName() + { + return new List() { + new MonitorCacheNameGetListOutputDto{ CacheName="Yi:Login",Remark="登录验证码"}, + new MonitorCacheNameGetListOutputDto{ CacheName="Yi:User",Remark="用户信息"} + }; + } + [HttpGet("key/{cacaheName}")] + public List GetKey([FromRoute] string cacaheName) + { + return new List() { "1233124","3124","1231251","12312412"}; + } + + //全部不为空 + [HttpGet("value/{cacaheName}/{cacaheKey}")] + public MonitorCacheGetListOutputDto GetValue([FromRoute] string cacaheName, [FromRoute] string cacaheKey) + { + return new MonitorCacheGetListOutputDto() { CacheKey= "1233124",CacheName= "Yi:Login",CacheValue="ttt",Remark= "登录验证码" }; + } + } + + +} diff --git a/Yi.Furion.Net6/Yi.Furion.Core/Rbac/Dtos/MonitorCache/MonitorCacheGetListOutputDto.cs b/Yi.Furion.Net6/Yi.Furion.Core/Rbac/Dtos/MonitorCache/MonitorCacheGetListOutputDto.cs new file mode 100644 index 00000000..356a5fa3 --- /dev/null +++ b/Yi.Furion.Net6/Yi.Furion.Core/Rbac/Dtos/MonitorCache/MonitorCacheGetListOutputDto.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Furion.Core.Rbac.Dtos.MonitorCache +{ + public class MonitorCacheGetListOutputDto + { + public string CacheName { get; set; } + public string CacheKey { get; set; } + public string CacheValue { get; set; } + public string Remark { get; set; } + } +} diff --git a/Yi.Furion.Net6/Yi.Furion.Core/Rbac/Dtos/MonitorCache/MonitorCacheNameGetListOutputDto.cs b/Yi.Furion.Net6/Yi.Furion.Core/Rbac/Dtos/MonitorCache/MonitorCacheNameGetListOutputDto.cs new file mode 100644 index 00000000..27baa273 --- /dev/null +++ b/Yi.Furion.Net6/Yi.Furion.Core/Rbac/Dtos/MonitorCache/MonitorCacheNameGetListOutputDto.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Furion.Core.Rbac.Dtos.MonitorCache +{ + public class MonitorCacheNameGetListOutputDto + { + public string CacheName { get; set; } + public string Remark { get; set; } + } +} diff --git a/Yi.RuoYi.Vue3/src/api/monitor/cache.js b/Yi.RuoYi.Vue3/src/api/monitor/cache.js index 72c5f6a3..cf495d4c 100644 --- a/Yi.RuoYi.Vue3/src/api/monitor/cache.js +++ b/Yi.RuoYi.Vue3/src/api/monitor/cache.js @@ -11,7 +11,7 @@ export function getCache() { // 查询缓存名称列表 export function listCacheName() { return request({ - url: '/monitor/cache/getNames', + url: '/monitor-cache/name', method: 'get' }) } @@ -19,7 +19,7 @@ export function listCacheName() { // 查询缓存键名列表 export function listCacheKey(cacheName) { return request({ - url: '/monitor/cache/getKeys/' + cacheName, + url: '/monitor-cache/key/' + cacheName, method: 'get' }) } @@ -27,7 +27,7 @@ export function listCacheKey(cacheName) { // 查询缓存内容 export function getCacheValue(cacheName, cacheKey) { return request({ - url: '/monitor/cache/getValue/' + cacheName + '/' + cacheKey, + url: '/monitor-cache/value/' + cacheName + '/' + cacheKey, method: 'get' }) }