|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
using Common.Utilities;
|
|
|
|
|
using Common.Tools;
|
|
|
|
|
using Common.Utilities;
|
|
|
|
|
using djy.IService.Afr;
|
|
|
|
|
using djy.Model.AmsDto;
|
|
|
|
|
using djy_AfrApi.Attributes;
|
|
|
|
@ -6,13 +7,15 @@ using Microsoft.AspNetCore.Authorization;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
|
|
|
|
|
namespace djy_AfrApi.Controllers.Common
|
|
|
|
|
{
|
|
|
|
|
[Route("api/[controller]")]
|
|
|
|
|
[ApiController]
|
|
|
|
|
[Authorize]
|
|
|
|
|
public class CommonController
|
|
|
|
|
public class CommonController : ApiBase
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
private readonly IAfrService ser;
|
|
|
|
@ -196,6 +199,26 @@ namespace djy_AfrApi.Controllers.Common
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 清除所有Redis缓存
|
|
|
|
|
/// </summary>
|
|
|
|
|
[AllowAnonymous]
|
|
|
|
|
[HttpGet("[action]")]
|
|
|
|
|
public Response ClearCache()
|
|
|
|
|
{
|
|
|
|
|
var type = typeof(CommonController);
|
|
|
|
|
MethodInfo[] methods = type.GetMethods(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public);
|
|
|
|
|
foreach (MethodInfo item in methods)
|
|
|
|
|
{
|
|
|
|
|
var attr = item.GetCustomAttributes(typeof(RedisCachingAttribute));
|
|
|
|
|
if (attr.Any())
|
|
|
|
|
{
|
|
|
|
|
YsRedisHelp.RedisClena(item.Name + "Cache");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return SuccessResp();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///// <summary>
|
|
|
|
|
///// 下拉获取省份
|
|
|
|
|