feat:添加缓存监控页面
This commit is contained in:
@@ -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
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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<MonitorCacheNameGetListOutputDto> GetName()
|
||||||
|
{
|
||||||
|
return new List<MonitorCacheNameGetListOutputDto>() {
|
||||||
|
new MonitorCacheNameGetListOutputDto{ CacheName="Yi:Login",Remark="登录验证码"},
|
||||||
|
new MonitorCacheNameGetListOutputDto{ CacheName="Yi:User",Remark="用户信息"}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
[HttpGet("key/{cacaheName}")]
|
||||||
|
public List<string> GetKey([FromRoute] string cacaheName)
|
||||||
|
{
|
||||||
|
return new List<string>() { "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= "登录验证码" };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,7 +11,7 @@ export function getCache() {
|
|||||||
// 查询缓存名称列表
|
// 查询缓存名称列表
|
||||||
export function listCacheName() {
|
export function listCacheName() {
|
||||||
return request({
|
return request({
|
||||||
url: '/monitor/cache/getNames',
|
url: '/monitor-cache/name',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -19,7 +19,7 @@ export function listCacheName() {
|
|||||||
// 查询缓存键名列表
|
// 查询缓存键名列表
|
||||||
export function listCacheKey(cacheName) {
|
export function listCacheKey(cacheName) {
|
||||||
return request({
|
return request({
|
||||||
url: '/monitor/cache/getKeys/' + cacheName,
|
url: '/monitor-cache/key/' + cacheName,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -27,7 +27,7 @@ export function listCacheKey(cacheName) {
|
|||||||
// 查询缓存内容
|
// 查询缓存内容
|
||||||
export function getCacheValue(cacheName, cacheKey) {
|
export function getCacheValue(cacheName, cacheKey) {
|
||||||
return request({
|
return request({
|
||||||
url: '/monitor/cache/getValue/' + cacheName + '/' + cacheKey,
|
url: '/monitor-cache/value/' + cacheName + '/' + cacheKey,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user